Skip to content

Commit

Permalink
chore(repo): run all cypress e2e tests headless and w/o watch (#6125)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Jun 25, 2021
1 parent 3c0afc9 commit f77bc78
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
12 changes: 8 additions & 4 deletions e2e/angular/src/storybook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
readFile,
removeProject,
runCLI,
runCypressTests,
tmpProjPath,
uniq,
} from '@nrwl/e2e/utils';
Expand Down Expand Up @@ -179,17 +180,20 @@ describe('Storybook schematics', () => {
`
);

expect(runCLI(`run ${myAngularLib}-e2e:e2e --no-watch`)).toContain(
'All specs passed!'
);
if (runCypressTests()) {
const e2eResults = runCLI(
`e2e ${myAngularLib}-e2e --headless --no-watch`
);
expect(e2eResults).toContain('All specs passed!');
expect(await killPorts()).toBeTruthy();
}

runCLI(`run ${myAngularLib}:build-storybook`);

checkFilesExist(`dist/storybook/${myAngularLib}/index.html`);
expect(readFile(`dist/storybook/${myAngularLib}/index.html`)).toContain(
`<title>Storybook</title>`
);
expect(await killPorts()).toBeTruthy();
}
}, 1000000);

Expand Down
2 changes: 1 addition & 1 deletion e2e/next/src/next.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ async function checkApp(
}

if (opts.checkE2E && runCypressTests()) {
const e2eResults = runCLI(`e2e ${appName}-e2e --headless`);
const e2eResults = runCLI(`e2e ${appName}-e2e --headless --no-watch`);
expect(e2eResults).toContain('All specs passed!');
expect(await killPorts()).toBeTruthy();
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/nx-plugin/src/nx-plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('Nx Plugin', () => {
runCLI(`generate @nrwl/nx-plugin:plugin ${plugin} --linter=eslint`);

if (isNotWindows() && runCypressTests()) {
const e2eResults = runCLI(`e2e ${plugin}-e2e --no-watch --headless`);
const e2eResults = runCLI(`e2e ${plugin}-e2e --headless --no-watch`);
expect(e2eResults).toContain('Running target "e2e" succeeded');
expect(await killPorts()).toBeTruthy();
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/react/src/react.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ describe('React Applications', () => {
);

if (opts.checkE2E && runCypressTests()) {
const e2eResults = runCLI(`e2e ${appName}-e2e`);
const e2eResults = runCLI(`e2e ${appName}-e2e --headless --no-watch`);
expect(e2eResults).toContain('All specs passed!');
expect(await killPorts()).toBeTruthy();
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/web/src/web.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Web Components Applications', () => {
expect(lintE2eResults).toContain('All files pass linting.');

if (isNotWindows() && runCypressTests()) {
const e2eResults = runCLI(`e2e ${appName}-e2e --headless`);
const e2eResults = runCLI(`e2e ${appName}-e2e --headless --no-watch`);
expect(e2eResults).toContain('All specs passed!');
expect(await killPorts()).toBeTruthy();
}
Expand Down

0 comments on commit f77bc78

Please sign in to comment.