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

feat: Re-introduce Run All specs for End to End under experimentalRunAllSpecs flag #24745

Merged
merged 18 commits into from Nov 22, 2022

Conversation

lmiller1990
Copy link
Contributor

@lmiller1990 lmiller1990 commented Nov 21, 2022

User facing changelog

Adds a new experimental flag, experimentalRunAllSpecs, for End to End Testing. Enable it in cypress.config:

import { defineConfig } from 'cypress'

export default defineConfig({
  e2e: {
    experimentalRunAllSpecs: true
  }
})

Additional details

This PR adds back in support for running multiple tests sequentially in Open Mde for End to End testing. It can be accessed from both the Specs page and the Runner page in the Cypress App:

image

ss

Steps to test

  1. Either check out this branch locally, or install the pre-release binary. Those are here.
  2. Enable the experiment:
import { defineConfig } from 'cypress'

export default defineConfig({
  e2e: {
    experimentalRunAllSpecs: true
  }
})

Open Cypress in Open Mode. The Specs page and Runner page should be have "Run N Specs" labels that are revealed when you hover a directory. Clicking the button will re-open the browser and execute all the specs sequentially.

You can also use the text search to only execute a sub-set of specs. Saving any of the specs will re-execute all the specs that matched your criteria (search, directory, or both).

Note: It's not fully a11y yet. You cannot do Run All Specs with a keyboard only yet. I filed an issue for a fast follow: #24748. If there's a trivial fix, that'd be great.

How has the user experience changed?

See above.

PR Tasks

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 21, 2022

Thanks for taking the time to open a PR!

@lmiller1990
Copy link
Contributor Author

lmiller1990 commented Nov 21, 2022

Doing some testing, collecting my feedback here.

Edit: I've fixed these in #24746. Please review.

Feedback ## Button position on inline spec list is inconsistent

The icons appear in different positions. Should it align right?

simplescreenrecorder-2022-11-21_10.29.50.mp4

Another example:

css.mp4

I think it should always be a fixed width from the right. That's what the designs hint at.

Experimental flag types

Current I can set experimentalRunAllSpecs at the top level. This throws an error, telling me it's E2E only. How about we make the types reflect this, too?

export default = {
  experimentalRunAllSpecs: truer
}

IDE says it's valid, but Cypress throws an error.

@lmiller1990 lmiller1990 mentioned this pull request Nov 21, 2022
1 task
amehta265 and others added 3 commits November 21, 2022 11:42
* wip run-all-specs-ui

* added component tests for specs-list, inline-specs-list, and run-all-specs

* updated tests for specslist, inlinespeclist, and runAllSpecs

* simplify test

* make prop with default value optional

* enable run all specs

* use named slot for clarify

* use Record type

* remove un-necessary dynamic component

* use group and hover to inline css

* fix tests

* fix tests and use snapshot for style testing

Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
@cypress
Copy link

cypress bot commented Nov 21, 2022



Test summary

511 16 44 95Flakiness 10


Run details

Project cypress
Status Failed
Commit e182240
Started Nov 22, 2022 6:24 AM
Ended Nov 22, 2022 6:42 AM
Duration 17:08 💡
OS Windows 10.0.17763
Browser Chrome 107

View run in Cypress Dashboard ➡️


Failures

Run group: app-e2e (Windows, Chrome )
cypress\e2e\runner\sessions.ui.cy.ts Failed
1 ... > setup has failing Cypress command
cypress\e2e\runner\reporter.hooks.cy.ts Failed
1 hooks > displays commands under correct hook
cypress\e2e\run-all-specs.cy.ts Failed
1 run-all-specs > can run all specs with filter and live-reloading
cypress\e2e\runner\reporter-ct-vite.errors.cy.ts Failed
1 Vite - errors ui > assertion failures
cypress\e2e\settings.cy.ts Failed
1 App: Settings > visits settings page
cypress\e2e\subscriptions\specChange-subscription.cy.ts Failed
1 specChange subscription > specs list > responds to specChange event for an added file
cypress\e2e\runner\reporter.errors.cy.ts Failed
1 errors ui > exception failures
cypress\e2e\runner\reporter-ct-webpack.uncaught-errors.cy.ts Failed
1 uncaught errors
This comment includes only the first 10 test failures. See all 13 failures in the Cypress Dashboard.
Run group: launchpad-e2e (Windows, Chrome )
cypress\e2e\top-nav-launchpad.cy.ts Failed
1 ... > when there is a project id > if the project has no runs, shows "record your first run" prompt after choosing testing type
2 ... > global mode > shows "continue" button after login if project selected

Flakiness

cypress\e2e\migration.cy.ts Flakiness
1 Full migration flow for each project > completes journey for migration-component-testing
cypress\e2e\top-nav-launchpad.cy.ts Flakiness
1 ... > logs out user if cloud request returns unauthorized
2 ... > global mode > shows "continue" button after login if project selected has project id
3 ... > global mode > shows "connect project" button after login if project selected has no project id
cypress\e2e\scaffold-component-testing.cy.ts Flakiness
1 scaffolding component testing > vue3-vite-ts-unconfigured > scaffolds component testing for Vue 3 and Vite
This comment includes only the first 5 flaky tests. See all 10 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

@lmiller1990 lmiller1990 marked this pull request as ready for review November 21, 2022 07:22
@lmiller1990 lmiller1990 requested a review from a team November 21, 2022 07:27
hocus-fill-color="indigo-100"
class="inline-flex align-text-bottom"
data-cy="play-button"
@click.stop="emits('runAllSpecs')"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this click handler should be on the button, not the icon. When I use the keyboard on the button it doesn't rerun specs for me, it just toggles the folder open and closed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, moving the handler didn't help, I think because the parent is using @click.capture to manage the toggle. That code would need some extra logic to not toggle if the click event came from the button.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved the listener anyway, it should be on the button. There is a follow up for better a11y.

class="font-normal text-sm inline-flex"
data-cy="tooltip-content"
>
Run {{ specNumber }} specs
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to handle pluralization here, we could use the i18n for this.

Screen Shot 2022-11-21 at 4 16 03 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh it's already in the main Spec Explorer, we can do that here.

Suggested change
Run {{ specNumber }} specs
{{ t('specPage.runAllSpecs', specNumber) }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

cy.findByTestId('play-button').should('be.visible')
})

it('Renders styles correctly', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the future let's use a Percy snapshot for this kind of thing and not assert all these CSS values. It's not important whether or not these exact values are used for these elements, what matters is that visual appearance is as expected.

@lmiller1990
Copy link
Contributor Author

Some known windows linting fails, fixed by #24758

All other pipelines ✔️, merging.

@lmiller1990 lmiller1990 merged commit 4bbd78e into develop Nov 22, 2022
@lmiller1990 lmiller1990 deleted the feature/run-all-specs branch November 22, 2022 07:28
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 22, 2022

Released in 11.2.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v11.2.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run All Specs for E2E
5 participants