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: support ct/e2e specific overrides in cypress.json #15526
Conversation
Thanks for taking the time to open a PR!
|
@@ -93,6 +93,10 @@ module.exports = { | |||
}, _.cloneDeep(obj)) | |||
}, | |||
|
|||
isComponentTesting (options = {}) { |
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.
Need to simplify this to a single flag at some point.
Internal Jira issue: TR-716 |
Test summaryRun details
View run in Cypress Dashboard ➡️ 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 |
Worth noting the latest working session notes are here: https://www.notion.so/cypressdx/Config-Changes-for-7-0-ce5f6221b6d64b55b5cc633460463b13 |
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 think we should add mode
to the config
object argument instead of adding a 3rd argument. It would be consistent with what we've done with other properties that aren't strictly "config".
I also wonder if we should rethink calling it mode
as well. We often refer to "run mode" and "interactive mode" depending on whether you run cypress with cypress run
or cypress open
, so it could be confusing to have another type of "mode" that refers to a different concept.
I also thought it was weird the @brian-mann and @flotwig wanted it as a third argument instead of on config. Were there reasons for that?
@elevatebart had the same feedback regarding naming. I'm okay with changing it. The comments in cypress.schema.json regarding e2e vs component say Thoughts? |
My points were more broadly related to the conventions of "what exactly is configuration" - and I mentioned things like... Whereas things like Yes I know we currently put things like |
For instance - knowing whether or not you are in open mode vs interactive mode is currently checked for by an undocumented With adding componentTesting, we now have a matrix of runtime modes. |
Then, perhaps do we need an "immutable stuff" variable instead of just a third "mode"? |
I generally agree and my initial implementation of providing the projectRoot and configFile to the plugins file utilized a 3rd argument for that reason. You can see the commit here. Unfortunately, I can't find the feedback/discussion that convinced me to add the properties to I think we could still utilize a 3rd argument as long as it's an object. But I think that's outside the scope of this work. I advocate we add it to |
In regards to the name, just tossing out some ideas:
|
i agree for now too. i think maybe we could just put all of those immutable environment kinds of things on a standard key on the this is where things like Maybe We would then slice out |
See the API summary here: https://www.notion.so/cypressdx/Config-Changes-for-7-0-ce5f6221b6d64b55b5cc633460463b13 |
const ifComponentMode = babelTypes.ifStatement( | ||
babelTypes.binaryExpression( | ||
'===', | ||
babelTypes.identifier('config.mode'), |
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.
@lmiller1990 once you will came up with the final API – please edit this line
babelTypes.identifier('config.mode'), | |
babelTypes.identifier('config.testingType'), |
And update snapshots to verify everything works as expected
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.
Ok, I can do it.
I made some improvements as per this specification file.
|
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.
Great stuff! 👍
…)" This reverts commit 43c8ae2.
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Note: Some other changes here to support create-cypress-tests wizard. Ignore those for the purpose of this review.
User facing changelog
1. Add support for runner specific overrides in
cypress.json
. Like this:2. Pass
testingType
toconfig
in plugin functionconfig
now includes atestingType
property. It is eithere2e
orcomponent
. The user can have conditional plugins using this flag.Additional details
It's very useful now that we have two runners, CT and E2E.
How has the user experience changed?
You can have runner specific config, and runner specific plugins.
PR Tasks
cypress-documentation
] Here it is: docs: document mode argument to plugins cypress-documentation#3693type definitions
? Yes.cypress.schema.json
? Yes.