Closed tar-aldev closed 4 months ago
In general I have noticed that Cypress doesn't work too well with inferred tasks / Project Crystal. I still need to add all the manual configuration to make either work, even for newly generated projects. Issues ranging from certain commands (i.e. --watch
) not working to certain options not being available that are described in the documentation.
Just ran into the same issue with e2e tests. As above, I had to specifically add the target to project.json to make it work.
Same here. Probably --watch
and other flags doesn't works because infer targets are using nx:run-commands
instead of @nx/cypress:cypress
as executor and they are custom flags of @nx/cypress
plugin.
This is our infer e2e target:
"e2e": {
"cache": true,
"inputs": [
"default",
"^production"
],
"outputs": [
"{workspaceRoot}\\dist\\cypress\\apps\\evohrp-e2e\\videos",
"{workspaceRoot}\\dist\\cypress\\apps\\evohrp-e2e\\screenshots"
],
"executor": "nx:run-commands",
"options": {
"cwd": "apps/evohrp-e2e",
"command": "cypress run"
},
"configurations": {
"production": {
"command": "cypress run --env webServerCommand=\"nx run evohrp:serve:production\""
}
}
},
You can check yourself with command nx show project <project-name>
.
Unfortunately I have found no way to use cypress open
without overriding infer e2e command.
Thanks for reporting this!
We addressed running the e2e tests in watch mode in https://github.com/nrwl/nx/pull/22556 that was released in Nx 18.2.0. The Cypress plugin will now infer an open-cypress
task that runs cypress open
.
I'll take a look for Component Testing.
@tar-aldev could you update your repo to at least Nx 18.2.0 and try running the newly inferred open-cypress
task?
This issue has been automatically marked as stale because no results of retrying on the latest version of Nx was provided within 7 days. It will be closed in 21 days if no results are provided. If the issue is still present, please reply to keep it active. If the issue was not present, please close this issue. Thanks for being a part of the Nx community! 🙏
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
When trying to run nx component-test --watch it fails with
I can reproduce it both on new and existing project. As a result it is impossible to run cypress tests in watch mode.
Expected Behavior
--watch flag should work for tests. It is also not possible to set it in project.json targets as an option.
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
If I put this into
project.json
then I am able to pass
--watch
flag. Not sure if this is an expected bahviour or not