Skip to content

Commit 3617aaf

Browse files
authored
fix: reduce Percy flake (#25185)
* fix: try to fix Percy flake [run ci] * empty commit because Percy
1 parent 841c409 commit 3617aaf

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

packages/app/cypress/e2e/runner/support/snapshot-reporter.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ export const snapshotReporter = () => {
1313
'[data-cy=reporter-panel]': ($el) => {
1414
$el.attr('style', 'width: 450px !important')
1515
},
16+
'[data-cy=reporter-running-icon]': ($el) => {
17+
// remove 'fa-spin' class so that the icon is not animated
18+
$el.attr('class', '')
19+
},
20+
'.command-progress': ($el) => {
21+
// don't display command progress bar in snapshot
22+
$el.attr('style', 'display: none !important')
23+
},
1624
},
1725
})
1826
}

packages/launchpad/cypress/e2e/migration.cy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ describe('Opening unmigrated project', () => {
170170
cy.contains(cy.i18n.majorVersionWelcome.title).should('not.exist')
171171
cy.contains('h1', `Migrating to Cypress ${Cypress.version.split('.')[0]}`).should('be.visible')
172172

173+
// Wait for migration prompt to load before taking a snapshot
174+
cy.get('.spinner').should('not.exist')
175+
173176
cy.percySnapshot()
174177
})
175178
})

packages/reporter/src/commands/command.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const shouldShowCount = (aliasesWithDuplicates: Array<Alias> | null, aliasName:
7979
const NavColumns = observer(({ model, isPinned, toggleColumnPin }) => (
8080
<>
8181
<div className='command-number-column' onClick={toggleColumnPin}>
82-
{model._isPending() && <RunningIcon className='fa-spin' />}
82+
{model._isPending() && <RunningIcon data-cy="reporter-running-icon" className='fa-spin' />}
8383
{(!model._isPending() && isPinned) && <PinIcon className='command-pin' />}
8484
{(!model._isPending() && !isPinned) && model.number}
8585
</div>

0 commit comments

Comments
 (0)