cleanup(misc): cleanup misc e2e tests (#21704)

This commit is contained in:
Leosvel Pérez Espinosa 2024-02-10 00:14:16 +01:00 committed by GitHub
parent 27faa7d017
commit e810f82124
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 13 deletions

View File

@ -126,7 +126,7 @@ describe('Angular Projects', () => {
); );
// check e2e tests // check e2e tests
if (runE2ETests()) { if (runE2ETests('cypress')) {
const e2eResults = runCLI(`e2e ${app1}-e2e`); const e2eResults = runCLI(`e2e ${app1}-e2e`);
expect(e2eResults).toContain('All specs passed!'); expect(e2eResults).toContain('All specs passed!');
expect(await killPort(4200)).toBeTruthy(); expect(await killPort(4200)).toBeTruthy();
@ -152,15 +152,14 @@ describe('Angular Projects', () => {
await killProcessAndPorts(esbProcess.pid, appPort); await killProcessAndPorts(esbProcess.pid, appPort);
}, 1000000); }, 1000000);
// TODO: enable this when tests are passing again. it('should successfully work with playwright for e2e tests', async () => {
xit('should successfully work with playwright for e2e tests', async () => {
const app = uniq('app'); const app = uniq('app');
runCLI( runCLI(
`generate @nx/angular:app ${app} --e2eTestRunner=playwright --project-name-and-root-format=as-provided --no-interactive` `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`); const e2eResults = runCLI(`e2e ${app}-e2e`);
expect(e2eResults).toContain( expect(e2eResults).toContain(
`Successfully ran target e2e for project ${app}-e2e` `Successfully ran target e2e for project ${app}-e2e`

View File

@ -42,7 +42,7 @@ describe('Angular Cypress Component Tests', () => {
runCLI( runCLI(
`generate @nx/angular:cypress-component-configuration --project=${appName} --generate-tests --no-interactive` `generate @nx/angular:cypress-component-configuration --project=${appName} --generate-tests --no-interactive`
); );
if (runE2ETests()) { if (runE2ETests('cypress')) {
expect(runCLI(`component-test ${appName}`)).toContain( expect(runCLI(`component-test ${appName}`)).toContain(
'All specs passed!' 'All specs passed!'
); );
@ -53,7 +53,7 @@ describe('Angular Cypress Component Tests', () => {
runCLI( runCLI(
`generate @nx/angular:cypress-component-configuration --project=${usedInAppLibName} --generate-tests --no-interactive` `generate @nx/angular:cypress-component-configuration --project=${usedInAppLibName} --generate-tests --no-interactive`
); );
if (runE2ETests()) { if (runE2ETests('cypress')) {
expect(runCLI(`component-test ${usedInAppLibName}`)).toContain( expect(runCLI(`component-test ${usedInAppLibName}`)).toContain(
'All specs passed!' 'All specs passed!'
); );
@ -73,7 +73,7 @@ describe('Angular Cypress Component Tests', () => {
runCLI( runCLI(
`generate @nx/angular:cypress-component-configuration --project=${buildableLibName} --generate-tests --build-target=${appName}:build --no-interactive` `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( expect(runCLI(`component-test ${buildableLibName}`)).toContain(
'All specs passed!' 'All specs passed!'
); );
@ -95,7 +95,7 @@ describe('Angular Cypress Component Tests', () => {
} }
); );
if (runE2ETests()) { if (runE2ETests('cypress')) {
expect(runCLI(`component-test ${buildableLibName}`)).toContain( expect(runCLI(`component-test ${buildableLibName}`)).toContain(
'All specs passed!' 'All specs passed!'
); );
@ -111,7 +111,7 @@ describe('Angular Cypress Component Tests', () => {
updateBuilableLibTestsToAssertAppStyles(appName, buildableLibName); updateBuilableLibTestsToAssertAppStyles(appName, buildableLibName);
if (runE2ETests()) { if (runE2ETests('cypress')) {
expect(runCLI(`component-test ${buildableLibName}`)).toContain( expect(runCLI(`component-test ${buildableLibName}`)).toContain(
'All specs passed!' 'All specs passed!'
); );
@ -123,7 +123,7 @@ describe('Angular Cypress Component Tests', () => {
checkFilesExist('tailwind.config.js'); checkFilesExist('tailwind.config.js');
checkFilesDoNotExist(`${buildableLibName}/tailwind.config.js`); checkFilesDoNotExist(`${buildableLibName}/tailwind.config.js`);
if (runE2ETests()) { if (runE2ETests('cypress')) {
expect(runCLI(`component-test ${buildableLibName}`)).toContain( expect(runCLI(`component-test ${buildableLibName}`)).toContain(
'All specs passed!' 'All specs passed!'
); );

View File

@ -376,7 +376,7 @@ describe('Angular Module Federation', () => {
const buildRemoteOutput = runCLI(`build ${remote}`); const buildRemoteOutput = runCLI(`build ${remote}`);
expect(buildRemoteOutput).toContain('Successfully ran target build'); expect(buildRemoteOutput).toContain('Successfully ran target build');
if (runE2ETests()) { if (runE2ETests('cypress')) {
const e2eProcess = await runCommandUntil( const e2eProcess = await runCommandUntil(
`e2e ${host}-e2e --no-watch`, `e2e ${host}-e2e --no-watch`,
(output) => output.includes('All specs passed!') (output) => output.includes('All specs passed!')
@ -468,7 +468,7 @@ describe('Angular Module Federation', () => {
const buildRemoteOutput = runCLI(`build ${remote}`); const buildRemoteOutput = runCLI(`build ${remote}`);
expect(buildRemoteOutput).toContain('Successfully ran target build'); expect(buildRemoteOutput).toContain('Successfully ran target build');
if (runE2ETests()) { if (runE2ETests('cypress')) {
const e2eProcess = await runCommandUntil( const e2eProcess = await runCommandUntil(
`e2e ${host}-e2e --no-watch`, `e2e ${host}-e2e --no-watch`,
(output) => output.includes('All specs passed!') (output) => output.includes('All specs passed!')

View File

@ -40,7 +40,7 @@ describe('Cypress E2E Test runner (legacy)', () => {
TEN_MINS_MS TEN_MINS_MS
); );
xit( it(
`should allow CT and e2e in same project - react`, `should allow CT and e2e in same project - react`,
async () => { async () => {
const appName = uniq(`react-cy-app`); const appName = uniq(`react-cy-app`);