Skip to content
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

fix: switching from ct to e2e (non-configured) does not go through setup #21607

Merged
merged 6 commits into from
May 25, 2022

Conversation

ZachJW34
Copy link
Contributor

@ZachJW34 ZachJW34 commented May 23, 2022

User facing changelog

Navigate to e2e project setup when switching from CT (configured) to e2e (not-configured) from App

Additional details

We were missing a call to scaffoldTestingType() when switching testing types from the App. This function is what initializes e2e setup and causes the Launchpad to render the e2e setup flow. I pulled the logic out into it's own function so I could call this from within the added Launchpad project-setup.cy.ts tests to verify we are redirecting as expected.

How has the user experience changed?

Before:

Screen.Recording.2022-05-23.at.3.48.49.PM.mov

After:

Screen.Recording.2022-05-23.at.3.47.20.PM.mov

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)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

@ZachJW34 ZachJW34 requested review from tbiethman and estrada9166 May 23, 2022 21:00
@ZachJW34 ZachJW34 requested a review from tgriesser as a code owner May 23, 2022 21:00
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 23, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented May 23, 2022



Test summary

37529 0 454 0Flakiness 6


Run details

Project cypress
Status Passed
Commit 745aafa
Started May 25, 2022 7:44 PM
Ended May 25, 2022 8:04 PM
Duration 19:26 💡
OS Linux Debian - 10.11
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

commands/actions/click.cy.js Flakiness
1 ... > scroll-behavior > can scroll to and click elements in html with scroll-behavior: smooth
next.cy.ts Flakiness
1 Working with next-12 > should detect new spec
2 Working with next-12.1.6 > should detect new spec
commands/navigation.cy.js Flakiness
1 src/cy/commands/navigation > #visit > window immediately resolves and doesn't reload when visiting the same URL with hashes
cypress/proxy-logging.cy.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code when xhr response is logged second
This comment includes only the first 5 flaky tests. See all 6 flaky tests in the 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


return true
},
})

t.field('setTestingTypeAndReconfigureProject', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this dead code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll add more comments in the future when making changes like this

sinon.stub(ctx.actions.electron, 'refreshBrowserWindow')
sinon.stub(ctx.actions.electron, 'showBrowserWindow')
await ctx.actions.project.switchTestingTypesAndRelaunch('component')
ctx.emitter.toLaunchpad()
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious if we need the additional emit here (if we don't need one in the above test)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was required though I couldn't track down exactly why. To be more in line with the actual behavior, I'm going to use cy.reload as that is what the ctx.actions.electron.refreshBrowserWindow() would trigger outside of a test.

Copy link
Contributor

@tbiethman tbiethman left a comment

Choose a reason for hiding this comment

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

Code looks good and I can't reproduce the original issue, config scaffolding is occurring now like we'd expect 👍

Looks like theres a few failures in the launchpad tests that may be related to these changes though?

@ZachJW34
Copy link
Contributor Author

@tbiethman latest commit has no failing launchpad tests

@ZachJW34 ZachJW34 changed the base branch from 10.0-release to develop May 25, 2022 15:18
@ZachJW34 ZachJW34 requested a review from marktnoonan May 25, 2022 19:36
Copy link
Contributor

@marktnoonan marktnoonan left a comment

Choose a reason for hiding this comment

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

Super!

@ZachJW34 ZachJW34 merged commit 08b72dc into develop May 25, 2022
@ZachJW34 ZachJW34 deleted the zachw/ct-e2e-switch branch May 25, 2022 23:45
tgriesser added a commit that referenced this pull request May 27, 2022
…pack

* develop:
  fix: UNIFY-1408, warnings should be nested appropriately & clearable (#21630)
  chore: fix unit-tests-release job (#21652)
  chore(deps): update dependency eventsource to v2 [security] (#21639)
  fix: Add hover states for test titles in reporter (#21635)
  docs(CONTRIBUTING): Fix link to "good first issue" for newcomers (#21614)
  chore: compare `cy.screenshot` images in percy (#21598)
  fix: switching from ct to e2e (non-configured) does not go through setup (#21607)
  fix: issue with compilation failures in component testing (#21599)
  test: fix flaky launchpad test (#21637)
  docs: remove gitter link in contributing guide. (#21592)
  fix: order projects by most recently opened (#21589)
  fix: prevent crash on runs visit when offline (#21618)
  fix: pass family parameter to connect method (#21545)
  chore: clean up `debug` statements in preparation for 10.0 release, add `debug` docs (#21621)
  chore: add regression test for ts detection (#21578)
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.

4 participants