Skip to content

Commit

Permalink
Summary Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
almirhodzic committed Feb 25, 2024
1 parent d57df66 commit 9c20d26
Show file tree
Hide file tree
Showing 9 changed files with 1,330 additions and 16 deletions.
36 changes: 22 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
# Admin
# MiniCart-Admin

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.10.
MiniCart-Admin ist ein Webshop der Allerlei verkauft. Es gibt einen Admin und einen Benutzerbereich.
Die App wurde in Angular 17.0.9 geschrieben.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
## Demo-Shop

Du kannst den Demo-Shop hier besuchen: [https://minicart.ch](https://minicart.ch)

## Code scaffolding
## Initial Setup

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
Im App-Verzeichnis zuerst Abhängigkeiten installieren:`nmp i` oder `nmp install`.

## Build
## Development server

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
Um den Entwicklungsserver zu starten, folgenden Befehl ausführen:`ng serve` oder `ng s`.
Öffne im Browser die Url http://localhost:4200/. Die App wird automatisch gestartet.

## Running unit tests
## App Build
Um die App zu builden folgenden Befehl ausführen:`ng build`.

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Api-Server

## Running end-to-end tests
Bitte denke daran, dass diese App nur mit einer lokale Laravel-Installation funktionert.
Die Api-Url für den Demo-Shop: https://api.minicart.ch/api/ kann nicht im Develeopment server angesprochen werden.
Du kannst den Server von hier ziehen: https://github.com/almirhodzic/minicart-server und lokal installieren.
(Minimale Laravel-Kenntnisse vorausgesetzt)

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
## Unit Test

## Further help
Für den Unit Test mit [Karma](https://karma-runner.github.io/latest/index.html), führe folgenden Befehl aus:`ng test`

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
## e2e Test
npm run cypress:open
9 changes: 9 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
17 changes: 17 additions & 0 deletions cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
describe('template spec', () => {
it('passes', () => {
cy.visit('https://minicart.ch/dashboard')
})
})

it('Login-Test auf minicart.ch', function () {
const loginPage = 'https://minicart.ch/login'
const loginUser = '[email protected]'
const loginPass = '1234'

cy.visit(loginPage)
cy.get('input[type="email"]').type(loginUser)
cy.get('input[type="password"]').type(`${loginPass}{enter}`)
cy.url().should('include', '/dashboard')
cy.get('h5').should('contain', 'Hallo Admin!')
})
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
37 changes: 37 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
20 changes: 20 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading

0 comments on commit 9c20d26

Please sign in to comment.