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: Passing --browser
flag alone will launch after test selection
#28538
base: develop
Are you sure you want to change the base?
Conversation
|
--browser
flag alone will launch after test selection in the GUI, the browser will automatically launch.
--browser
flag alone will launch after test selection in the GUI, the browser will automatically launch.--browser
flag alone will launch after test selection in the GUI, the browser will automatically launch.
--browser
flag alone will launch after test selection in the GUI, the browser will automatically launch.--browser
flag alone will launch after test selection in the GUI, the browser will automatically launch. Addresses [#22003](https://github.com/cypress-io/cypress/issues/22003).
--browser
flag alone will launch after test selection in the GUI, the browser will automatically launch. Addresses [#22003](https://github.com/cypress-io/cypress/issues/22003).--browser
flag alone will launch after test selection
Currently the way the code is, when running the command |
My suggestion is that if we couldn't find the browser that was passed, we should not open any browser and let you see the warning, then you'd have to either relaunch passing in a different browser name, or pick the browser you want from the list. |
I'm going to open this PR as ready for review so that I can get some feedback on the current code I have.
Since there is already a function that launches with the same values (testingType, wasBrowserSetInCli) I had to create a launch count to keep track of the calls to ensure that both functions wouldn't be called since they rely on the same values. I honestly feel like this is a bit hacky, so I will happily take some advice if changes need to be made. This is my first contribution to a large codebase, so I want to be sure that this is going in the right direction before I code myself into a corner. I will put this back in draft (if need be) after any feedback provided. |
@raygdev I'll see if the team has some time to review this next iteration. |
@jennifer-shehane sounds good! Thank you! |
@raygdev I hit that "update branch" button for you, it seems like there's now a little bit of cleanup needed in the changelog just FYI |
@marktnoonan Done! Thanks Mark! |
Additional details
--browser
flag is passed alone, after selecting the testing type, the selected browser will automatically launch.localSettings
field in theOpenBrowser
query to check if the browser was set in the cli. That query was passed as a prop toOpenBrowserList
and used on mount and emits the already definedlaunch
function if the browser was set.Steps to test
In development
yarn cypress:open --browser <browser-name-or-path>
. Select your testing type in the GUI. After testing type selection, the browser specified will automatically launch. Clickingswitch testing type
will navigate back to select another testing type. When a new type is selected the user will have to select the browser from the UI. If an invalid browser name or path is passed, the cached browser will not launch and the error will show as intended. The user will either have to select from the list of available browsers or relaunch from the cli.How has the user experience changed?
Previously, when a user only passed the
--browser
flag, they would still be prompted to select the browser and click theStart testing in <browser-name>
button to open the browser. The only other option was to pass a testing type flag and browser flag together to automatically launch.PR Tasks
cypress-documentation
?type definitions
?