diff --git a/packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts b/packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts index 1971468fd7e9..ed0cb53db0f7 100644 --- a/packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts +++ b/packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts @@ -1,7 +1,7 @@ import type { SinonStub } from 'sinon' import defaultMessages from '@packages/frontend-shared/src/locales/en-US.json' import { getPathForPlatform } from '../../src/paths' -import { snapshotAUTPanel } from './support/snapshot-aut-panel' +// import { snapshotAUTPanel } from './support/snapshot-aut-panel' describe('Cypress In Cypress CT', { viewportWidth: 1500, defaultCommandTimeout: 10000 }, () => { context('default config', () => { @@ -24,19 +24,22 @@ describe('Cypress In Cypress CT', { viewportWidth: 1500, defaultCommandTimeout: cy.contains('Canary').should('be.visible') cy.findByTestId('viewport').click() - snapshotAUTPanel('browsers open') + // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435 + // snapshotAUTPanel('browsers open') cy.contains('Canary').should('be.hidden') cy.contains('The viewport determines the width and height of your application under test. By default the viewport will be 500px by 500px for component testing.') .should('be.visible') - snapshotAUTPanel('viewport info open') + // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435 + // snapshotAUTPanel('viewport info open') cy.get('body').click() cy.findByTestId('playground-activator').click() cy.findByTestId('playground-selector').clear().type('[data-cy-root]') - snapshotAUTPanel('cy.get selector') + // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435 + // snapshotAUTPanel('cy.get selector') cy.findByTestId('playground-num-elements').contains('1 match') @@ -50,7 +53,8 @@ describe('Cypress In Cypress CT', { viewportWidth: 1500, defaultCommandTimeout: cy.findByTestId('playground-selector').clear().type('Component Test') - snapshotAUTPanel('cy.contains selector') + // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435 + // snapshotAUTPanel('cy.contains selector') cy.findByTestId('playground-num-elements').contains('1 match') diff --git a/packages/app/cypress/e2e/cypress-in-cypress-e2e.cy.ts b/packages/app/cypress/e2e/cypress-in-cypress-e2e.cy.ts index 937fe12ecb2f..677feff1e164 100644 --- a/packages/app/cypress/e2e/cypress-in-cypress-e2e.cy.ts +++ b/packages/app/cypress/e2e/cypress-in-cypress-e2e.cy.ts @@ -1,5 +1,5 @@ import defaultMessages from '@packages/frontend-shared/src/locales/en-US.json' -import { snapshotAUTPanel } from './support/snapshot-aut-panel' +// import { snapshotAUTPanel } from './support/snapshot-aut-panel' import { getPathForPlatform } from '../../src/paths' describe('Cypress In Cypress E2E', { viewportWidth: 1500, defaultCommandTimeout: 10000 }, () => { @@ -28,7 +28,8 @@ describe('Cypress In Cypress E2E', { viewportWidth: 1500, defaultCommandTimeout: .focus() .type('{esc}') - snapshotAUTPanel('browsers open') + // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435 + // snapshotAUTPanel('browsers open') cy.contains('Canary').should('be.hidden') @@ -36,14 +37,16 @@ describe('Cypress In Cypress E2E', { viewportWidth: 1500, defaultCommandTimeout: cy.contains('The viewport determines the width and height of your application under test. By default the viewport will be 1000px by 660px for end-to-end testing.') .should('be.visible') - snapshotAUTPanel('viewport info open') + // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435 + // snapshotAUTPanel('viewport info open') cy.get('body').click() cy.findByTestId('playground-activator').click() cy.findByTestId('playground-selector').clear().type('li') - snapshotAUTPanel('cy.get selector') + // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435 + // snapshotAUTPanel('cy.get selector') cy.findByTestId('playground-num-elements').contains('3 matches') @@ -64,7 +67,8 @@ describe('Cypress In Cypress E2E', { viewportWidth: 1500, defaultCommandTimeout: cy.findByTestId('playground-selector').clear().type('Item 1') - snapshotAUTPanel('cy.contains selector') + // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435 + // snapshotAUTPanel('cy.contains selector') cy.findByTestId('playground-num-elements').contains('1 match') diff --git a/packages/app/cypress/e2e/runner/cloud-debug-filter.cy.ts b/packages/app/cypress/e2e/runner/cloud-debug-filter.cy.ts index 38da4f465330..88906b157cd9 100644 --- a/packages/app/cypress/e2e/runner/cloud-debug-filter.cy.ts +++ b/packages/app/cypress/e2e/runner/cloud-debug-filter.cy.ts @@ -55,12 +55,6 @@ describe('cloud debug test filtering', () => { cy.get('@reporterPanel').then((el) => el.width(500)) cy.get('@reporterPanel').percySnapshot('wide') - cy.get('@reporterPanel').then((el) => el.width(350)) - cy.get('@reporterPanel').percySnapshot('medium') - - cy.get('@reporterPanel').then((el) => el.width(250)) - cy.get('@reporterPanel').percySnapshot('narrow') - cy.get('@reporterPanel').then((el) => el.width(150)) cy.get('@reporterPanel').percySnapshot('skinny') }) diff --git a/packages/app/src/components/Blank.cy.tsx b/packages/app/src/components/Blank.cy.tsx index 8acc0740ca85..8f47bde2f27b 100644 --- a/packages/app/src/components/Blank.cy.tsx +++ b/packages/app/src/components/Blank.cy.tsx @@ -14,19 +14,19 @@ describe('initial', () => { }) describe('testIsolationBlankPage', () => { - it('works', () => { + beforeEach(() => { getContainerEl()!.innerHTML = testIsolationBlankPage() - cy.get('[data-cy="cypress-logo"]') cy.get('[data-cy="text"]').should('have.text', 'Default blank page') cy.get('[data-cy="subtext"]').should('have.text', 'This page was cleared by navigating to about:blank.All active session data (cookies, localStorage and sessionStorage) across all domains are cleared.') + }) + it('works', () => { cy.percySnapshot() }) it('works with small viewport', () => { cy.viewport(200, 500) - getContainerEl()!.innerHTML = testIsolationBlankPage() cy.percySnapshot() }) @@ -35,13 +35,15 @@ describe('testIsolationBlankPage', () => { describe('visitFailure', () => { it('works', () => { getContainerEl()!.innerHTML = visitFailure({ url: 'http://foo.cypress.io' }) - - cy.percySnapshot() }) it('works with details', () => { getContainerEl()!.innerHTML = visitFailure({ url: 'http://foo.cypress.io', status: 404, statusText: 'Not Found', contentType: 'text/html' }) + cy.get('p').contains('Sorry, we could not load:') + cy.get('a').contains('http://foo.cypress.io').should('have.attr', 'href', 'http://foo.cypress.io') + cy.get('p').contains('404 - Not Found (text/html)') + cy.percySnapshot() }) }) diff --git a/packages/app/src/components/SpecPatterns.cy.tsx b/packages/app/src/components/SpecPatterns.cy.tsx index ef94d7cac8b1..e19b395aeb80 100644 --- a/packages/app/src/components/SpecPatterns.cy.tsx +++ b/packages/app/src/components/SpecPatterns.cy.tsx @@ -9,8 +9,6 @@ describe('', () => { cy.get('[data-cy="spec-pattern"]').contains('cypress/e2e/**/*.cy.{js,jsx,ts,tsx}') cy.get('[data-cy="file-match-indicator"]').contains('50 matches') - - cy.percySnapshot() }) it('renders component spec pattern', () => { diff --git a/packages/app/src/debug/DebugContainer.cy.tsx b/packages/app/src/debug/DebugContainer.cy.tsx index d19613cde2f8..d466b01d8f38 100644 --- a/packages/app/src/debug/DebugContainer.cy.tsx +++ b/packages/app/src/debug/DebugContainer.cy.tsx @@ -169,10 +169,10 @@ describe('', () => { it('renders', () => { mountTestRun('allSkipped') + cy.findByTestId('collapsible').should('be.visible') + cy.contains('h3', 'Incomplete') cy.contains('The browser server never connected.').should('be.visible') cy.contains('2 of 3 specs skipped').should('be.visible') - - cy.percySnapshot() }) }) @@ -180,9 +180,9 @@ describe('', () => { it('renders', () => { mountTestRun('noTests') + cy.findByTestId('collapsible').should('be.visible') + cy.contains('h3', 'Incomplete') cy.contains('Run has no tests').should('be.visible') - - cy.percySnapshot() }) }) @@ -190,46 +190,37 @@ describe('', () => { it('renders with CI information', () => { mountTestRun('timedOutWithCi') + cy.findByTestId('collapsible').should('be.visible') + cy.contains('h3', 'Incomplete') cy.contains('Circle CI #1234').should('have.attr', 'href', 'https://circleci.com').should('be.visible') cy.contains('Archive this run to remove it').should('be.visible') - - cy.percySnapshot() }) it('renders without CI information', () => { mountTestRun('timedOutWithoutCi') + cy.findByTestId('collapsible').should('be.visible') + cy.contains('h3', 'Incomplete') cy.contains('Circle CI #1234').should('not.exist') cy.contains('Archive this run to remove it').should('be.visible') - - cy.percySnapshot() }) }) context('over limit', () => { it('handled usage exceeded', () => { mountTestRun('overLimit') - cy.findByRole('link', { name: 'Contact admin' }).should('be.visible').should('have.attr', 'href', 'http://localhost:3000?utmMedium=Debug+Tab&utmSource=Binary%3A+Launchpad') - - cy.percySnapshot() }) it('handles retention exceeded', () => { mountTestRun('overLimitRetention') - cy.findByRole('link', { name: 'Contact admin' }).should('be.visible').should('have.attr', 'href', 'http://localhost:3000?utmMedium=Debug+Tab&utmSource=Binary%3A+Launchpad') - - cy.percySnapshot() }) it('does not show passing message if run is hidden', () => { mountTestRun('overLimitPassed') - cy.contains('Well Done!').should('not.exist') - cy.contains('All your tests passed.').should('not.exist') - cy.findByRole('link', { name: 'Contact admin' }).should('be.visible').should('have.attr', 'href', 'http://localhost:3000?utmMedium=Debug+Tab&utmSource=Binary%3A+Launchpad') }) }) diff --git a/packages/app/src/debug/DebugFailedTest.cy.tsx b/packages/app/src/debug/DebugFailedTest.cy.tsx index db8f3a7f42c2..9433597d1e03 100644 --- a/packages/app/src/debug/DebugFailedTest.cy.tsx +++ b/packages/app/src/debug/DebugFailedTest.cy.tsx @@ -123,8 +123,6 @@ describe('', () => { .and('match', /utm_campaign/) .and('match', /utm_source/) }) - - cy.percySnapshot() }) it('contains multiple titleParts segments', { viewportWidth: 1200 }, () => { @@ -139,8 +137,6 @@ describe('', () => { )) assertRowContents(multipleTitleParts) - - cy.percySnapshot() }) it('tests multiple groups', { viewportWidth: 1200 }, () => { diff --git a/packages/app/src/debug/DebugPageHeader.cy.tsx b/packages/app/src/debug/DebugPageHeader.cy.tsx index 66442cc4fb5d..20a5b574ebb2 100644 --- a/packages/app/src/debug/DebugPageHeader.cy.tsx +++ b/packages/app/src/debug/DebugPageHeader.cy.tsx @@ -98,7 +98,6 @@ describe('', { }) cy.findByTestId(`debug-runNumber-${status}`).should('be.visible') - cy.percySnapshot() }) }) diff --git a/packages/app/src/debug/DebugPendingRunCounts.cy.tsx b/packages/app/src/debug/DebugPendingRunCounts.cy.tsx index 590fea7a27d0..d0e59b2e9184 100644 --- a/packages/app/src/debug/DebugPendingRunCounts.cy.tsx +++ b/packages/app/src/debug/DebugPendingRunCounts.cy.tsx @@ -9,8 +9,6 @@ describe('', () => { ) cy.contains('2 of 20').should('be.visible') - - cy.percySnapshot() }) it('renders counts of zeros input is undefined', () => { @@ -21,7 +19,5 @@ describe('', () => { ) cy.contains('0 of 0').should('be.visible') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/debug/DebugPendingRunSplash.cy.tsx b/packages/app/src/debug/DebugPendingRunSplash.cy.tsx index af4c06096d60..845fe7b5ade6 100644 --- a/packages/app/src/debug/DebugPendingRunSplash.cy.tsx +++ b/packages/app/src/debug/DebugPendingRunSplash.cy.tsx @@ -4,9 +4,8 @@ describe('', () => { it('renders as expected', () => { cy.mount() - cy.contains('Failures will be displayed here') - - cy.percySnapshot() + cy.findByTestId('title').contains('Testing in progress...') + cy.findByTestId('splash-subtitle').contains('Failures will be displayed here') }) it('renders scheduled to complete message', () => { @@ -14,7 +13,5 @@ describe('', () => { cy.contains('Scheduled to complete...') cy.findByTestId('splash-subtitle').should('not.exist') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/debug/DebugResults.cy.tsx b/packages/app/src/debug/DebugResults.cy.tsx index 92e98993a31d..70b0ee565706 100644 --- a/packages/app/src/debug/DebugResults.cy.tsx +++ b/packages/app/src/debug/DebugResults.cy.tsx @@ -17,8 +17,6 @@ describe('', () => { cy.get(`[title=${defaultMessages.runs.results.pending}]`).should('contain.text', cloudRun.totalPending) }) }) - - cy.percySnapshot() }) }) diff --git a/packages/app/src/debug/DebugRunNavigation.cy.tsx b/packages/app/src/debug/DebugRunNavigation.cy.tsx index 6250e1fd2071..86a258719cd4 100644 --- a/packages/app/src/debug/DebugRunNavigation.cy.tsx +++ b/packages/app/src/debug/DebugRunNavigation.cy.tsx @@ -241,8 +241,6 @@ describe('', () => { cy.contains('We found more than 100 runs.').should('be.visible') cy.findByRole('link', { name: 'Go to Cypress Cloud to see all runs' }).should('be.visible').should('have.attr', 'href', 'https://cloud.cypress.io/projects/ypt4pf/?utm_medium=Debug+Tab&utm_campaign=Run+Navigation+Limit&utm_source=Binary%3A+Launchpad') - - cy.percySnapshot() }) describe('Switch to latest run button', () => { diff --git a/packages/app/src/debug/DebugRunNavigationLimitMessage.cy.tsx b/packages/app/src/debug/DebugRunNavigationLimitMessage.cy.tsx index 20a827711e5d..c6d74715cd41 100644 --- a/packages/app/src/debug/DebugRunNavigationLimitMessage.cy.tsx +++ b/packages/app/src/debug/DebugRunNavigationLimitMessage.cy.tsx @@ -5,8 +5,6 @@ describe('DebugRunNavigationLimitMessage', () => { cy.mount() cy.findByRole('link', { name: 'Go to Cypress Cloud to see all runs' }).should('be.visible').should('have.attr', 'href', 'https://cloud.cypress.io/projects/ypt4pf/?utm_medium=Debug+Tab&utm_campaign=Run+Navigation+Limit&utm_source=Binary%3A+Launchpad') - - cy.percySnapshot() }) it('does not render link if cloudProjectUrl is falsy', () => { diff --git a/packages/app/src/debug/DebugRunStates.cy.tsx b/packages/app/src/debug/DebugRunStates.cy.tsx index 81a740df5475..5b76ce3e826a 100644 --- a/packages/app/src/debug/DebugRunStates.cy.tsx +++ b/packages/app/src/debug/DebugRunStates.cy.tsx @@ -27,7 +27,8 @@ describe('Debug page states', () => { it('renders', () => { cy.mount() - cy.percySnapshot() + cy.contains('Well Done!') + cy.contains('All your tests passed') }) }) @@ -35,17 +36,19 @@ describe('Debug page states', () => { it('renders for single spec', () => { cy.mount() + cy.findByTestId('collapsible').should('be.visible') + cy.get('h3').contains('Incomplete') + cy.contains(mockError) cy.contains('1 of 1 spec skipped').should('be.visible') - - cy.percySnapshot() }) it('renders for plural specs', () => { cy.mount() + cy.findByTestId('collapsible').should('be.visible') + cy.get('h3').contains('Incomplete') + cy.contains(mockError) cy.contains('4 of 50 specs skipped').should('be.visible') - - cy.percySnapshot() }) }) @@ -53,7 +56,9 @@ describe('Debug page states', () => { it('renders', () => { cy.mount() - cy.percySnapshot() + cy.findByTestId('collapsible').should('be.visible') + cy.get('h3').contains('Incomplete') + cy.contains('Run has no tests') }) }) @@ -61,14 +66,21 @@ describe('Debug page states', () => { it('renders without CI information', () => { cy.mount() - cy.percySnapshot() + cy.findByTestId('collapsible').should('be.visible') + cy.get('h3').contains('Incomplete') + cy.contains('The run started but never completed. This can happen when the run is cancelled from CI or when Cypress crashes while running tests. Archive this run to remove it from the runs list and analytics.') + cy.contains('4 of 50 specs skipped') }) it('renders with CI information', () => { cy.mount() - cy.percySnapshot() + cy.findByTestId('collapsible').should('be.visible') + cy.get('h3').contains('Incomplete') + cy.contains('The run started but never completed. This can happen when the run is cancelled from CI or when Cypress crashes while running tests. Check your CircleCI #12345 logs for more information. Archive this run to remove it from the runs list and analytics.') + cy.findByTestId('external').contains('CircleCI #12345').should('have.attr', 'href', 'https://circleci.com/') + cy.contains('4 of 50 specs skipped') }) }) @@ -87,7 +99,9 @@ describe('Debug page states', () => { />, ) - cy.percySnapshot() + cy.contains('You\'ve reached your monthly test result limit') + cy.contains('Your Free Cypress Cloud plan includes 100 monthly recorded test results. Contact your Cypress Cloud admin to upgrade your plan and view more test results.') + cy.findByTestId('external').contains('Contact admin') }) it('displays messaging for plan admins', () => { @@ -103,7 +117,9 @@ describe('Debug page states', () => { />, ) - cy.percySnapshot() + cy.contains('You\'ve reached your monthly test result limit') + cy.contains('Your Free Cypress Cloud plan includes 100 monthly recorded test results. Upgrade your plan now to view more test results.') + cy.findByTestId('external').contains('Upgrade plan') }) }) @@ -121,7 +137,9 @@ describe('Debug page states', () => { />, ) - cy.percySnapshot() + cy.contains('Beyond data retention') + cy.contains('Your data retention limit is 30 days and these tests ran 60 days ago. Upgrade your plan to increase your data retention limit.') + cy.findByTestId('external').contains('Contact admin') }) it('displays messaging for plan admins', () => { @@ -137,7 +155,9 @@ describe('Debug page states', () => { />, ) - cy.percySnapshot() + cy.contains('Beyond data retention') + cy.contains('Your data retention limit is 30 days and these tests ran 60 days ago. Upgrade your plan to increase your data retention limit.') + cy.findByTestId('external').contains('Upgrade plan') }) }) @@ -158,7 +178,9 @@ describe('Debug page states', () => { />, ) - cy.percySnapshot() + cy.contains('You\'ve reached your monthly test result limit') + cy.contains('Your Free Cypress Cloud plan includes 30 monthly recorded test results. Upgrade your plan now to view more test results.') + cy.findByTestId('external').contains('Upgrade plan') }) }) }) @@ -166,8 +188,12 @@ describe('Debug page states', () => { context('cancelled', () => { it('renders', () => { cy.mount() - - cy.percySnapshot() + cy.findByTestId('collapsible').should('be.visible') + cy.get('h3').contains('Manually cancelled') + cy.contains('2 of 5 specs skipped') + cy.findByTestId('cancelled-by-user-avatar').should('have.attr', 'style', 'background-image: url("https://s.gravatar.com/avatar/402f6cafb6c02371c2c23c5215ae3d85?size=48&default=mm");') + cy.contains('Test Tester') + cy.contains('Jan 24, 2019 9:00 PM') }) }) }) diff --git a/packages/app/src/debug/DebugSpecLimitBanner.cy.tsx b/packages/app/src/debug/DebugSpecLimitBanner.cy.tsx index 2ff41ad87785..f9081f48b921 100644 --- a/packages/app/src/debug/DebugSpecLimitBanner.cy.tsx +++ b/packages/app/src/debug/DebugSpecLimitBanner.cy.tsx @@ -19,9 +19,6 @@ describe('', () => { .and('match', /utm_campaign/) .and('match', /utm_source/) - cy.viewport(1000, 400) - cy.percySnapshot('large viewport') - cy.viewport(600, 400) cy.percySnapshot('small viewport') }) @@ -34,8 +31,8 @@ describe('', () => { /> )) + cy.get('li').contains('Cypress renders up to 100 failed test results') + cy.get('li').contains('This run has 120 failed tests') cy.get('a').should('not.exist') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/debug/GroupedDebugFailedTest.cy.tsx b/packages/app/src/debug/GroupedDebugFailedTest.cy.tsx index fc9a386eeaf8..8da0c1a61613 100644 --- a/packages/app/src/debug/GroupedDebugFailedTest.cy.tsx +++ b/packages/app/src/debug/GroupedDebugFailedTest.cy.tsx @@ -85,7 +85,5 @@ describe('', () => { cy.findByTestId('debug-artifacts').should('be.visible').children().should('have.length', 3) cy.findByTestId('stats-metadata').children().should('have.length', 3) })) - - cy.percySnapshot() }) }) diff --git a/packages/app/src/debug/LayeredBrowserIcons.cy.tsx b/packages/app/src/debug/LayeredBrowserIcons.cy.tsx index 28d6339821e9..2de78fafab04 100644 --- a/packages/app/src/debug/LayeredBrowserIcons.cy.tsx +++ b/packages/app/src/debug/LayeredBrowserIcons.cy.tsx @@ -34,7 +34,5 @@ describe('', () => { cy.get('@allIcons').each((ele) => { cy.wrap(ele).find('svg').should('exist') }) - - cy.percySnapshot() }) }) diff --git a/packages/app/src/debug/StatsMetadata.cy.tsx b/packages/app/src/debug/StatsMetadata.cy.tsx index 9901197a8763..8a1d2d0d63cd 100644 --- a/packages/app/src/debug/StatsMetadata.cy.tsx +++ b/packages/app/src/debug/StatsMetadata.cy.tsx @@ -235,7 +235,5 @@ describe('', () => { cy.findByTestId(testingOrder[index]).should('be.visible') } }) - - cy.percySnapshot() }) }) diff --git a/packages/app/src/navigation/SidebarNavigation.cy.tsx b/packages/app/src/navigation/SidebarNavigation.cy.tsx index 37ceba78067e..1043cf1d175f 100644 --- a/packages/app/src/navigation/SidebarNavigation.cy.tsx +++ b/packages/app/src/navigation/SidebarNavigation.cy.tsx @@ -64,8 +64,10 @@ describe('SidebarNavigation', () => { }) cy.findByText('test-project').should('be.visible') - cy.findByTestId('sidebar-link-specs-page').should('have.class', 'router-link-active') // assert active link to prevent percy flake - cy.percySnapshot() + cy.findByTestId('sidebar-link-specs-page').should('be.visible').should('have.class', 'router-link-active').contains('Specs') // assert active link to prevent percy flake + cy.findAllByTestId('sidebar-link-runs-page').should('be.visible').should('not.have.class', 'router-link-active').contains('Runs') + cy.findAllByTestId('sidebar-link-debug-page').should('be.visible').should('not.have.class', 'router-link-active').contains('Debug') + cy.findAllByTestId('sidebar-link-settings-page').should('be.visible').should('not.have.class', 'router-link-active').contains('Settings') }) it('automatically collapses when viewport decreases < 1024px', () => { @@ -100,16 +102,30 @@ describe('SidebarNavigation', () => { cy.contains('.v-popper--some-open--tooltip', 'test-project').should('be.visible') cy.findByTestId('sidebar-header').trigger('mouseout') + cy.findByTestId('sidebar-link-specs-page').trigger('mouseenter') + cy.contains('.v-popper--some-open--tooltip', 'Specs').should('be.visible') + cy.findByTestId('sidebar-link-specs-page').trigger('mouseout') + cy.findByTestId('sidebar-link-runs-page').trigger('mouseenter') cy.contains('.v-popper--some-open--tooltip', 'Runs').should('be.visible') cy.findByTestId('sidebar-link-runs-page').trigger('mouseout') - cy.percySnapshot() + + cy.findByTestId('sidebar-link-debug-page').trigger('mouseenter') + cy.contains('.v-popper--some-open--tooltip', 'Debug').should('be.visible') + cy.findByTestId('sidebar-link-debug-page').trigger('mouseout') + + cy.findByTestId('sidebar-link-settings-page').trigger('mouseenter') + cy.contains('.v-popper--some-open--tooltip', 'Settings').should('be.visible') + cy.findByTestId('sidebar-link-settings-page').trigger('mouseout') }) it('opens a modal to switch testing type', { viewportWidth: 1280 }, () => { mountComponent() cy.findByTestId('sidebar-header').click() - cy.percySnapshot() + cy.get('button').contains('E2E Testing') + cy.contains('p', 'Build and test the entire experience of your application from end-to-end to ensure each flow matches your expectations.') + cy.get('button').contains('Component Testing') + cy.contains('p', 'Build and test your components from your design system in isolation in order to ensure each state matches your expectations.') }) it('opens a modal to show keyboard shortcuts', () => { @@ -133,7 +149,7 @@ describe('SidebarNavigation', () => { it('renders passing badge if run status is "RUNNING" with no failures', () => { mountComponent({ cloudProject: { status: 'RUNNING', numFailedTests: 0 } }) cy.findByLabelText('Relevant run is passing').should('be.visible').contains('0') - cy.percySnapshot('Debug Badge:failed:single-digit') + cy.percySnapshot('Debug Badge:passed:single-digit') }) it('renders failure badge if run status is "RUNNING" with failures', () => { @@ -150,20 +166,18 @@ describe('SidebarNavigation', () => { it('renders success badge when status is "PASSED"', () => { mountComponent({ cloudProject: { status: 'PASSED', numFailedTests: 0 } }) cy.findByLabelText('Relevant run passed').should('be.visible').contains('0') - cy.percySnapshot('Debug Badge:passed') }) it('renders failure badge', () => { mountComponent({ cloudProject: { status: 'FAILED', numFailedTests: 1 } }) cy.findByLabelText('Relevant run had 1 test failure').should('be.visible').contains('1') - cy.percySnapshot('Debug Badge:failed:single-digit') mountComponent({ cloudProject: { status: 'FAILED', numFailedTests: 10 } }) cy.findByLabelText('Relevant run had 10 test failures').should('be.visible').contains('10') - cy.percySnapshot('Debug Badge:failed:double-digit') mountComponent({ cloudProject: { status: 'FAILED', numFailedTests: 100 } }) cy.findByLabelText('Relevant run had 100 test failures').should('be.visible').contains('99+') + cy.percySnapshot('Debug Badge:failed:truncated') }) diff --git a/packages/app/src/navigation/SidebarNavigationHeader.cy.tsx b/packages/app/src/navigation/SidebarNavigationHeader.cy.tsx index c09e4003ec75..4917b3633e20 100644 --- a/packages/app/src/navigation/SidebarNavigationHeader.cy.tsx +++ b/packages/app/src/navigation/SidebarNavigationHeader.cy.tsx @@ -9,7 +9,6 @@ describe('SidebarNavigationHeader', () => { cy.get('[data-cy="testing-type-e2e"]').should('exist') cy.contains('test-project') - cy.percySnapshot() }) it('renders component icon', () => { @@ -26,6 +25,5 @@ describe('SidebarNavigationHeader', () => { cy.get('[data-cy="testing-type-component"]').should('exist') cy.contains('test-project') - cy.percySnapshot() }) }) diff --git a/packages/app/src/runner/SnapshotControls.cy.tsx b/packages/app/src/runner/SnapshotControls.cy.tsx index 86dd662a76e9..870fb7a5d098 100644 --- a/packages/app/src/runner/SnapshotControls.cy.tsx +++ b/packages/app/src/runner/SnapshotControls.cy.tsx @@ -11,10 +11,6 @@ const snapshotControlsSelector = '[data-testid=snapshot-controls]' const unpinButtonSelector = '[data-testid=unpin]' describe('SnapshotControls', { viewportHeight: 200, viewportWidth: 500 }, () => { - afterEach(() => { - cy.wait(100).percySnapshot() - }) - const mountSnapshotControls = ( eventManager = createEventManager(), autIframe = createTestAutIframe(), diff --git a/packages/app/src/runner/SnapshotToggle.cy.tsx b/packages/app/src/runner/SnapshotToggle.cy.tsx index 4261345647bc..730e44c5e536 100644 --- a/packages/app/src/runner/SnapshotToggle.cy.tsx +++ b/packages/app/src/runner/SnapshotToggle.cy.tsx @@ -6,14 +6,12 @@ describe('', () => { cy.mount(() => ()) - cy.percySnapshot('before') .get('body') .findByText('2') .click() .parent() .findByText('1') .click() - .percySnapshot('after') }) it('renders longer text', () => { @@ -21,14 +19,12 @@ describe('', () => { cy.mount(() => ()) - cy.percySnapshot('before') .get('body') .findByText('Request') .click() .parent() .findByText('Response') .click() - .percySnapshot('after') }) it('emits a select event with the active message', () => { diff --git a/packages/app/src/runner/SpecRunnerHeaderOpenMode.cy.tsx b/packages/app/src/runner/SpecRunnerHeaderOpenMode.cy.tsx index 8682511b6546..6963a7e47365 100644 --- a/packages/app/src/runner/SpecRunnerHeaderOpenMode.cy.tsx +++ b/packages/app/src/runner/SpecRunnerHeaderOpenMode.cy.tsx @@ -20,15 +20,18 @@ function renderWithGql (gqlVal: SpecRunnerHeaderFragment) { describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { it('renders', () => { const autStore = useAutStore() + const autUrl = 'http://localhost:4000' - autStore.updateUrl('http://localhost:4000') + autStore.updateUrl(autUrl) cy.mountFragment(SpecRunnerHeaderFragmentDoc, { render: (gqlVal) => { return renderWithGql(gqlVal) }, }) - cy.percySnapshot() + cy.findByTestId('aut-url-input').should('be.visible').should('have.value', autUrl) + cy.findByTestId('select-browser').should('be.visible').contains('Electron 73') + cy.findByTestId('viewport').should('be.visible').contains('500x500') }) it('disabled selector playground button when isRunning is true', () => { @@ -43,7 +46,9 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { }) cy.get('[data-cy="playground-activator"]').should('be.disabled') - cy.percySnapshot() + cy.findByTestId('aut-url-input').should('be.visible') + cy.findByTestId('select-browser').should('be.visible').contains('Electron 73') + cy.findByTestId('viewport').should('be.visible').contains('500x500') }) it('disabled selector playground button when isLoading is true', () => { @@ -58,7 +63,9 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { }) cy.get('[data-cy="playground-activator"]').should('be.disabled') - cy.percySnapshot() + cy.findByTestId('aut-url-input').should('be.visible') + cy.findByTestId('select-browser').should('be.visible').contains('Electron 73') + cy.findByTestId('viewport').should('be.visible').contains('500x500') }) it('enables selector playground button by default', () => { @@ -69,13 +76,16 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { }) cy.get('[data-cy="playground-activator"]').should('not.be.disabled') - cy.percySnapshot() + cy.findByTestId('aut-url-input').should('be.visible') + cy.findByTestId('select-browser').should('be.visible').contains('Electron 73') + cy.findByTestId('viewport').should('be.visible').contains('500x500') }) it('shows url section if currentTestingType is e2e', () => { const autStore = useAutStore() + const autUrl = 'http://localhost:3000' - autStore.updateUrl('http://localhost:3000') + autStore.updateUrl(autUrl) cy.mountFragment(SpecRunnerHeaderFragmentDoc, { onResult: (gql) => { @@ -87,15 +97,18 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { }) cy.get('[data-cy="aut-url"]').should('exist') - cy.percySnapshot() + cy.findByTestId('aut-url-input').should('be.visible').should('have.value', autUrl) + cy.findByTestId('select-browser').should('be.visible').contains('Electron 73') + cy.findByTestId('viewport').should('be.visible').contains('500x500') }) it('url section handles long url/small viewport', { viewportWidth: 500, }, () => { const autStore = useAutStore() + const autUrl = 'http://localhost:3000/pretty/long/url.spec.jsx' - autStore.updateUrl('http://localhost:3000/pretty/long/url.spec.jsx') + autStore.updateUrl(autUrl) cy.mountFragment(SpecRunnerHeaderFragmentDoc, { onResult: (gql) => { @@ -107,14 +120,17 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { }) cy.get('[data-cy="aut-url"]').should('exist') + cy.findByTestId('aut-url-input').should('be.visible').should('have.value', autUrl) + cy.findByTestId('select-browser').should('be.visible').contains('Electron 73') + cy.findByTestId('viewport').should('be.visible').contains('500x500') cy.percySnapshot() }) it('links to aut url', () => { const autStore = useAutStore() - const url = 'http://localhost:3000/todo' + const autUrl = 'http://localhost:3000/todo' - autStore.updateUrl(url) + autStore.updateUrl(autUrl) cy.mountFragment(SpecRunnerHeaderFragmentDoc, { onResult: (gql) => { @@ -125,8 +141,9 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { }, }) - cy.findByTestId('aut-url-input').invoke('val').should('contain', url) - cy.percySnapshot() + cy.findByTestId('aut-url-input').invoke('val').should('contain', autUrl) + cy.findByTestId('select-browser').should('be.visible').contains('Electron 73') + cy.findByTestId('viewport').should('be.visible').contains('500x500') }) it('does not show url section if currentTestingType is component', () => { @@ -143,9 +160,10 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { }, }) - cy.get('[data-cy="playground-activator"]').should('be.visible') - cy.get('[data-cy="aut-url"]').should('not.exist') - cy.percySnapshot() + cy.findByTestId('playground-activator').should('be.visible') + cy.findByTestId('aut-url').should('not.exist') + cy.findByTestId('select-browser').should('be.visible').contains('Electron 73') + cy.findByTestId('viewport').should('be.visible').contains('500x500') }) it('shows current browser and possible browsers', () => { @@ -177,8 +195,11 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { }, }) + cy.findByTestId('select-browser').contains('Fake Browser') + cy.get('[data-cy="select-browser"] > button img').should('have.attr', 'src', allBrowsersIcons.generic) - cy.percySnapshot() + + cy.findByTestId('viewport').contains('500x500') }) it('shows current viewport info', () => { @@ -219,10 +240,11 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { .should('be.visible') .should('have.attr', 'href', 'https://on.cypress.io/viewport') + cy.contains('The viewport determines the width and height of your application under test. By default the viewport will be 500px by 500px for end-to-end testing.') cy.contains('Additionally, you can override this value in your cypress.config.ts or via the cy.viewport() command.') .should('be.visible') - cy.percySnapshot() + cy.findByTestId('viewport-docs').should('have.attr', 'href', 'https://on.cypress.io/viewport') }) it('disables browser dropdown button when isRunning is true', () => { @@ -239,8 +261,10 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { }, }) + cy.findByTestId('select-browser').should('be.visible').contains('Chrome 78') cy.get('[data-cy="select-browser"] > button').should('be.disabled') - cy.percySnapshot() + cy.findByTestId('aut-url').should('be.visible') + cy.findByTestId('viewport').should('be.visible').contains('500x500') }) it('opens and closes selector playground', () => { @@ -250,12 +274,10 @@ describe('SpecRunnerHeaderOpenMode', { viewportHeight: 500 }, () => { }, }) - cy.get('[data-cy="playground-activator"]').click() + cy.findByTestId('playground-activator').click() cy.get('#selector-playground').should('be.visible') - cy.percySnapshot() - - cy.get('[data-cy="playground-activator"]').click() + cy.findByTestId('playground-activator').click() cy.get('#selector-playground').should('not.exist') }) }) diff --git a/packages/app/src/runner/SpecRunnerHeaderRunMode.cy.tsx b/packages/app/src/runner/SpecRunnerHeaderRunMode.cy.tsx index 2d3e1016dee9..e534f6e83ed2 100644 --- a/packages/app/src/runner/SpecRunnerHeaderRunMode.cy.tsx +++ b/packages/app/src/runner/SpecRunnerHeaderRunMode.cy.tsx @@ -56,8 +56,6 @@ describe('SpecRunnerHeaderRunMode', { viewportHeight: 500 }, () => { cy.contains('The viewport determines').should('not.exist') cy.contains('Chrome 1').click() cy.contains('Firefox').should('not.exist') - - cy.percySnapshot() }) }) @@ -72,9 +70,8 @@ describe('SpecRunnerHeaderRunMode', { viewportHeight: 500 }, () => { cy.mount() + cy.get('[data-cy="select-browser"] > button img').should('have.attr', 'src', allBrowsersIcons.Chrome) cy.get('[data-cy="select-browser"] > button').should('be.disabled') - - cy.percySnapshot() }) }) @@ -90,7 +87,7 @@ describe('SpecRunnerHeaderRunMode', { viewportHeight: 500 }, () => { cy.mount() cy.get('[data-cy="select-browser"] > button img').should('have.attr', 'src', allBrowsersIcons.generic) - cy.percySnapshot() + cy.get('[data-cy="select-browser"] > button').should('be.disabled') }) }) }) diff --git a/packages/app/src/runner/automation/AutomationDisconnected.cy.tsx b/packages/app/src/runner/automation/AutomationDisconnected.cy.tsx index af8353a9b92c..6cc16b47bb44 100644 --- a/packages/app/src/runner/automation/AutomationDisconnected.cy.tsx +++ b/packages/app/src/runner/automation/AutomationDisconnected.cy.tsx @@ -5,7 +5,10 @@ describe('AutomationDisconnected', () => { it('should relaunch browser', () => { cy.mount() - cy.percySnapshot() + cy.findByTestId('collapsible').should('be.visible') + cy.contains('h3', 'The Cypress extension has disconnected.') + cy.contains('p', 'Cypress cannot run tests without this extension.') + cy.get('a').contains('Read more about browser management').should('have.attr', 'href', 'https://on.cypress.io/launching-browsers') const relaunchStub = cy.stub() diff --git a/packages/app/src/runner/automation/AutomationMissing.cy.tsx b/packages/app/src/runner/automation/AutomationMissing.cy.tsx index bbadf16ea2a0..2779fcadbe05 100644 --- a/packages/app/src/runner/automation/AutomationMissing.cy.tsx +++ b/packages/app/src/runner/automation/AutomationMissing.cy.tsx @@ -14,7 +14,10 @@ describe('AutomationMissing', () => { }, }) - cy.percySnapshot() + cy.findByTestId('collapsible').should('be.visible') + cy.contains('h3', 'The Cypress extension is missing.') + cy.contains('p', 'Cypress cannot run tests without this extension. Please choose another browser.') + cy.findByTestId('external').contains('Read more about browser management').should('have.attr', 'href', 'https://on.cypress.io/launching-browsers') const selectBrowserStub = cy.stub() diff --git a/packages/app/src/runner/selector-playground/SelectorPlayground.cy.tsx b/packages/app/src/runner/selector-playground/SelectorPlayground.cy.tsx index f879da4251ef..785e81c7d000 100644 --- a/packages/app/src/runner/selector-playground/SelectorPlayground.cy.tsx +++ b/packages/app/src/runner/selector-playground/SelectorPlayground.cy.tsx @@ -28,8 +28,6 @@ describe('SelectorPlayground', () => { cy.spy(autIframe, 'toggleSelectorHighlight') cy.get('[data-cy="selected-playground-method"]').should('contain', 'cy.get') cy.get('[data-cy="playground-selector"]').should('have.value', 'body') - - cy.percySnapshot() }) it('toggles enabled', () => { diff --git a/packages/app/src/runs/RunCard.cy.tsx b/packages/app/src/runs/RunCard.cy.tsx index 799044edfc3f..0b1a8f46f81e 100644 --- a/packages/app/src/runs/RunCard.cy.tsx +++ b/packages/app/src/runs/RunCard.cy.tsx @@ -74,8 +74,6 @@ describe('', { viewportHeight: 400 }, () => { cy.contains(CloudRunStubs.allPassing.commitInfo.branch as string) .should('be.visible') - - cy.percySnapshot() }) }) @@ -100,8 +98,6 @@ describe('', { viewportHeight: 400 }, () => { // this is the human readable commit time from the stub cy.contains('an hour ago').should('be.visible') - - cy.percySnapshot() }) }) @@ -122,8 +118,6 @@ describe('', { viewportHeight: 400 }, () => { // this is the human readable commit time from the stub cy.contains('01:01:01').should('be.visible') - - cy.percySnapshot() }) it('displays mm:ss format for run duration if duration is less than an hour', () => { @@ -142,8 +136,6 @@ describe('', { viewportHeight: 400 }, () => { // this is the human readable commit time from the stub cy.contains('01:01').should('be.visible') - - cy.percySnapshot() }) }) @@ -163,8 +155,6 @@ describe('', { viewportHeight: 400 }, () => { }) cy.get('[data-cy="run-tag"]').should('have.length', 2).each(($el, i) => cy.wrap($el).contains(`tag${i}`)) - - cy.percySnapshot() }) it('truncates tags if > 2', () => { @@ -182,8 +172,6 @@ describe('', { viewportHeight: 400 }, () => { }) cy.get('[data-cy="run-tag"]').should('have.length', 3).last().contains('+4') - - cy.percySnapshot() }) }) }) diff --git a/packages/app/src/runs/RunResults.cy.tsx b/packages/app/src/runs/RunResults.cy.tsx index 87ecceea0296..140a9ec5daa2 100644 --- a/packages/app/src/runs/RunResults.cy.tsx +++ b/packages/app/src/runs/RunResults.cy.tsx @@ -17,8 +17,6 @@ describe('', { viewportHeight: 150, viewportWidth: 250 }, () => { cy.get(`[title=${defaultMessages.runs.results.pending}]`).should('contain.text', cloudRun.totalPending) }) }) - - cy.percySnapshot() }) it('renders flaky ribbon', () => { @@ -32,7 +30,5 @@ describe('', { viewportHeight: 150, viewportWidth: 250 }, () => { }) cy.contains('4 Flaky') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/runs/RunsConnectSuccessAlert.spec.tsx b/packages/app/src/runs/RunsConnectSuccessAlert.spec.tsx index 0dfe111c5d55..da79aaf33eaa 100644 --- a/packages/app/src/runs/RunsConnectSuccessAlert.spec.tsx +++ b/packages/app/src/runs/RunsConnectSuccessAlert.spec.tsx @@ -41,9 +41,6 @@ describe('', { viewportHeight: 400 }, () => { ) }, }) - - cy.viewport(1000, 800) - cy.percySnapshot() }) }) }) diff --git a/packages/app/src/runs/RunsContainer.cy.tsx b/packages/app/src/runs/RunsContainer.cy.tsx index 1b6dee2fbbf8..8439e2a4c17d 100644 --- a/packages/app/src/runs/RunsContainer.cy.tsx +++ b/packages/app/src/runs/RunsContainer.cy.tsx @@ -98,7 +98,6 @@ describe('', { keystrokeDelay: 0 }, () => { const text = defaultMessages.runs.empty cy.contains(text.title).should('be.visible') - cy.percySnapshot() }) }) diff --git a/packages/app/src/runs/RunsErrorRenderer.spec.tsx b/packages/app/src/runs/RunsErrorRenderer.spec.tsx index 68dc15d9c34e..abcc79921654 100644 --- a/packages/app/src/runs/RunsErrorRenderer.spec.tsx +++ b/packages/app/src/runs/RunsErrorRenderer.spec.tsx @@ -16,7 +16,10 @@ describe('', () => { }, }) - cy.percySnapshot() + cy.contains('h2', 'Cannot connect to Cypress Cloud') + cy.contains('p', 'The request times out when trying to retrieve the recorded runs from Cypress Cloud. Please refresh the page to try again and visit out Support page if this behavior continues.') + cy.findByTestId('external').contains('Support page').should('have.attr', 'href', 'https://www.cypressstatus.com/') + cy.contains('button', 'Try again') }) it('should show a "not found" error and opens reconnect modal', () => { @@ -43,7 +46,6 @@ describe('', () => { cy.contains('button', text.notFound.button).click() cy.get('@loginConnectSpy').should('have.been.calledWith', { utmMedium: 'Runs Tab' }) - cy.percySnapshot() }) describe('unauthorized', () => { @@ -62,7 +64,9 @@ describe('', () => { }, }) - cy.percySnapshot() + cy.contains('h2', 'Request access to view the recorded runs') + cy.contains('p', 'This is a private project that you do not currently have access to. Please request access from the project owner in order to view the list of runs.') + cy.contains('button', 'Request access') }) it('should display an "access requested" error', () => { @@ -81,7 +85,9 @@ describe('', () => { }, }) - cy.percySnapshot() + cy.contains('h2', 'Your access request for this project has been sent.') + cy.contains('p', 'The owner of this project has been notified of your request. We\'ll notify you via email when your access request has been granted.') + cy.contains('button', 'Request Sent').should('be.disabled') }) }) }) diff --git a/packages/app/src/settings/SettingsCard.cy.tsx b/packages/app/src/settings/SettingsCard.cy.tsx index abb3838091b9..ed51aa787323 100644 --- a/packages/app/src/settings/SettingsCard.cy.tsx +++ b/packages/app/src/settings/SettingsCard.cy.tsx @@ -63,7 +63,6 @@ describe('', () => { )) cy.contains(collapsibleSelector, title).focus().type(' ') - - cy.percySnapshot() + cy.findByTestId('setting-expanded-container').contains('The body of the content').should('be.visible') }) }) diff --git a/packages/app/src/settings/SettingsContainer.cy.tsx b/packages/app/src/settings/SettingsContainer.cy.tsx index 3984fc828a71..a932a0513727 100644 --- a/packages/app/src/settings/SettingsContainer.cy.tsx +++ b/packages/app/src/settings/SettingsContainer.cy.tsx @@ -10,8 +10,9 @@ describe('', { viewportHeight: 800, viewportWidth: 900 }, ( it('renders sections collapsed by default', () => { cy.findByTestId('settings').should('be.visible') cy.findByTestId('setting-expanded-container').should('not.exist') - - cy.percySnapshot() + cy.findByText(defaultMessages.settingsPage.experiments.title).should('not.exist') + cy.findByText(defaultMessages.settingsPage.editor.title).should('not.exist') + cy.findByText(defaultMessages.settingsPage.projectId.title).should('not.exist') }) it('expands and collapses project settings', () => { @@ -20,7 +21,6 @@ describe('', { viewportHeight: 800, viewportWidth: 900 }, ( cy.findByText(defaultMessages.settingsPage.experiments.title).scrollIntoView().should('be.visible') cy.findByText(defaultMessages.settingsPage.specPattern.title).scrollIntoView().should('be.visible') cy.findByText(defaultMessages.settingsPage.config.title).scrollIntoView().should('be.visible') - cy.percySnapshot() cy.findByText('Project settings').click() cy.findByText(defaultMessages.settingsPage.experiments.title).should('not.exist') @@ -32,7 +32,6 @@ describe('', { viewportHeight: 800, viewportWidth: 900 }, ( cy.findByText(defaultMessages.settingsPage.editor.title).should('be.visible') cy.findByText(defaultMessages.settingsPage.proxy.title).should('be.visible') cy.findByText(defaultMessages.settingsPage.testingPreferences.title).should('be.visible') - cy.percySnapshot() cy.findByText('Device settings').click() @@ -43,7 +42,6 @@ describe('', { viewportHeight: 800, viewportWidth: 900 }, ( cy.contains('Cypress Cloud settings').click() cy.findByText(defaultMessages.settingsPage.projectId.title).scrollIntoView().should('be.visible') - cy.percySnapshot() cy.findByText('Cypress Cloud settings').click() cy.findByText(defaultMessages.settingsPage.projectId.title).should('not.exist') diff --git a/packages/app/src/settings/SettingsSection.cy.tsx b/packages/app/src/settings/SettingsSection.cy.tsx index 5cb34d155bfd..f447e1b8a899 100644 --- a/packages/app/src/settings/SettingsSection.cy.tsx +++ b/packages/app/src/settings/SettingsSection.cy.tsx @@ -21,7 +21,5 @@ describe('', () => { .get('h1').should('contain.text', title) .get('p').should('contain.text', description) .get('code').should('contain.text', code) - - cy.percySnapshot() }) }) diff --git a/packages/app/src/settings/device/ExternalEditorSettings.cy.tsx b/packages/app/src/settings/device/ExternalEditorSettings.cy.tsx index 693ff5c346e4..748aee690c51 100644 --- a/packages/app/src/settings/device/ExternalEditorSettings.cy.tsx +++ b/packages/app/src/settings/device/ExternalEditorSettings.cy.tsx @@ -13,8 +13,6 @@ describe('', () => { }) cy.findByText(editorText.noEditorSelectedPlaceholder).should('be.visible') - - cy.percySnapshot() }) it('renders the title and description', () => { @@ -35,16 +33,13 @@ describe('', () => { }, }) - const optionsSelector = '[role=option]' - const inputSelector = '[aria-haspopup=true]' - - cy.get(inputSelector).click() - .get(optionsSelector).should('be.visible') - .get(optionsSelector).then(($options) => { + cy.get('[aria-haspopup=true]').click() + .get('[role=option]').should('be.visible') + .then(($options) => { cy.wrap($options.first()).click() - - cy.percySnapshot() }) + + cy.get('[aria-expanded="false"]').contains('VS Code') }) it('can input a custom binary', () => { @@ -62,7 +57,5 @@ describe('', () => { cy.get('[data-cy="custom-editor"]').should('exist') cy.findByPlaceholderText(editorText.customPathPlaceholder).type('/usr/bin').should('have.value', '/usr/bin') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/settings/device/ProxySettings.cy.tsx b/packages/app/src/settings/device/ProxySettings.cy.tsx index fb18ca976b03..61a2b71e2164 100644 --- a/packages/app/src/settings/device/ProxySettings.cy.tsx +++ b/packages/app/src/settings/device/ProxySettings.cy.tsx @@ -15,13 +15,13 @@ describe('', { render: (gql) =>
, }) + cy.contains('h2', 'Proxy settings') + cy.contains('p', 'Cypress auto-detected the following proxy settings from your operating system.') cy.findByText('Proxy bypass list') .get('[data-testid=bypass-list]').should('have.text', 'proxy-bypass') cy.findByText('Proxy server') .get('[data-testid=proxy-server]').should('have.text', 'proxy-server') - - cy.percySnapshot() }) it('renders the title and description', () => { diff --git a/packages/app/src/settings/device/TestingPreferences.cy.tsx b/packages/app/src/settings/device/TestingPreferences.cy.tsx index ceeeebf2f6d0..f82896a8b3e6 100644 --- a/packages/app/src/settings/device/TestingPreferences.cy.tsx +++ b/packages/app/src/settings/device/TestingPreferences.cy.tsx @@ -3,16 +3,6 @@ import { TestingPreferencesFragmentDoc } from '../../generated/graphql-test' import TestingPreferences from './TestingPreferences.vue' describe('', () => { - it('renders', () => { - cy.mountFragment(TestingPreferencesFragmentDoc, { - render: (gql) => (
- -
), - }) - - cy.percySnapshot() - }) - it('renders the title and description', () => { const testingPreferences = defaultMessages.settingsPage.testingPreferences diff --git a/packages/app/src/settings/project/CloudSettings.cy.tsx b/packages/app/src/settings/project/CloudSettings.cy.tsx index d64ca4649f48..75535444f87b 100644 --- a/packages/app/src/settings/project/CloudSettings.cy.tsx +++ b/packages/app/src/settings/project/CloudSettings.cy.tsx @@ -41,8 +41,6 @@ describe('', () => { cy.findByText(defaultMessages.settingsPage.projectId.title).should('not.exist') cy.findByText(defaultMessages.runs.connect.buttonUser).should('be.visible') cy.findByText(defaultMessages.settingsPage.recordKey.title).should('not.exist') - - cy.percySnapshot() }) it('hides Record Key when not present', () => { @@ -64,6 +62,6 @@ describe('', () => { cy.findByText(defaultMessages.settingsPage.recordKey.title).should('not.exist') - cy.percySnapshot() + cy.get('button').contains('Connect to Cypress Cloud') }) }) diff --git a/packages/app/src/settings/project/CodeBox.cy.tsx b/packages/app/src/settings/project/CodeBox.cy.tsx index 674fd69dc327..cef32015cf2e 100644 --- a/packages/app/src/settings/project/CodeBox.cy.tsx +++ b/packages/app/src/settings/project/CodeBox.cy.tsx @@ -9,7 +9,6 @@ describe('', () => { )) cy.findByText('123456789').should('be.visible') - cy.percySnapshot() }) it('renders the confidential', () => { @@ -21,7 +20,6 @@ describe('', () => { cy.findByText('123456789').should('not.exist') cy.get('[aria-label="Record Key Visibility Toggle"]').click() cy.findByText('123456789').should('be.visible') - cy.percySnapshot() }) it('renders the icon', () => { diff --git a/packages/app/src/settings/project/Config.cy.tsx b/packages/app/src/settings/project/Config.cy.tsx index 2ffae47f5060..8e5e09c220ba 100644 --- a/packages/app/src/settings/project/Config.cy.tsx +++ b/packages/app/src/settings/project/Config.cy.tsx @@ -16,13 +16,10 @@ describe('', { viewportWidth: 1200, viewportHeight: 1600 }, () => { cy.get('[data-cy="config-code"]').contains('reporter') cy.get('[data-cy="config-legend"]').contains('default') cy.contains(defaultMessages.settingsPage.config.title) - // TODO: write a support file helper for ignoring the {0} values etc each(defaultMessages.settingsPage.config.description.split('{0}'), (description) => { cy.contains(description) }) - - cy.percySnapshot() }) it('matches up legends with values', () => { diff --git a/packages/app/src/settings/project/ConfigCode.cy.tsx b/packages/app/src/settings/project/ConfigCode.cy.tsx index 85a6316fa8df..15bda8ff0767 100644 --- a/packages/app/src/settings/project/ConfigCode.cy.tsx +++ b/packages/app/src/settings/project/ConfigCode.cy.tsx @@ -74,9 +74,6 @@ describe('', () => { .should('be.visible') .should('contain.text', 'plugin') }) - - // Take a snapshot of the last case - cy.percySnapshot() }) it('shows the objectTest nicely', () => { @@ -199,8 +196,6 @@ describe('', () => { browser.minSupportedVersion && cy.contains(`minSupportedVersion: ${browser.minSupportedVersion},`) browser.majorVersion && cy.contains(`majorVersion: ${browser.majorVersion},`) }) - - cy.percySnapshot() } else { throw new Error('Missing browsers to render') } diff --git a/packages/app/src/settings/project/ExperimentRow.cy.tsx b/packages/app/src/settings/project/ExperimentRow.cy.tsx index 536cb9bebf26..86335d1549bd 100644 --- a/packages/app/src/settings/project/ExperimentRow.cy.tsx +++ b/packages/app/src/settings/project/ExperimentRow.cy.tsx @@ -38,7 +38,5 @@ describe('', () => { cy.findByText(expDisabled.description).should('be.visible') cy.findByText(expDisabled.key).should('be.visible') }) - - cy.percySnapshot() }) }) diff --git a/packages/app/src/settings/project/Experiments.cy.tsx b/packages/app/src/settings/project/Experiments.cy.tsx index f859ac1cd5fd..e56e271a9cfa 100644 --- a/packages/app/src/settings/project/Experiments.cy.tsx +++ b/packages/app/src/settings/project/Experiments.cy.tsx @@ -21,7 +21,5 @@ describe('', { viewportWidth: 800, viewportHeight: 600 }, () => { cy.contains(`[data-cy="experiment-${exp.field}"]`, expName) .should('contain', exp.value ? 'Enabled' : 'Disabled') }) - - cy.percySnapshot() }) }) diff --git a/packages/app/src/settings/project/ProjectId.cy.tsx b/packages/app/src/settings/project/ProjectId.cy.tsx index a238bfab11a0..42dca4b0dc30 100644 --- a/packages/app/src/settings/project/ProjectId.cy.tsx +++ b/packages/app/src/settings/project/ProjectId.cy.tsx @@ -25,7 +25,5 @@ describe('', () => { cy.findByText(givenProjectId).should('be.visible') cy.findByText('Copy') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/settings/project/ProjectSettings.cy.tsx b/packages/app/src/settings/project/ProjectSettings.cy.tsx index c944c37710c2..34ed10e7140d 100644 --- a/packages/app/src/settings/project/ProjectSettings.cy.tsx +++ b/packages/app/src/settings/project/ProjectSettings.cy.tsx @@ -16,7 +16,5 @@ describe('', () => { }) cy.findByText(defaultMessages.settingsPage.experiments.title).should('be.visible') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/settings/project/RecordKey.cy.tsx b/packages/app/src/settings/project/RecordKey.cy.tsx index d1189bd0ddf3..01da70fa33d4 100644 --- a/packages/app/src/settings/project/RecordKey.cy.tsx +++ b/packages/app/src/settings/project/RecordKey.cy.tsx @@ -46,7 +46,5 @@ describe('', () => { cy.contains('button', defaultMessages.clipboard.copy) .should('be.visible') .and('not.be.disabled') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/settings/project/SpecPatterns.cy.tsx b/packages/app/src/settings/project/SpecPatterns.cy.tsx index 7e3c3673bd0a..cd5f3c2a4791 100644 --- a/packages/app/src/settings/project/SpecPatterns.cy.tsx +++ b/packages/app/src/settings/project/SpecPatterns.cy.tsx @@ -18,7 +18,5 @@ describe('', () => { cy.get('[data-cy="file-match-indicator"]').contains('50 matches') cy.get('[data-cy="spec-pattern"]').contains('cypress/e2e/**/*.cy.{js,jsx,ts,tsx}') cy.get('[data-cy="external"]').should('have.attr', 'href').and('eq', 'https://on.cypress.io/test-type-options') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/specs/AverageDuration.cy.tsx b/packages/app/src/specs/AverageDuration.cy.tsx index b3c3fc1cd1ec..641c8d3424d4 100644 --- a/packages/app/src/specs/AverageDuration.cy.tsx +++ b/packages/app/src/specs/AverageDuration.cy.tsx @@ -23,7 +23,6 @@ describe('', () => { it('renders nothing', () => { cy.findByTestId('average-duration').should('not.exist') - cy.percySnapshot() }) }) @@ -35,7 +34,6 @@ describe('', () => { it('renders zero duration', () => { cy.findByTestId('average-duration').contains('0:00') - cy.percySnapshot() }) }) @@ -46,7 +44,6 @@ describe('', () => { it('shows correct time', () => { cy.findByTestId('average-duration').contains('0:00') - cy.percySnapshot() }) }) }) @@ -58,7 +55,6 @@ describe('', () => { it('shows correct time', () => { cy.findByTestId('average-duration').contains('0:12') - cy.percySnapshot() }) }) @@ -71,7 +67,6 @@ describe('', () => { it('shows correct time', () => { // 2:00 = 120 seconds cy.findByTestId('average-duration').contains('2:00') - cy.percySnapshot() }) }) @@ -83,7 +78,6 @@ describe('', () => { it('shows correct time', () => { // 2:34 = 154 seconds cy.findByTestId('average-duration').contains('2:34') - cy.percySnapshot() }) }) }) @@ -97,7 +91,6 @@ describe('', () => { it('shows correct time', () => { // 2:02:34 = 7354 seconds cy.findByTestId('average-duration').contains('2:02:34') - cy.percySnapshot() }) }) @@ -109,7 +102,6 @@ describe('', () => { it('shows correct time', () => { // 42:02:34 = 151354 seconds cy.findByTestId('average-duration').contains('42:02:34') - cy.percySnapshot() }) }) }) diff --git a/packages/app/src/specs/CreateSpecModal.cy.tsx b/packages/app/src/specs/CreateSpecModal.cy.tsx index 293937474c1e..79b8c5e7f039 100644 --- a/packages/app/src/specs/CreateSpecModal.cy.tsx +++ b/packages/app/src/specs/CreateSpecModal.cy.tsx @@ -298,7 +298,5 @@ describe('defaultSpecFileName', () => { cy.get('[data-cy="card"]').contains('Create new spec').click() cy.get('input').invoke('val').should('contain', 'spec.cy.js') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/specs/InlineSpecList.cy.tsx b/packages/app/src/specs/InlineSpecList.cy.tsx index b87071603260..31a0b2731c2d 100644 --- a/packages/app/src/specs/InlineSpecList.cy.tsx +++ b/packages/app/src/specs/InlineSpecList.cy.tsx @@ -72,7 +72,11 @@ describe('InlineSpecList', () => { cy.get(newSpecSelector).click() cy.contains(defaultMessages.createSpec.newSpecModalTitle).should('be.visible') - cy.percySnapshot() + cy.contains(defaultMessages.createSpec.e2e.importFromScaffold.header).should('be.visible') + cy.contains(defaultMessages.createSpec.e2e.importFromScaffold.description).should('be.visible') + + cy.contains(defaultMessages.createSpec.e2e.importTemplateSpec.header).should('be.visible') + cy.contains(defaultMessages.createSpec.e2e.importTemplateSpec.description).should('be.visible') }) it('should handle spec refresh', () => { diff --git a/packages/app/src/specs/InlineSpecListHeader.cy.tsx b/packages/app/src/specs/InlineSpecListHeader.cy.tsx index 7964b59307bd..bbaf88550d6a 100644 --- a/packages/app/src/specs/InlineSpecListHeader.cy.tsx +++ b/packages/app/src/specs/InlineSpecListHeader.cy.tsx @@ -82,7 +82,6 @@ describe('InlineSpecListHeader', () => { useRunAllSpecsStore() mountWithProps({ isRunAllSpecsAllowed: true }) - cy.percySnapshot() cy.get('[data-cy=run-all-specs-for-all]').as('run-all-btn').realHover() cy.contains(`Run ${EXPECTED_SPEC_COUNT} specs`).should('be.visible') diff --git a/packages/app/src/specs/InlineSpecListTree.cy.tsx b/packages/app/src/specs/InlineSpecListTree.cy.tsx index 3901a1f28948..fd69d0ea5310 100644 --- a/packages/app/src/specs/InlineSpecListTree.cy.tsx +++ b/packages/app/src/specs/InlineSpecListTree.cy.tsx @@ -97,7 +97,5 @@ describe('InlineSpecListTree', () => { .should('contain', 'Spec-C') .should('contain', 'utils') .and('contain', 'Spec-D') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/specs/LastUpdatedHeader.cy.tsx b/packages/app/src/specs/LastUpdatedHeader.cy.tsx index 93b9fd8071be..52649a681216 100644 --- a/packages/app/src/specs/LastUpdatedHeader.cy.tsx +++ b/packages/app/src/specs/LastUpdatedHeader.cy.tsx @@ -27,14 +27,12 @@ describe('', () => { it('mounts correctly with git unavailable', () => { mountWithProps(false) - cy.findByTestId('last-updated-header').trigger('mouseenter') + cy.findByTestId('last-updated-header').contains('Last updated').trigger('mouseenter') const expectedTooltipText = defaultMessages.specPage.lastUpdated.tooltip.gitInfoUnavailable .replace('{0}', defaultMessages.specPage.lastUpdated.tooltip.gitInfo) cy.get(popperContentSelector).should('have.text', expectedTooltipText) - - cy.percySnapshot() }) it('delays popping tooltip', () => { diff --git a/packages/app/src/specs/NoSpecsPage.cy.tsx b/packages/app/src/specs/NoSpecsPage.cy.tsx index 3d887034f85a..1e4183d8f06c 100644 --- a/packages/app/src/specs/NoSpecsPage.cy.tsx +++ b/packages/app/src/specs/NoSpecsPage.cy.tsx @@ -40,8 +40,6 @@ describe('', { viewportHeight: 655, viewportWidth: 1032 }, () => it('renders the correct text for component testing', () => { cy.get(pageTitleSelector).should('contain.text', messages.page.defaultPatternNoSpecs.title) .get(pageDescriptionSelector).should('contain.text', messages.page.defaultPatternNoSpecs.component.description) - - cy.percySnapshot() }) }) @@ -74,7 +72,6 @@ describe('', { viewportHeight: 655, viewportWidth: 1032 }, () => cy.contains(text.importFromScaffold.description).should('be.visible') cy.contains(text.importTemplateSpec.header).should('be.visible') cy.contains(text.importTemplateSpec.description).should('be.visible') - cy.percySnapshot() }) }) diff --git a/packages/app/src/specs/RequestAccessButton.cy.tsx b/packages/app/src/specs/RequestAccessButton.cy.tsx index 46a50408ebc5..31edec89ab80 100644 --- a/packages/app/src/specs/RequestAccessButton.cy.tsx +++ b/packages/app/src/specs/RequestAccessButton.cy.tsx @@ -32,8 +32,6 @@ describe('', () => { cy.get(requestAccessButtonSelector) .should('be.visible') .and('contain.text', messages.requestAccessButton) - - cy.percySnapshot() }) it('triggers mutation on button click', () => { @@ -83,8 +81,6 @@ describe('', () => { cy.get(requestSentButton) .should('be.visible') .and('contain.text', messages.requestSentButton) - - cy.percySnapshot() }) }) }) diff --git a/packages/app/src/specs/SpecFileItem.cy.tsx b/packages/app/src/specs/SpecFileItem.cy.tsx index e02d40d06168..37a0767279db 100644 --- a/packages/app/src/specs/SpecFileItem.cy.tsx +++ b/packages/app/src/specs/SpecFileItem.cy.tsx @@ -8,8 +8,6 @@ describe('SpecFileItem', () => { )) cy.contains('Hello.spec.jsx').should('be.visible') - - cy.percySnapshot() }) it('renders a SpecFileItem with the base filename and extension when selected', () => { @@ -19,8 +17,6 @@ describe('SpecFileItem', () => { )) cy.contains('Hello.spec.jsx').should('be.visible') - - cy.percySnapshot() }) it('truncates spec name if it exceeds container width and provides title for full spec name', () => { diff --git a/packages/app/src/specs/SpecHeaderCloudDataTooltip.cy.tsx b/packages/app/src/specs/SpecHeaderCloudDataTooltip.cy.tsx index ce27ab2b4a6c..797c08a7116e 100644 --- a/packages/app/src/specs/SpecHeaderCloudDataTooltip.cy.tsx +++ b/packages/app/src/specs/SpecHeaderCloudDataTooltip.cy.tsx @@ -112,8 +112,6 @@ describe('', () => { .and('contain', get(defaultMessages, msgKeys.connected).replace('{0}', get(defaultMessages, msgKeys.docs))) cy.findByTestId('cloud-data-tooltip-content').find('button').should('not.exist') - - cy.percySnapshot() }) }) @@ -134,8 +132,6 @@ describe('', () => { .click() cy.get('@showLoginConnectSpy').should('have.been.calledOnce') - - cy.percySnapshot() }) }) @@ -152,7 +148,6 @@ describe('', () => { .and('contain', get(defaultMessages, msgKeys.noAccess).replace('{0}', get(defaultMessages, msgKeys.docs))) cy.contains('button', defaultMessages.specPage.requestAccessButton).should('be.visible') - cy.percySnapshot() }) }) @@ -168,9 +163,7 @@ describe('', () => { .should('be.visible') .and('contain', get(defaultMessages, msgKeys.noAccess).replace('{0}', get(defaultMessages, msgKeys.docs))) - cy.contains('button', defaultMessages.specPage.requestSentButton).should('be.visible') - - cy.percySnapshot() + cy.contains('button', defaultMessages.specPage.requestSentButton).should('be.visible').should('be.disabled') }) }) @@ -191,8 +184,6 @@ describe('', () => { .click() cy.get('@showLoginConnectSpy').should('have.been.calledOnce') - - cy.percySnapshot() }) }) @@ -213,8 +204,6 @@ describe('', () => { .click() cy.get('@showLoginConnectSpy').should('have.been.calledOnce') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/specs/SpecItem.cy.tsx b/packages/app/src/specs/SpecItem.cy.tsx index a1313a4e0bd9..0d1578fa029e 100644 --- a/packages/app/src/specs/SpecItem.cy.tsx +++ b/packages/app/src/specs/SpecItem.cy.tsx @@ -38,8 +38,6 @@ describe('SpecItem', () => { expect(highlightedElementColor).to.equal(parentColor) }) }) - - cy.percySnapshot() }), it('truncates spec name if it exceeds container width and provides title for full spec name', () => { const specFileName = `${'Long'.repeat(20)}Name` diff --git a/packages/app/src/specs/SpecNameDisplay.cy.tsx b/packages/app/src/specs/SpecNameDisplay.cy.tsx index 7df965a22752..745bf41dc213 100644 --- a/packages/app/src/specs/SpecNameDisplay.cy.tsx +++ b/packages/app/src/specs/SpecNameDisplay.cy.tsx @@ -8,7 +8,5 @@ describe('', () => { cy.findByText('.cy.tsx').should('be.visible') cy.findByTestId('spec-filename').should('have.attr', 'title', 'myFileName.cy.tsx') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/specs/SpecsList.cy.tsx b/packages/app/src/specs/SpecsList.cy.tsx index 3dfaa72ef004..2d920de0cb87 100644 --- a/packages/app/src/specs/SpecsList.cy.tsx +++ b/packages/app/src/specs/SpecsList.cy.tsx @@ -178,25 +178,6 @@ describe('', { keystrokeDelay: 0 }, () => { }) }) }) - - it('displays the list as expected visually at various widths', () => { - cy.get('[data-cy="spec-list-file"]') - .should('have.length.above', 2) - .should('have.length.below', specs.length) - - cy.wait(100) // there's an intentional 50ms delay in the code, lets just wait it out - - cy.viewport(500, 850) - cy.percySnapshot('narrowest') - cy.viewport(650, 850) - cy.percySnapshot('narrow') - cy.viewport(800, 850) - cy.percySnapshot('medium') - cy.viewport(1200, 850) - cy.percySnapshot('wide') - cy.viewport(2000, 850) - cy.percySnapshot('widest') - }) }) }) diff --git a/packages/app/src/specs/SpecsListBanners.cy.tsx b/packages/app/src/specs/SpecsListBanners.cy.tsx index 7cd82a865dbd..b78bd3f49009 100644 --- a/packages/app/src/specs/SpecsListBanners.cy.tsx +++ b/packages/app/src/specs/SpecsListBanners.cy.tsx @@ -10,16 +10,17 @@ import { UserProjectStatusStore, useUserProjectStatusStore } from '@packages/fro import type { UserProjectStatusState } from '@packages/frontend-shared/src/store/user-project-status-store' const AlertSelector = 'alert-header' +const AlertBody = 'alert-body' const AlertCloseBtnSelector = 'alert-suffix-icon' type BannerKey = keyof typeof BannerIds type BannerId = typeof BannerIds[BannerKey] describe('', { viewportHeight: 260, defaultCommandTimeout: 1000 }, () => { - const validateBaseRender = () => { + const validateBaseRender = (title: string, content: string) => { it('should render as expected', () => { - cy.findByTestId(AlertSelector).should('be.visible') - cy.percySnapshot() + cy.findByTestId(AlertSelector).should('be.visible').contains(title) + cy.findByTestId(AlertBody).should('be.visible').contains(content) }) } @@ -198,7 +199,11 @@ describe('', { viewportHeight: 260, defaultCommandTimeout: 1 cy.mountFragment(SpecsListBannersFragmentDoc, { render: (gql) => }) }) - validateBaseRender() + validateBaseRender( + 'Spec not found', + 'It is possible that the file has been moved or deleted. Please choose from the list of specs below.', + ) + validateCloseControl() validateCloseOnPropChange(visible) validateReopenOnPropChange(visible) @@ -216,7 +221,11 @@ describe('', { viewportHeight: 260, defaultCommandTimeout: 1 cy.mountFragment(SpecsListBannersFragmentDoc, { render: (gql) => }) }) - validateBaseRender() + validateBaseRender( + 'No internet connection', + 'Please check your internet connection to resolve this issue. When your internet connection is fixed, we will automatically attempt to fetch the run metrics from Cypress Cloud.', + ) + validateCloseControl() validateCloseOnPropChange(visible) validateReopenOnPropChange(visible) @@ -236,7 +245,11 @@ describe('', { viewportHeight: 260, defaultCommandTimeout: 1 cy.mountFragment(SpecsListBannersFragmentDoc, { render: (gql) => }) }) - validateBaseRender() + validateBaseRender( + 'Lost connection', + `The request timed out or failed when trying to retrieve the recorded run metrics from Cypress Cloud. The information that you're seeing in the table below may be incomplete as a result.`, + ) + validateCloseControl() validateCloseOnPropChange(visible) validateReopenOnPropChange(visible) @@ -264,7 +277,11 @@ describe('', { viewportHeight: 260, defaultCommandTimeout: 1 cy.mountFragment(SpecsListBannersFragmentDoc, { render: (gql) => }) }) - validateBaseRender() + validateBaseRender( + `Couldn't find your project`, + 'We were unable to find an existing project matching the projectId: "test-project-id" set in your Cypress config file. You can reconnect with an existing project or create a new project.', + ) + validateCloseControl() validateCloseOnPropChange(visible) validateReopenOnPropChange(visible) @@ -306,7 +323,11 @@ describe('', { viewportHeight: 260, defaultCommandTimeout: 1 }) }) - validateBaseRender() + validateBaseRender( + 'Request access to project', + 'This is a private project that you do not currently have access to. Please request access from the project owner in order to view the list of runs.', + ) + validateCloseControl() validateCloseOnPropChange(visible) validateReopenOnPropChange(visible) @@ -341,7 +362,11 @@ describe('', { viewportHeight: 260, defaultCommandTimeout: 1 }) }) - validateBaseRender() + validateBaseRender( + 'Request access to project', + `The owner of this project has been notified of your request. We'll notify you via email when your access request has been granted.`, + ) + validateCloseControl() validateCloseOnPropChange(visible) validateReopenOnPropChange(visible) @@ -494,7 +519,11 @@ describe('', { viewportHeight: 260, defaultCommandTimeout: 1 }) }) - validateBaseRender() + validateBaseRender( + 'React component testing is available for this project', + 'You can now use Cypress to develop and test individual components without running your whole application. Generate the config in just a few clicks.', + ) + validateCloseControl() validateSmartNotificationBehaviors(BannerIds.CT_052023_AVAILABLE, 'component-testing-banner', gql) diff --git a/packages/app/src/specs/SpecsListHeader.cy.tsx b/packages/app/src/specs/SpecsListHeader.cy.tsx index 8e19097280ef..dfebe42f731a 100644 --- a/packages/app/src/specs/SpecsListHeader.cy.tsx +++ b/packages/app/src/specs/SpecsListHeader.cy.tsx @@ -79,8 +79,6 @@ describe('', { keystrokeDelay: 0 }, () => { .click() .get('@show-spec-pattern-modal') .should('have.been.called') - - cy.percySnapshot() }) it('shows the count correctly when not searching', () => { @@ -96,17 +94,11 @@ describe('', { keystrokeDelay: 0 }, () => { .should('be.visible') .and('have.attr', 'aria-live', 'polite') - cy.percySnapshot('No matches') - mountWithSpecCount(1) cy.contains('1 match').should('be.visible') - cy.percySnapshot('Singular Match') - mountWithSpecCount(100) cy.contains('100 matches').should('be.visible') - - cy.percySnapshot('Plural Match') }) it('shows the count correctly while searching', () => { @@ -124,7 +116,5 @@ describe('', { keystrokeDelay: 0 }, () => { cy.contains('0 of 1 match').should('be.visible') cy.contains('1 of 1 match').should('be.visible') cy.contains('5 of 22 matches').should('be.visible') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/specs/banners/TrackedBanner.cy.tsx b/packages/app/src/specs/banners/TrackedBanner.cy.tsx index 5242690d656c..655bc41bbd9c 100644 --- a/packages/app/src/specs/banners/TrackedBanner.cy.tsx +++ b/packages/app/src/specs/banners/TrackedBanner.cy.tsx @@ -8,8 +8,6 @@ describe('', () => { cy.findByText('Test Content').should('be.visible') cy.findByTestId('alert-suffix-icon').should('be.visible') - - cy.percySnapshot() }) it('should record when banner is made visible', () => { diff --git a/packages/app/src/specs/flaky-badge/FlakyBadge.cy.tsx b/packages/app/src/specs/flaky-badge/FlakyBadge.cy.tsx index ac170e142170..0dcda8f349b4 100644 --- a/packages/app/src/specs/flaky-badge/FlakyBadge.cy.tsx +++ b/packages/app/src/specs/flaky-badge/FlakyBadge.cy.tsx @@ -10,7 +10,5 @@ describe('', () => { cy.findByTestId(flakyBadgeTestId) .should('have.text', defaultMessages.specPage.flaky.badgeLabel) .and('be.visible') - - cy.percySnapshot() }) }) diff --git a/packages/app/src/specs/flaky-badge/FlakySpecSummary.cy.tsx b/packages/app/src/specs/flaky-badge/FlakySpecSummary.cy.tsx index 79d41b964678..11b9d68ab7b7 100644 --- a/packages/app/src/specs/flaky-badge/FlakySpecSummary.cy.tsx +++ b/packages/app/src/specs/flaky-badge/FlakySpecSummary.cy.tsx @@ -1,66 +1,47 @@ import FlakySpecSummary from './FlakySpecSummary.vue' describe('', () => { - it('low severity', () => { - cy.mount( - , - ) - - cy.percySnapshot() - }) - - it('medium severity', () => { - cy.mount( - , - ) - - cy.percySnapshot() - }) - - it('high severity', () => { - cy.mount( - , - ) - - cy.percySnapshot() - }) - - it('loading state', () => { - // Ensure component handles malformed/incomplete data without blowing up - cy.mount( - , - ) + it('severities', () => { + cy.mount(() => +
+ + + + , +
) cy.findByTestId('flaky-specsummary-loading-1').should('be.visible') - cy.percySnapshot() }) diff --git a/packages/app/src/specs/generators/ExpandableFileList.cy.tsx b/packages/app/src/specs/generators/ExpandableFileList.cy.tsx index 76dc945269a8..cb149bef0e2b 100644 --- a/packages/app/src/specs/generators/ExpandableFileList.cy.tsx +++ b/packages/app/src/specs/generators/ExpandableFileList.cy.tsx @@ -50,7 +50,6 @@ describe('', { viewportHeight: 500, viewportWidth: 400 }, it('correctly formats a difficult file', () => { cy.get('body').contains('[...all]') - cy.percySnapshot() }) }) @@ -74,8 +73,6 @@ describe('', { viewportHeight: 500, viewportWidth: 400 }, )) .get(noResultsSelector).should('be.visible') - cy.percySnapshot() - cy.get('[data-testid=add-file]') .click() .get(noResultsSelector).should('not.exist') diff --git a/packages/app/src/specs/generators/GeneratorSuccess.cy.tsx b/packages/app/src/specs/generators/GeneratorSuccess.cy.tsx index 2b89be603575..b599f125dd75 100644 --- a/packages/app/src/specs/generators/GeneratorSuccess.cy.tsx +++ b/packages/app/src/specs/generators/GeneratorSuccess.cy.tsx @@ -12,7 +12,7 @@ describe('<${spec.baseName} />', () => { it('renders', () => { // https://on.cypress.io/mount mount(<${spec.baseName} />) - }) + }) }) `.trim() @@ -21,8 +21,6 @@ describe('', () => { cy.mount(() => ()) .get('body') .contains(spec.relative) - - cy.percySnapshot() }) it('can be collapsed to hide the content', () => { @@ -34,23 +32,9 @@ describe('', () => { .wait(200) // just to show off the animation .get(targetSelector) .click() - - cy.percySnapshot() - }) - - it('can be expanded to show the content', () => { - cy.mount(() => ()) - .get(targetSelector) - .click() - .click() .get('code .line') .should('be.visible') .should('have.length', content.split('\n').length) - .wait(200) // just to show off the animation - .get(targetSelector) - .click() - - cy.percySnapshot() }) it('handles really long file names and really long content', () => { diff --git a/packages/app/src/specs/generators/component/ReactComponentList.cy.tsx b/packages/app/src/specs/generators/component/ReactComponentList.cy.tsx index 5f3ad5b79ad3..66109c83302d 100644 --- a/packages/app/src/specs/generators/component/ReactComponentList.cy.tsx +++ b/packages/app/src/specs/generators/component/ReactComponentList.cy.tsx @@ -18,8 +18,6 @@ describe('ReactComponentList', () => { cy.mount() cy.contains('No components found').should('be.visible') - - cy.percySnapshot() }) it('renders error state if errored is true', () => { @@ -30,8 +28,6 @@ describe('ReactComponentList', () => { cy.mount() cy.contains('Unable to parse file').should('be.visible') - - cy.percySnapshot() }) it('fetches and displays a list of components', () => { @@ -40,8 +36,6 @@ describe('ReactComponentList', () => { cy.contains('FooBar').should('be.visible') cy.contains('BarFoo').should('be.visible') cy.contains('FooBarBaz').should('be.visible') - - cy.percySnapshot() }) it('calls selectItem on click', () => { diff --git a/packages/frontend-shared/src/components/Alert.cy.tsx b/packages/frontend-shared/src/components/Alert.cy.tsx index 0107736697cf..57f9c9133d21 100644 --- a/packages/frontend-shared/src/components/Alert.cy.tsx +++ b/packages/frontend-shared/src/components/Alert.cy.tsx @@ -38,18 +38,6 @@ const prefixIcon = () => const suffixIcon = () => describe('', () => { - describe('classes', () => { - it('can change the text and background color for the alert', () => { - cy.mount(() => - (
- test - test -
)) - - cy.percySnapshot() - }) - }) - describe('title', () => { it('can accept slot as title slot', () => { cy.mount(() => (', () => { }) }) -describe('playground', () => { - it('renders', () => { +describe('', () => { + it('renders various alerts with customizations', () => { const { modelValue, methods } = makeDismissibleProps() cy.mount(() => { @@ -259,11 +247,12 @@ describe('playground', () => { {...methods}>Close me, please! A notice. Default alert + test + test ) }) - cy.contains('Coffee, please').should('be.visible') cy.percySnapshot() }) }) diff --git a/packages/frontend-shared/src/components/Card.cy.tsx b/packages/frontend-shared/src/components/Card.cy.tsx index 4d99fc204ac9..3dc38227555b 100644 --- a/packages/frontend-shared/src/components/Card.cy.tsx +++ b/packages/frontend-shared/src/components/Card.cy.tsx @@ -53,13 +53,16 @@ describe('Card', { viewportHeight: 400 }, () => { // health check that expected icons and hover icons are present in the dom cy.get('svg').should('have.length', 4) - cy.percySnapshot('both cards unfocused') + // cy.percySnapshot('both cards unfocused') TODO: Find out why focus state is not capptured in Percy. + cy.get('@e2eTitle').should('not.be.focused') cy.get('@e2eTitle').focus() - cy.percySnapshot('card-1 focused') + cy.get('@e2eTitle').should('be.focused') + // cy.percySnapshot('card-1 focused') TODO: Find out why focus state is not capptured in Percy. cy.get('@ctTitle').focus() - cy.percySnapshot('card-2 focused') + cy.get('@ctTitle').should('be.focused') + // cy.percySnapshot('card-2 focused') TODO: Find out why focus state is not capptured in Percy. // clicks work on card or button cy.get('[data-cy="card"]').eq(0).click() diff --git a/packages/frontend-shared/src/components/CopyText.cy.tsx b/packages/frontend-shared/src/components/CopyText.cy.tsx index fe123d718e06..7f977c592184 100644 --- a/packages/frontend-shared/src/components/CopyText.cy.tsx +++ b/packages/frontend-shared/src/components/CopyText.cy.tsx @@ -11,7 +11,6 @@ describe('', () => { cy.contains('button', defaultMessages.clipboard.copy) .should('be.visible') - .percySnapshot() }) it('overflows nicely', { viewportWidth: 800, viewportHeight: 120 }, () => { diff --git a/packages/frontend-shared/src/components/InlineCodeFragment.cy.tsx b/packages/frontend-shared/src/components/InlineCodeFragment.cy.tsx index f51be1eeec31..34e2b3a50f49 100644 --- a/packages/frontend-shared/src/components/InlineCodeFragment.cy.tsx +++ b/packages/frontend-shared/src/components/InlineCodeFragment.cy.tsx @@ -6,6 +6,5 @@ describe('', () => { cy.contains('I am code') .should('be.visible') - .percySnapshot() }) }) diff --git a/packages/frontend-shared/src/components/NoInternetConnection.cy.tsx b/packages/frontend-shared/src/components/NoInternetConnection.cy.tsx index 0f754a45dc4c..29254a49bdb1 100644 --- a/packages/frontend-shared/src/components/NoInternetConnection.cy.tsx +++ b/packages/frontend-shared/src/components/NoInternetConnection.cy.tsx @@ -16,7 +16,5 @@ describe('', () => { cy.log('Mount with slot content') cy.mount(() => Extra Text ) cy.contains('Extra Text').should('be.visible') - - cy.percySnapshot() }) }) diff --git a/packages/frontend-shared/src/components/ResultCounts.cy.tsx b/packages/frontend-shared/src/components/ResultCounts.cy.tsx index ba90959bf169..5c295b76732e 100644 --- a/packages/frontend-shared/src/components/ResultCounts.cy.tsx +++ b/packages/frontend-shared/src/components/ResultCounts.cy.tsx @@ -21,8 +21,6 @@ describe('', () => { validateResult(defaultMessages.runs.results.pending, 3) validateResult(defaultMessages.runs.results.passed, 2) validateResult(defaultMessages.runs.results.failed, 1) - - cy.percySnapshot() }) it('renders zero contents', () => { @@ -38,8 +36,6 @@ describe('', () => { validateResult(defaultMessages.runs.results.pending, 0) validateResult(defaultMessages.runs.results.passed, 0) validateResult(defaultMessages.runs.results.failed, 0) - - cy.percySnapshot() }) it('renders string range values', () => { @@ -55,8 +51,6 @@ describe('', () => { validateResult(defaultMessages.runs.results.pending, '5-5') validateResult(defaultMessages.runs.results.passed, '2-20') validateResult(defaultMessages.runs.results.failed, '1-2') - - cy.percySnapshot() }) it('changes order of status signs with the order prop', () => { diff --git a/packages/frontend-shared/src/components/ShikiHighlight.cy.tsx b/packages/frontend-shared/src/components/ShikiHighlight.cy.tsx index 91dd22e7b221..509e0886849e 100644 --- a/packages/frontend-shared/src/components/ShikiHighlight.cy.tsx +++ b/packages/frontend-shared/src/components/ShikiHighlight.cy.tsx @@ -42,7 +42,6 @@ describe('', { viewportWidth: 800, viewportHeight: 500 }, () => )) cy.contains(devServerCode).should('be.visible') - cy.percySnapshot() }) it('trims whitespace to show the correct number of lines', { viewportWidth: 500, viewportHeight: 500 }, () => { @@ -83,24 +82,21 @@ describe('', { viewportWidth: 800, viewportHeight: 500 }, () => it('render the code without arguments', () => { cy.mount(() =>
) cy.get('.shiki').should('be.visible') - cy.percySnapshot() - }) - - it('display inline and remove some of the padding when "inline"', { viewportWidth: 300, viewportHeight: 100 }, () => { - cy.mount(() => ) - cy.get('.shiki').should('be.visible') + cy.contains(code) cy.percySnapshot() }) it('show line numbers when the prop is passed', () => { cy.mount(() =>
) cy.get('.shiki').should('be.visible') + cy.contains(code) cy.percySnapshot() }) it('show line numbers with initial line when the prop is passed', () => { cy.mount(() =>
) cy.get('.shiki').should('be.visible') + cy.contains(code) cy.percySnapshot() }) @@ -113,26 +109,22 @@ describe('', { viewportWidth: 800, viewportHeight: 500 }, () => it('should render when specified "true"', () => { cy.mount(() =>
) cy.get('button').should('be.visible') - cy.percySnapshot() + cy.contains(code) }) it('should remain visible when content becomes scrollable', () => { cy.mount(() =>
) cy.get('button').validateWithinViewport() - cy.percySnapshot('copy button initially within viewport') - cy.scrollTo('bottom', { duration: 100 }) .get('button') .validateWithinViewport() - cy.percySnapshot('copy button remains within viewport on scroll down') - cy.scrollTo('top', { duration: 100 }) .get('button') .validateWithinViewport() - cy.percySnapshot('copy button remains within viewport on scroll up') + cy.contains(code) }) }) }) diff --git a/packages/frontend-shared/src/components/ShikiHighlight.vue b/packages/frontend-shared/src/components/ShikiHighlight.vue index 434a6ba20b3a..39d2aa0f28a9 100644 --- a/packages/frontend-shared/src/components/ShikiHighlight.vue +++ b/packages/frontend-shared/src/components/ShikiHighlight.vue @@ -1,8 +1,7 @@