From aeaae33c61a1accdcf0198d9b7dc08d68e6b693d Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Tue, 8 Nov 2022 12:32:22 +1000 Subject: [PATCH] conditionally skip flaky test on windows --- packages/app/cypress/e2e/runs.cy.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/app/cypress/e2e/runs.cy.ts b/packages/app/cypress/e2e/runs.cy.ts index 263a65218663..fb19f6a83045 100644 --- a/packages/app/cypress/e2e/runs.cy.ts +++ b/packages/app/cypress/e2e/runs.cy.ts @@ -848,9 +848,10 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { }) }) + const RUNNING_COUNT = 3 + describe('refetching', () => { let obj: {toCall?: Function} = {} - const RUNNING_COUNT = 3 beforeEach(() => { cy.scaffoldProject('component-tests') @@ -874,7 +875,7 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { const setTimeout = win.setTimeout // @ts-expect-error - win.setTimeout = function (fn, time) { + win.setTimeout = function (fn: () => void, time: number) { if (fn.name === 'fetchNewerRuns') { obj.toCall = fn } else { @@ -885,7 +886,9 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { }) }) - it('should re-query for executing runs', () => { + const itSkipIfWindows = Cypress.platform === 'win32' ? it.skip : it + + itSkipIfWindows('should re-query for executing runs', () => { cy.get('[data-cy="run-card-icon-RUNNING"]').should('have.length', RUNNING_COUNT).should('be.visible') cy.remoteGraphQLIntercept(async (obj) => { @@ -918,7 +921,7 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { completeNext(1) }) - it('should fetch newer runs and maintain them when navigating', () => { + itSkipIfWindows('should fetch newer runs and maintain them when navigating', () => { cy.get('[data-cy="run-card-icon-RUNNING"]').should('have.length', RUNNING_COUNT).should('be.visible') cy.remoteGraphQLIntercept(async (obj) => {