Skip to content

Conversation

@rachelruderman
Copy link
Contributor

@rachelruderman rachelruderman commented Apr 20, 2022

User facing changelog

  • In E2E and component testing configuration, shows the scaffolded files on the launchpad in a custom order
  • Displays the scaffolded file names in bold to match Figma
  • Updates scaffolded file descriptions to match content in Figma
  • Small fixes to punctuation

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
ui-order (2)

After
Screen Shot 2022-04-21 at 3 10 10 PM

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?
  • [na] Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 20, 2022

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.'
Copy link
Contributor Author

@rachelruderman rachelruderman Apr 20, 2022

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

Comment on lines 15 to 16
"status": "valid",
"description": "An example fixture for data imported into your Cypress tests, such as `cy.intercept()`.",
Copy link
Contributor Author

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!

Copy link
Contributor

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.

@rachelruderman rachelruderman marked this pull request as ready for review April 20, 2022 22:34
@cypress
Copy link

cypress bot commented Apr 20, 2022



Test summary

17881 0 217 0Flakiness 2


Run details

Project cypress
Status Passed
Commit 4f697b9
Started Apr 22, 2022 5:00 PM
Ended Apr 22, 2022 5:14 PM
Duration 13:58 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

net_stubbing.cy.ts Flakiness
1 network stubbing > intercepting response > can throttle a proxy response using res.setThrottle
files.cy.js Flakiness
1 ... > has implicit existence assertion, retries and throws a specific error when file does not exist for null encoding

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

assert(chosenFramework && chosenLanguage && chosenBundler)

return await Promise.all([
const scaffoldedFiles = await Promise.all([
Copy link
Contributor

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.

Copy link
Contributor Author

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!!

Copy link
Contributor

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([ /* ... */ ])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmiller1990 true that, updating!

Copy link
Contributor Author

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.`,
Copy link
Contributor

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 @@
{
Copy link
Contributor

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.

@rachelruderman rachelruderman requested a review from ZachJW34 April 22, 2022 16:56
Copy link
Contributor

@lmiller1990 lmiller1990 left a 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([
Copy link
Contributor

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([ /* ... */ ])

@rachelruderman rachelruderman merged commit 8f7a50f into 10.0-release Apr 25, 2022
@rachelruderman rachelruderman deleted the UNIFY-1552-assert-files-are-shown-in-custom-order branch April 25, 2022 15:39
tgriesser added a commit that referenced this pull request Apr 25, 2022
…-config

* 10.0-release:
  fix: Long Cypress verification times  (#21174)
  feat: UI updates to scaffolded files (#21155)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants