Skip to content

Commit

Permalink
chore: remove low value percy snapshots (#26934)
Browse files Browse the repository at this point in the history
* chore: remove low value percy snapshots

* chore: remove more low value percy snapshots [run ci]

* chore: remove more low value percy snapshots

* remove additional snapshots

* reduce snapshots

* fix types

---------

Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
  • Loading branch information
jordanpowell88 and lmiller1990 committed Jun 7, 2023
1 parent ee72148 commit 2263bc5
Show file tree
Hide file tree
Showing 92 changed files with 367 additions and 516 deletions.
14 changes: 9 additions & 5 deletions packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand All @@ -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')

Expand All @@ -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')

Expand Down
14 changes: 9 additions & 5 deletions packages/app/cypress/e2e/cypress-in-cypress-e2e.cy.ts
Original file line number Diff line number Diff line change
@@ -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 }, () => {
Expand Down Expand Up @@ -28,22 +28,25 @@ 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')

cy.get('[data-cy="viewport"]').click()
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')

Expand All @@ -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')

Expand Down
6 changes: 0 additions & 6 deletions packages/app/cypress/e2e/runner/cloud-debug-filter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
Expand Down
12 changes: 7 additions & 5 deletions packages/app/src/components/Blank.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand All @@ -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()
})
})
2 changes: 0 additions & 2 deletions packages/app/src/components/SpecPatterns.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ describe('<SpecPatterns />', () => {

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', () => {
Expand Down
25 changes: 8 additions & 17 deletions packages/app/src/debug/DebugContainer.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,67 +169,58 @@ describe('<DebugContainer />', () => {
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()
})
})

context('no tests', () => {
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()
})
})

context('timed out', () => {
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')
})
})
Expand Down
4 changes: 0 additions & 4 deletions packages/app/src/debug/DebugFailedTest.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ describe('<DebugFailedTest/>', () => {
.and('match', /utm_campaign/)
.and('match', /utm_source/)
})

cy.percySnapshot()
})

it('contains multiple titleParts segments', { viewportWidth: 1200 }, () => {
Expand All @@ -139,8 +137,6 @@ describe('<DebugFailedTest/>', () => {
))

assertRowContents(multipleTitleParts)

cy.percySnapshot()
})

it('tests multiple groups', { viewportWidth: 1200 }, () => {
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/debug/DebugPageHeader.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ describe('<DebugPageHeader />', {
})

cy.findByTestId(`debug-runNumber-${status}`).should('be.visible')
cy.percySnapshot()
})
})

Expand Down
4 changes: 0 additions & 4 deletions packages/app/src/debug/DebugPendingRunCounts.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ describe('<DebugPendingRunCounts />', () => {
)

cy.contains('2 of 20').should('be.visible')

cy.percySnapshot()
})

it('renders counts of zeros input is undefined', () => {
Expand All @@ -21,7 +19,5 @@ describe('<DebugPendingRunCounts />', () => {
)

cy.contains('0 of 0').should('be.visible')

cy.percySnapshot()
})
})
7 changes: 2 additions & 5 deletions packages/app/src/debug/DebugPendingRunSplash.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ describe('<DebugPendingRunSplash />', () => {
it('renders as expected', () => {
cy.mount(<DebugPendingRunSplash/>)

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', () => {
cy.mount(<DebugPendingRunSplash isCompletionScheduled={true}/>)

cy.contains('Scheduled to complete...')
cy.findByTestId('splash-subtitle').should('not.exist')

cy.percySnapshot()
})
})
2 changes: 0 additions & 2 deletions packages/app/src/debug/DebugResults.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ describe('<DebugResults />', () => {
cy.get(`[title=${defaultMessages.runs.results.pending}]`).should('contain.text', cloudRun.totalPending)
})
})

cy.percySnapshot()
})
})

Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/debug/DebugRunNavigation.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@ describe('<DebugRunNavigation />', () => {

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', () => {
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/debug/DebugRunNavigationLimitMessage.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ describe('DebugRunNavigationLimitMessage', () => {
cy.mount(<DebugRunNavigationLimitMessage cloudProjectUrl="https://cloud.cypress.io/projects/ypt4pf/" />)

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', () => {
Expand Down
Loading

5 comments on commit 2263bc5

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 2263bc5 Jun 7, 2023

Choose a reason for hiding this comment

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

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.14.1/linux-arm64/develop-2263bc511806fba4ba6f6baea857efdd2de687d3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 2263bc5 Jun 7, 2023

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.14.1/linux-x64/develop-2263bc511806fba4ba6f6baea857efdd2de687d3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 2263bc5 Jun 7, 2023

Choose a reason for hiding this comment

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

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.14.1/darwin-x64/develop-2263bc511806fba4ba6f6baea857efdd2de687d3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 2263bc5 Jun 7, 2023

Choose a reason for hiding this comment

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

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.14.1/win32-x64/develop-2263bc511806fba4ba6f6baea857efdd2de687d3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 2263bc5 Jun 8, 2023

Choose a reason for hiding this comment

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

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.14.1/darwin-arm64/develop-2263bc511806fba4ba6f6baea857efdd2de687d3/cypress.tgz

Please sign in to comment.