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

test(launchpad): add e2e tests for Project Setup - Round 2 #19580

Merged
merged 26 commits into from
Jan 18, 2022

Conversation

emilyrohrbough
Copy link
Member

@emilyrohrbough emilyrohrbough commented Jan 5, 2022

Test Cases:

  • Project Setup (never setup e2e or CT before)

    • The compare testing types modal displays header, list, and code examples of testing types
    • Clicking a link for 'Need help' within the 'learn the difference' modal will open the docs link within the user's default browser
    • Testing type cards contain an icon that has a hover animation.
    • When no initial setup, the testing type cards read "Not Configured"
    • Clicking x on the 'learn the difference' modal will close the modal
    • Hitting enter key when focused on x on the 'learn the difference' modal will close the modal
    • Hitting escape on the 'learn the difference' modal will close the modal
    • Clicking off of the 'learn the difference' modal will close the modal
  • E2E Project Setup (Existing Project, Migrated, w/o E2E Configured)

    • Running cypress open --e2e with no initial setup detected will launch into the project in e2e showing the first step in configuration
    • Clicking on the e2e testing card of the project setup page will route the user to the Configuration Files page
  • e2e Configured Files (never having setup E2E before)

    • Clicking 'Continue' takes you to the 'Choose a Browser' page
  • component Project Setup (never having setup CT before)

    • Running cypress open --component with no initial setup detected will launch into the project in component showing 'choose framework' page
    • Clicking on the component area of project setup will route the user to the page showing 'choose framework' page

User facing changelog

n/a

PR Tasks

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

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 5, 2022

Thanks for taking the time to open a PR!

@emilyrohrbough emilyrohrbough changed the base branch from develop to 10.0-release January 5, 2022 22:30
@cypress
Copy link

cypress bot commented Jan 5, 2022



Test summary

18558 0 219 0Flakiness 0


Run details

Project cypress
Status Passed
Commit e36d31b
Started Jan 18, 2022 5:49 PM
Ended Jan 18, 2022 6:02 PM
Duration 12:16 💡
OS Linux Debian - 10.10
Browser Multiple

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

@@ -320,27 +321,33 @@ export class ProjectLifecycleManager {
return
}

if (!this.metaState.hasValidConfigFile) {
if (testingType === 'e2e' && !this.ctx.isRunMode) {
this.ctx.actions.wizard.scaffoldTestingType().catch(this.onLoadError)
Copy link
Member Author

Choose a reason for hiding this comment

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

I assume that we need to add in a graceful error message for users that hit this when in run mode.

@@ -85,7 +85,6 @@ export class ProjectActions {

async setCurrentProject (projectRoot: string) {
await this.clearCurrentProject()
Copy link
Member Author

Choose a reason for hiding this comment

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

this.clearCurrentProject() already calls this.ctx.lifecycleManager.clearCurrentProject(): https://github.com/cypress-io/cypress/pull/19580/files#diff-d36f6626bf805d1bbbfba4786ca3a518f0083613a9814fd037c5592808949606L56

@emilyrohrbough emilyrohrbough marked this pull request as ready for review January 13, 2022 18:21
it('welcome page has "learn about testing types" link which opens modal', () => {
cy.contains('Review the differences').click()
cy.get('#app').should('have.attr', 'aria-hidden', 'true')
cy.contains('Key Differences').should('be.visible')
Copy link
Contributor

@tbiethman tbiethman Jan 13, 2022

Choose a reason for hiding this comment

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

You can get a tighter assertion by doing something like:

cy.findByRole('dialog', { name: 'Key Differences' }.within(() => {
  // assert scoped dialog content here
})

It'd be nice to dry up things like the app being hidden when a dialog is open and other common dialog behaviors (like the ever-present "Need help?" link). Custom command maybe? Not necessary to change here but worth some thinking.

cy.getDialog({ name: '...', rootSelector: '#app' }) // asserts aria state common dialog features -> returns dialog element 

cy.getDialog({ 
  name: '...',
  rootSelector: '#app',
  reopen: () => {
    cy.click('#launch') // Might even be able to optionally run through the dismissal flows if we provide a way to re-present it
  }
})

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I was finding cy.contains would match a model on the dom even if it wasn't open. I'll make the updates.

@@ -2,3 +2,4 @@
require('../../../../frontend-shared/cypress/e2e/support/e2eSupport')

require('./dropFileWithPath')
require('cypress-plugin-tab')
Copy link
Contributor

Choose a reason for hiding this comment

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

👀 did some reading about this, interesting. We've also recommended https://github.com/dmtrKovalenko/cypress-real-events previously, but there's no firefox support there

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah...We have is issue logged #299 in the backlog for tab support so hopefully we can implement & provide first-class support soon.

@emilyrohrbough emilyrohrbough merged commit 9e4c04d into 10.0-release Jan 18, 2022
@emilyrohrbough emilyrohrbough deleted the e2e-launchpad-project-setup branch January 18, 2022 21:27
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.

3 participants