test: fix percy flake for 'loading tests' display (#14254)

Co-authored-by: Chris Breiding <chrisbreiding@gmail.com>
This commit is contained in:
Jennifer Shehane
2020-12-21 21:35:31 +06:30
committed by GitHub
parent 26167211f9
commit 68a4016d6b
4 changed files with 8 additions and 9 deletions

View File

@@ -48,13 +48,6 @@ describe('commands', () => {
it('displays all the commands', () => {
cy.get('.command').should('have.length', 9)
// ensure progress bar is no longer visible
// for snapshot
cy.contains('#in-progress')
.closest('.command')
.find('.command-progress span')
.should('not.be.visible')
cy.percySnapshot()
})

View File

@@ -44,6 +44,8 @@ describe('runnables', () => {
it('displays loader when runnables have not yet loaded', () => {
render()
cy.contains('Your tests are loading...').should('be.visible')
// ensure the page is loaded before taking snapshot
cy.get('.focus-tests-text').should('be.visible')
cy.percySnapshot()
})

View File

@@ -1,4 +1,8 @@
// @ts-ignore
import installCustomPercyCommand from '@packages/ui-components/cypress/support/customPercyCommand'
installCustomPercyCommand()
installCustomPercyCommand({
elementOverrides: {
'.command-progress': true,
},
})

View File

@@ -283,8 +283,8 @@ describe('runner/cypress retries.ui.spec', { viewportWidth: 600, viewportHeight:
} }, { config: { retries: 1 } })
.then(shouldHaveTestResults(0, 1, 0))
// ensure the page is loaded before taking snapshot
cy.contains('skips this')
cy.percySnapshot()
})
})