-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: UI updates to scaffolded files #21155
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: UI updates to scaffolded files #21155
Conversation
|
Thanks for taking the time to open a PR!
|
|
|
||
| if (fileName === 'commands') { | ||
| fileContent = commandsFileBody(language) | ||
| description = 'A support file that is useful for creating custom Cypress commands and overwriting existing ones.' |
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.
Ideally these strings would be set by the frontend instead of the backend so we can store them in en-US.json, but doing so would require some backend changes that would have significantly bloated the scope for this ticket.
Would be great to do at another time
| "status": "valid", | ||
| "description": "An example fixture for data imported into your Cypress tests, such as `cy.intercept()`.", |
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.
The fixture was required since this is a component test; in a system test, it wouldn't be needed.
If there's a preference here to do a system test instead, lmk and I'll be happy to update!
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.
If there's a preference here to do a system test instead, lmk and I'll be happy to update!
Normally we don't add a system test if we can avoid it, since they take so long to run. I'd say E2E tests in cypress/e2e are fine for this kind of fix.
Test summaryRun details
View run in Cypress Dashboard ➡️ FlakinessThis 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 |
| assert(chosenFramework && chosenLanguage && chosenBundler) | ||
|
|
||
| return await Promise.all([ | ||
| const scaffoldedFiles = await Promise.all([ |
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.
Rather than maintain a list of the expected order of these files, can we just order them here and write a comment? We loop through this array to render out the files changed so if it was written like:
return await Promise.all([
this.scaffoldConfig('component'),
this.scaffoldSupport('component', chosenLanguage),
this.scaffoldSupport('commands', chosenLanguage),
this.scaffoldComponentIndexHtml(chosenFramework),
this.scaffoldFixtures(),
])
the order would be correct and it would remove the need to sort them.
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.
💡 work smarter, not harder lolllll this is so much simpler, thank you for pointing that out! Makin' those changes now!!
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.
Not sure we need async/await here, either.
private scaffoldComponent () {
return Promise.all([ /* ... */ ])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 true that, updating!
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.
Actually I'mma keep it because all things being equal, it was helpful to have an intermediate variable for scaffoldedFiles that could be easily console-logged after the await
| this.ctx.lifecycleManager.configFilePath, | ||
| configCode, | ||
| 'Created a new config file', | ||
| `The Cypress config file where the ${adjective} dev server is 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.
Not sure this wording makes sense for e2e. You can configure a server for e2e inside of setupNodeEvents but it's not required. It should just say "The Cypress configuration file for {adjective} testing".
| @@ -0,0 +1,127 @@ | |||
| { | |||
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.
We have a test in project-setup.cy.ts, we do a verifyFiles which we could tweak to verify the ordering as well. We could remove this fixture and have better coverage.
lmiller1990
left a comment
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.
Just one minor comment. Looks great.
| assert(chosenFramework && chosenLanguage && chosenBundler) | ||
|
|
||
| return await Promise.all([ | ||
| const scaffoldedFiles = await Promise.all([ |
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.
Not sure we need async/await here, either.
private scaffoldComponent () {
return Promise.all([ /* ... */ ])
User facing changelog
Additional details
These changes implement the design set out in Figma, resulting in an improved user experience during configuration.
How has the user experience changed?
Before

After

PR Tasks
cypress-documentation?type definitions?cypress.schema.json?