diff --git a/apps/frontend-e2e/cypress.config.ts b/apps/frontend-e2e/cypress.config.ts index bc91e98d..245f1fc8 100644 --- a/apps/frontend-e2e/cypress.config.ts +++ b/apps/frontend-e2e/cypress.config.ts @@ -1,6 +1,9 @@ -import { defineConfig } from 'cypress'; -import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; +import {defineConfig} from 'cypress'; +import {nxE2EPreset} from '@nx/cypress/plugins/cypress-preset'; export default defineConfig({ - e2e: nxE2EPreset(__dirname), + e2e: { + ...nxE2EPreset(__dirname), + baseUrl: 'http://localhost:4200', + }, }); diff --git a/apps/frontend-e2e/src/e2e/app.cy.ts b/apps/frontend-e2e/src/e2e/app.cy.ts index 45ff7390..f167c907 100644 --- a/apps/frontend-e2e/src/e2e/app.cy.ts +++ b/apps/frontend-e2e/src/e2e/app.cy.ts @@ -1,13 +1,8 @@ -import { getGreeting } from '../support/app.po'; - describe('web', () => { - beforeEach(() => cy.visit('/')); - - it('should display welcome message', () => { - // Custom command example, see `../support/commands.ts` file - cy.login('my-email@something.com', 'myPassword'); + beforeEach(() => cy.visit('/dashboard')); - // Function helper example, see `../support/app.po.ts` file - getGreeting().contains('Welcome web'); + it('should display the dashboard', () => { + cy.get('app-navbar').should('be.visible'); + cy.get('app-dashboard').should('be.visible'); }); }); diff --git a/apps/frontend-e2e/src/support/commands.ts b/apps/frontend-e2e/src/support/commands.ts index 310f1fa0..219cd954 100644 --- a/apps/frontend-e2e/src/support/commands.ts +++ b/apps/frontend-e2e/src/support/commands.ts @@ -1,33 +1,5 @@ // *********************************************** -// This example commands.js 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 // *********************************************** - -// eslint-disable-next-line @typescript-eslint/no-namespace -declare namespace Cypress { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - interface Chainable { - login(email: string, password: string): void; - } -} -// -// -- This is a parent command -- -Cypress.Commands.add('login', (email, password) => { - console.log('Custom command example: 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) => { ... })