Skip to content

Commit

Permalink
chore: remove low value percy snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanpowell88 committed Jun 6, 2023
1 parent d610c51 commit 3312059
Show file tree
Hide file tree
Showing 43 changed files with 65 additions and 143 deletions.
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
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
16 changes: 8 additions & 8 deletions packages/app/src/debug/DebugContainer.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,40 +169,40 @@ 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()
})
})

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

assertRowContents(multipleTitleParts)

cy.percySnapshot()
})

it('tests multiple groups', { viewportWidth: 1200 }, () => {
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
7 changes: 2 additions & 5 deletions packages/app/src/debug/DebugSpecLimitBanner.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ describe('<DebugSpecLimitBanner />', () => {
.and('match', /utm_campaign/)
.and('match', /utm_source/)

cy.viewport(1000, 400)
cy.percySnapshot('large viewport')

cy.viewport(600, 400)
cy.percySnapshot('small viewport')
})
Expand All @@ -34,8 +31,8 @@ describe('<DebugSpecLimitBanner />', () => {
/>
))

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()
})
})
2 changes: 0 additions & 2 deletions packages/app/src/debug/GroupedDebugFailedTest.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,5 @@ describe('<GroupedDebugFailedTest/>', () => {
cy.findByTestId('debug-artifacts').should('be.visible').children().should('have.length', 3)
cy.findByTestId('stats-metadata').children().should('have.length', 3)
}))

cy.percySnapshot()
})
})
2 changes: 0 additions & 2 deletions packages/app/src/debug/LayeredBrowserIcons.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,5 @@ describe('<LayeredBrowserIcons/>', () => {
cy.get('@allIcons').each((ele) => {
cy.wrap(ele).find('svg').should('exist')
})

cy.percySnapshot()
})
})
11 changes: 8 additions & 3 deletions packages/app/src/navigation/SidebarNavigation.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -109,7 +111,10 @@ describe('SidebarNavigation', () => {
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', () => {
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/navigation/SidebarNavigationHeader.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -26,6 +25,5 @@ describe('SidebarNavigationHeader', () => {

cy.get('[data-cy="testing-type-component"]').should('exist')
cy.contains('test-project')
cy.percySnapshot()
})
})
5 changes: 4 additions & 1 deletion packages/app/src/runner/SpecRunnerHeaderOpenMode.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ describe('AutomationDisconnected', () => {
it('should relaunch browser', () => {
cy.mount(<AutomationDisconnected />)

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()

Expand Down
5 changes: 4 additions & 1 deletion packages/app/src/runner/automation/AutomationMissing.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
3 changes: 0 additions & 3 deletions packages/app/src/runs/RunsConnectSuccessAlert.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ describe('<RunConnectSuccessAlert />', { viewportHeight: 400 }, () => {
)
},
})

cy.viewport(1000, 800)
cy.percySnapshot()
})
})
})
8 changes: 3 additions & 5 deletions packages/app/src/settings/SettingsContainer.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ describe('<SettingsContainer />', { 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', () => {
Expand All @@ -20,7 +21,6 @@ describe('<SettingsContainer />', { 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')
Expand All @@ -32,7 +32,6 @@ describe('<SettingsContainer />', { 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()

Expand All @@ -43,7 +42,6 @@ describe('<SettingsContainer />', { 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')
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/settings/SettingsSection.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,5 @@ describe('<SettingsSection />', () => {
.get('h1').should('contain.text', title)
.get('p').should('contain.text', description)
.get('code').should('contain.text', code)

cy.percySnapshot()
})
})
2 changes: 1 addition & 1 deletion packages/app/src/settings/project/CloudSettings.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ describe('<CloudSettings />', () => {

cy.findByText(defaultMessages.settingsPage.recordKey.title).should('not.exist')

cy.percySnapshot()
cy.get('button').contains('Connect to Cypress Cloud')
})
})
2 changes: 0 additions & 2 deletions packages/app/src/settings/project/CodeBox.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ describe('<CodeBox/>', () => {
</div>))

cy.findByText('123456789').should('be.visible')
cy.percySnapshot()
})

it('renders the confidential', () => {
Expand All @@ -21,7 +20,6 @@ describe('<CodeBox/>', () => {
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', () => {
Expand Down
3 changes: 0 additions & 3 deletions packages/app/src/settings/project/Config.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ describe('<Config/>', { 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', () => {
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/settings/project/ExperimentRow.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,5 @@ describe('<ExperimentRow />', () => {
cy.findByText(expDisabled.description).should('be.visible')
cy.findByText(expDisabled.key).should('be.visible')
})

cy.percySnapshot()
})
})
2 changes: 0 additions & 2 deletions packages/app/src/settings/project/Experiments.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,5 @@ describe('<Experiments />', { viewportWidth: 800, viewportHeight: 600 }, () => {
cy.contains(`[data-cy="experiment-${exp.field}"]`, expName)
.should('contain', exp.value ? 'Enabled' : 'Disabled')
})

cy.percySnapshot()
})
})
2 changes: 0 additions & 2 deletions packages/app/src/settings/project/ProjectId.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ describe('<ProjectId />', () => {

cy.findByText(givenProjectId).should('be.visible')
cy.findByText('Copy')

cy.percySnapshot()
})
})
2 changes: 0 additions & 2 deletions packages/app/src/settings/project/ProjectSettings.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ describe('<ProjectSettings />', () => {
})

cy.findByText(defaultMessages.settingsPage.experiments.title).should('be.visible')

cy.percySnapshot()
})
})
2 changes: 0 additions & 2 deletions packages/app/src/settings/project/RecordKey.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,5 @@ describe('<RecordKey />', () => {
cy.contains('button', defaultMessages.clipboard.copy)
.should('be.visible')
.and('not.be.disabled')

cy.percySnapshot()
})
})
2 changes: 0 additions & 2 deletions packages/app/src/settings/project/SpecPatterns.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,5 @@ describe('<SpecPatterns />', () => {
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()
})
})
Loading

0 comments on commit 3312059

Please sign in to comment.