From 7e64aae0992e8c07814f0a136ed3d23ca9f5f37f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Sat, 10 Feb 2024 00:14:16 +0100 Subject: [PATCH] cleanup(misc): cleanup misc e2e tests (#21704) (cherry picked from commit e810f821243cc3cfde29a69eabadcfd33667ffbb) --- e2e/angular-core/src/projects.test.ts | 7 +++---- .../src/cypress-component-tests.test.ts | 12 ++++++------ .../src/module-federation.test.ts | 4 ++-- e2e/cypress/src/cypress-legacy.test.ts | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/e2e/angular-core/src/projects.test.ts b/e2e/angular-core/src/projects.test.ts index dd48850e27c81..20edb32f91990 100644 --- a/e2e/angular-core/src/projects.test.ts +++ b/e2e/angular-core/src/projects.test.ts @@ -126,7 +126,7 @@ describe('Angular Projects', () => { ); // check e2e tests - if (runE2ETests()) { + if (runE2ETests('cypress')) { const e2eResults = runCLI(`e2e ${app1}-e2e`); expect(e2eResults).toContain('All specs passed!'); expect(await killPort(4200)).toBeTruthy(); @@ -152,15 +152,14 @@ describe('Angular Projects', () => { await killProcessAndPorts(esbProcess.pid, appPort); }, 1000000); - // TODO: enable this when tests are passing again. - xit('should successfully work with playwright for e2e tests', async () => { + it('should successfully work with playwright for e2e tests', async () => { const app = uniq('app'); runCLI( `generate @nx/angular:app ${app} --e2eTestRunner=playwright --project-name-and-root-format=as-provided --no-interactive` ); - if (runE2ETests()) { + if (runE2ETests('playwright')) { const e2eResults = runCLI(`e2e ${app}-e2e`); expect(e2eResults).toContain( `Successfully ran target e2e for project ${app}-e2e` diff --git a/e2e/angular-extensions/src/cypress-component-tests.test.ts b/e2e/angular-extensions/src/cypress-component-tests.test.ts index abb9faf10d860..92408ef697153 100644 --- a/e2e/angular-extensions/src/cypress-component-tests.test.ts +++ b/e2e/angular-extensions/src/cypress-component-tests.test.ts @@ -42,7 +42,7 @@ describe('Angular Cypress Component Tests', () => { runCLI( `generate @nx/angular:cypress-component-configuration --project=${appName} --generate-tests --no-interactive` ); - if (runE2ETests()) { + if (runE2ETests('cypress')) { expect(runCLI(`component-test ${appName}`)).toContain( 'All specs passed!' ); @@ -53,7 +53,7 @@ describe('Angular Cypress Component Tests', () => { runCLI( `generate @nx/angular:cypress-component-configuration --project=${usedInAppLibName} --generate-tests --no-interactive` ); - if (runE2ETests()) { + if (runE2ETests('cypress')) { expect(runCLI(`component-test ${usedInAppLibName}`)).toContain( 'All specs passed!' ); @@ -73,7 +73,7 @@ describe('Angular Cypress Component Tests', () => { runCLI( `generate @nx/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build --no-interactive` ); - if (runE2ETests()) { + if (runE2ETests('cypress')) { expect(runCLI(`component-test ${buildableLibName}`)).toContain( 'All specs passed!' ); @@ -95,7 +95,7 @@ describe('Angular Cypress Component Tests', () => { } ); - if (runE2ETests()) { + if (runE2ETests('cypress')) { expect(runCLI(`component-test ${buildableLibName}`)).toContain( 'All specs passed!' ); @@ -111,7 +111,7 @@ describe('Angular Cypress Component Tests', () => { updateBuilableLibTestsToAssertAppStyles(appName, buildableLibName); - if (runE2ETests()) { + if (runE2ETests('cypress')) { expect(runCLI(`component-test ${buildableLibName}`)).toContain( 'All specs passed!' ); @@ -123,7 +123,7 @@ describe('Angular Cypress Component Tests', () => { checkFilesExist('tailwind.config.js'); checkFilesDoNotExist(`${buildableLibName}/tailwind.config.js`); - if (runE2ETests()) { + if (runE2ETests('cypress')) { expect(runCLI(`component-test ${buildableLibName}`)).toContain( 'All specs passed!' ); diff --git a/e2e/angular-module-federation/src/module-federation.test.ts b/e2e/angular-module-federation/src/module-federation.test.ts index 1bd12bc0bfbbd..52b6b6dbe05c4 100644 --- a/e2e/angular-module-federation/src/module-federation.test.ts +++ b/e2e/angular-module-federation/src/module-federation.test.ts @@ -376,7 +376,7 @@ describe('Angular Module Federation', () => { const buildRemoteOutput = runCLI(`build ${remote}`); expect(buildRemoteOutput).toContain('Successfully ran target build'); - if (runE2ETests()) { + if (runE2ETests('cypress')) { const e2eProcess = await runCommandUntil( `e2e ${host}-e2e --no-watch`, (output) => output.includes('All specs passed!') @@ -468,7 +468,7 @@ describe('Angular Module Federation', () => { const buildRemoteOutput = runCLI(`build ${remote}`); expect(buildRemoteOutput).toContain('Successfully ran target build'); - if (runE2ETests()) { + if (runE2ETests('cypress')) { const e2eProcess = await runCommandUntil( `e2e ${host}-e2e --no-watch`, (output) => output.includes('All specs passed!') diff --git a/e2e/cypress/src/cypress-legacy.test.ts b/e2e/cypress/src/cypress-legacy.test.ts index b927b2933a283..8630c91f93d05 100644 --- a/e2e/cypress/src/cypress-legacy.test.ts +++ b/e2e/cypress/src/cypress-legacy.test.ts @@ -40,7 +40,7 @@ describe('Cypress E2E Test runner (legacy)', () => { TEN_MINS_MS ); - xit( + it( `should allow CT and e2e in same project - react`, async () => { const appName = uniq(`react-cy-app`);