Repository navigation
misc: Ensure cypress tab is active before any command runs - #28334
Merged
Merged
Conversation
29 flaky tests on run #52339 ↗︎Details:
|
|||||||||||||||||||||||||||||||||||||||||||||
| Test | Artifacts | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| cy.origin assertions > #consoleProps > .should() and .and() |
| |||||||||||||||||||||||||
| Test | Artifacts | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ... > correctly returns currentRetry |
| |||||||||||||||||||
| Test | Artifacts | |
|---|---|---|
| ... > can reconfigure config after CT has been set up |
Test Replay
Screenshots
|
|
cypress/e2e/global-mode.cy.ts • 1 flaky test • launchpad-e2e
| Test | Artifacts | |
|---|---|---|
| ... > can be opened |
Test Replay
Screenshots
|
|
src/debug/empty/DebugEmptyStates.cy.tsx • 1 flaky test • app-ct
| Test | Artifacts | |
|---|---|---|
| ... > renders slideshow |
Test Replay
Screenshots
|
|
The first 5 flaky specs are shown, see all 17 specs in Cypress Cloud.
Review all test suite changes for PR #28334 ↗︎
chrisbreiding
commented
Nov 15, 2023
|
|
||
| const matchWithExclusion = (objValue, srcValue) => { | ||
| if (srcValue.startsWith('!')) { | ||
| if (_.isString(srcValue) && srcValue.startsWith('!')) { |
Contributor
Author
There was a problem hiding this comment.
This is a bit of a drive-by fix that I needed for the browser check. I didn't see any open issues about this, but it does seem like it wasn't working as documented, where Cypress.isBrowser({ isHeadless: true }) would fail with "startsWith is not a function".
cacieprins
approved these changes
Nov 15, 2023
mschile
reviewed
Nov 16, 2023
mschile
reviewed
Nov 16, 2023
mschile
reviewed
Nov 16, 2023
1 task done
mschile
reviewed
Nov 16, 2023
mschile
reviewed
Nov 16, 2023
mschile
approved these changes
Nov 16, 2023
3 tasks
Contributor
|
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional details
Ensures the main Cypress tab is active (i.e. the tab on top and shown by the browser) before any command is run and at the end of a test. This is in anticipation of support for testing multiple tabs/windows with the future @cypress/puppeteer plugin. It's only implemented in Chromium for now, as that's what the puppeteer plugin will support. It's not necessary for Electron because it doesn't have tabs.
It uses the extension to accomplish activating the tab, since it's the only way to do it without the browser stealing focus from other apps (like CDP
Page.bringToFrontwould do).Steps to test
Run any test in open mode and open a new tab while the test is running. You'll see the active tab switch back to the Cypress tab before the next command starts running. It will also switch back at the end of a test, including if a command fails.
PR Tasks
cypress-documentation?type definitions?