-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: show better error message if testing type is not configured #22000
feat: show better error message if testing type is not configured #22000
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
…if-testingType-is-not-configured
…if-testingType-is-not-configured
…if-testingType-is-not-configured
…if-testingType-is-not-configured
…if-testingType-is-not-configured
…if-testingType-is-not-configured
…if-testingType-is-not-configured
packages/errors/src/errors.ts
Outdated
return errTemplate` | ||
The testing type selected (${fmt.highlight(testingType)}) is not configured in your config file. | ||
|
||
Please update it, and try running it again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also want to direct users to the configuration docs here? https://on.cypress.io/configuration
We do so for other errors, like INVALID_CONFIG_OPTION.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this would be good to add also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
…if-testingType-is-not-configured
…-is-not-configured' of github.com:cypress-io/cypress into alejandro/feat/show-better-error-message-if-testingType-is-not-configured
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it a test and it's working as expected.
cd packges/driver
yarn cypress:run --component
yarn run v1.22.11
$ node ../../scripts/cypress run --spec "cypress/e2e/*/*","cypress/e2e/*/!(origin|sessions)/**/*" --component
The testing type selected (component) is not configured in your config file.
Please run ‘cypress open’ and choose your testing type to automatically update your configuration file.
https://on.cypress.io/configuration
error Command failed with exit code 1.
…if-testingType-is-not-configured
…if-testingType-is-not-configured
…press-io#22000) * feat: show better error message if testing type is not configured * Add tests * Update tests * Fix some tests * Fix some tests * Fix test * Fix tests * Update packages/errors/src/errors.ts Co-authored-by: Jennifer Shehane <jennifer@cypress.io> * Update with code review * Fix test * Add on link Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
cypress run
when CT/E2E has not been configured. #21909User facing changelog
Additional details
When a testing type is selected in run mode, and it has not been configured (
e2e
orcomponent
property) in the config file, we are showing a better error message, letting know the user that it needs to be configured before running itIf the selected testing type is
e2e
the config file needs to have at leaste2e: {}
but if the selected testing type iscomponent
it needs to have configured thedevServer
It is checked based on this logic
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?