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: create new spec file from desktop-gui #15335
Conversation
Thanks for taking the time to open a PR!
|
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 |
Internal Jira issue: TR-704 |
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.
You may want to get @flotwig to test in Windows/Linux. I think he's setup to test both.
I guess it's also technically possible they could create a file that would be filtered out of the testFiles
regex, so that's another reason a new file may not show up in the list. I dunno if it's worth mentioning in the warning.
Oh there's a little format dropdown, that is cool.
The user experience looks good to me on the Mac. 👍
I'll approve and leave it up to you if you also want flotwig to manually test.
@jennifer-shehane Yeah I noticed that issue with @flotwig It'd be great if you could do a simple test on Windows & Linux just to make sure that the user flow is pretty similar. Any images or gifs that you could provide would be super appreciated. Thanks so much! |
Merged in |
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 wonder if the Here is the console.logged yielded value of dialog.openSaveDialog on Windows:
|
@@ -77,6 +83,10 @@ export class SpecsStore { | |||
}) | |||
})) | |||
|
|||
if (this.newSpecAbsolutePath && !_.find(this._files, { absolute: this.newSpecAbsolutePath })) { |
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.
yeah, i bet the paths in this._files are either double-escaped Windows paths, or POSIX paths, that's why this is not working as expected on Windows
@flotwig Nice catch - should be fixed now. Since I tested this on Mac (w/ stubbed tests) could you do one last manual verification that it works properly on an actual Windows system? |
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.
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
User facing changelog
Adds the ability to create a new spec file directly from the desktop gui
Additional details
Dialog needs to be tested on Windows and Linux. I had some issues when trying to run myself - while I'm confident it probably works well, its not a bad idea to test on the native system before merging.
We use the system dialog to prompt for file location rather than a custom file picker since there are a number of benefits (eg. create folder, duplicate detection) that come with using the system dialog rather than a custom implementation (and there's no need to reinvent the wheel). The only downside (for less experienced users) is that the user is able to create a file outside of their Cypress project, which means it may not show up in their spec list. The system dialog provides no way to limit the user to selecting certain directories, so the best we can do is show is put them in their integration folder by default and show a message if they choose to add a file outside of their spec list (which some advanced users might actually want to do).
After creating a file in the integrations folder, the new file will scroll into view and get highlighted for a second.
Do docs need to be written for this? I feel like it's fairly self explanatory but we do document basically everything (and could give us a place to explain in a bit more detail why only recognized spec files in the integrations folder will show up).
This should pair nicely with the changes introduced in #15144, especially once Studio hits GA. With Studio, a user is able to download Cypress for the first time and write a test without ever needing to open their filesystem or IDE.
How has the user experience changed?
Creating a new file
Message when file is created in a different directory
Content of created file
PR Tasks
cypress-documentation
?