## Current Behavior
Cypress e2e tasks fail when trying to kill the web server with:
```bash
TypeError: Cannot read properties of undefined (reading 'childProcess')
at /<repo path>/node_modules/@nx/cypress/plugins/cypress-preset.js:65:30
...
```
## Expected Behavior
Cypress e2e tasks should not fail when trying to kill the web server.
## Related Issue(s)
Fixes #
Prefer `process#kill` instead of `tree-kill` for Mac and Windows. This
fixes an issue on Windows where the `taskkill` is unsuccessful.
## Current Behavior
Windows does not always run successfully
## Expected Behavior
Windows runs successfully
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
## Current Behavior
The Cypress and Playwright graph plugins do not infer tasks configured
to take advantage of continuous tasks (do not add the task they run to
start the app/server as a dependency of the e2e task).
## Expected Behavior
The Cypress and Playwright graph plugins should infer tasks configured
to take advantage of continuous tasks.
## Related Issue(s)
Fixes #
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->
<!-- This is the behavior we have today -->
<!-- This is the behavior we should expect with the changes in this PR
-->
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
---------
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->
## Current Behavior
<!-- This is the behavior we have today -->
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
using `windowsHide: true` is causing an issue on windows: Ctrl + C
handling isn't enabled and no `SIGINT` is sent to the child process when
users exit the process. See https://github.com/nodejs/node/issues/29837
and https://github.com/nodejs/node-v0.x-archive/issues/5054 for
reference. This will cause leftover processes throughout nx.
This PR sets `windowsHide: false` everywhere except for the plugin
workers and some short-lived utils. They `spawn` child processes but
have explicit handling to make sure they kill themselves when the parent
process dies, so the missing Ctrl + C handling doesn't cause issues.
We will follow up to make sure any other culprits that still cause
windows popups (especially when used through Nx Console) are handled.
Leaving no leftover processes running is more important for now, though.
Keep in mind the underlying tooling (like vite) might have some windows
popups themselves that Nx will inherit.
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->
## Current Behavior
<!-- This is the behavior we have today -->
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
- fix(vite): preview should dependOn build
- fix(react): playwright should use vite preview
- fix(vue): playwright should use vite preview
- fix(web): playwright should use vite preview
- chore(testing): add e2e test
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->
## Current Behavior
<!-- This is the behavior we have today -->
Currently, `playwright` uses the `vite serve` command when setting up
the web server to run the e2e tests against.
The `vite preview` command/target should also depend on `vite build`.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`playwright` should use the `vite preview` command when setting up the
web server
`vite preview` targets add a `dependsOn["build"]`
Ensure `serve-static` has a dependsOn: ['build']
Cypress should use the `ciBaseUrl` if it exists when running the
`e2e-ci` targets
Migrations for Playwright and Cypress to use serve-static and preview
correctly
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->
## Current Behavior
<!-- This is the behavior we have today -->
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes#26599
We'd like to use shared cypress commands, but that's currently not
working because vite cannot resolve the import.
By allowing to pass options to the vite config we have the possibility
to add an alias or a plugin to fix this.
This adds support for an **optional** `viteConfigOverrides` object.
## Current Behavior

cypress.config.ts:
```ts
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
...nxE2EPreset(__filename, { cypressDir: 'cypress', bundler: 'vite' }),
},
});
```
## Expected Behavior

cypress.config.ts:
```ts
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';
const viteConfigOverrides = {
resolve: {
alias: {
'@cypress-shared-commands': '../../../shared-cypress-commands',
},
},
};
export default defineConfig({
e2e: {
...nxE2EPreset(__filename, { cypressDir: 'cypress', bundler: 'vite', viteConfigOverrides }),
},
});
```
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
* fix(testing): normalize paths before accessing the project graph
* fix(testing): return object with offset input instead of string
* fix(testing): update schemas to provide better prompts
* feat(testing): ng cypress component testing
closes: #11602
* chore(testing): move story utils into common util area
* feat(testing): add options for ng component testing
* docs(testing): add more info for component testing
* chore(testing): address PR feedback
* chore(testing): remove logs
* fix(testing): use @nrwl/web:webpack utils to generate a more robust webpack config
fixes: #11372
* fix(testing): do not overwrite existing component test
* fix(testing): add component-test to cacheable operations
* chore(testing): address pr feedback
* feat(testing): add generator to aid in the migration to cypress 10
cypress 10 introduces a new configuration format and new layout that requires update settings and
files for e2e projects
* feat(testing): cypress component tests for react/next
initial work for cypress component tests for react and next
* feat(testing): add support for v10 e2e cypress projects
create the correct files for cypress projects >v10 and reorganize tests based on version to allow
easier parsing of tests
* feat(testing): add utils for modifying cypress v10 config
provide ts transformers to take in an existing cypress config and update/add properties within the
given configuration
* fix(testing): fix tests affected by the cypress v10 changes
update tests to assert the correct files/folders/file contents due to the cypress changes in v10
* cleanup(testing): move cypress component testing plugins into the respective packages
move the plugins into out of cypress plugins into the specific vertical plugin to prevent issues
with circular refs
* cleanup(testing): bump cypress version
bump to latest cypress v10 release
* docs(testing): update docs for cypress 10
update cypress docs to include info about component testing and migration to cypress v10
* fix(repo): revert cypress version bump
keep v9 of cypress installed for nx repo until v10 release
* fix(testing): update cypress gen tsconfig and infer targets with converter
* fix(testing): make sure tests use the cypress v10 (for the intermediate)
* fix(testing): update target name after feedback
* fix(testing): support multiple target w/custom configs for cypress v10 migration
* fix(testing): refactor cy component tests into seperate verticals
* feat(testing): create storybook cypress preset
* fix(testing): clean up cy v10 migration
* fix(testing): don't branch for cypress executor testingType
* fix(testing): move cy comp test generator to next
* fix(testing): bump cypress deps
* fix(testing): clean up cy component testing generators
* fix(testing): update cy component testing docs
* fix(testign): dep check. runtime plugin pulls from @nrwl/react
* fix(testing): move e2e into verticals
* fix(testing): address PR feedback
* fix(testing): clean up unit tests
* feat(angular): support migrating angular cli workspaces using cypress v10
* chore(testing): update e2e tests
* fix(testing): address pr feedback
* chore(testing): remove cypress component testing for next.js
* fix(testing): address pr feedback
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>