From 5cca59a2497eeefaaa61bee9491e5297ade0066a Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Tue, 8 Nov 2022 10:37:52 +1000 Subject: [PATCH] try fixing some flake --- .../e2e/runner/reporter-ct-mount-hover.cy.ts | 4 ++-- .../app/cypress/e2e/support/execute-spec.ts | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/app/cypress/e2e/runner/reporter-ct-mount-hover.cy.ts b/packages/app/cypress/e2e/runner/reporter-ct-mount-hover.cy.ts index b0c68d9f44ae..f15912613c41 100644 --- a/packages/app/cypress/e2e/runner/reporter-ct-mount-hover.cy.ts +++ b/packages/app/cypress/e2e/runner/reporter-ct-mount-hover.cy.ts @@ -25,7 +25,7 @@ for (const { projectName, test } of PROJECTS) { cy.startAppServer('component') cy.visitApp() cy.contains(`${test}`).click() - cy.waitForSpecToFinish({}, 30000) + cy.waitForSpecToFinish(undefined) cy.get('.collapsible-header-inner:first').click().get('.command.command-name-mount > .command-wrapper').click().then(() => { cy.get('iframe.aut-iframe').its('0.contentDocument.body').then(cy.wrap).within(() => { cy.get('[data-cy-root]').children().should('have.length.at.least', 1) @@ -36,7 +36,7 @@ for (const { projectName, test } of PROJECTS) { cy.startAppServer('component') cy.visitApp() cy.contains(`${test}`).click() - cy.waitForSpecToFinish({}, 30000) + cy.waitForSpecToFinish(undefined) cy.get('.command.command-name-mount > .command-wrapper').click().then(() => { if (`${projectName}` === 'angular-14') { cy.get('iframe.aut-iframe').its('0.contentDocument.body').children().should('have.length.at.least', 2) diff --git a/packages/app/cypress/e2e/support/execute-spec.ts b/packages/app/cypress/e2e/support/execute-spec.ts index 2067bc030b57..8acede21355b 100644 --- a/packages/app/cypress/e2e/support/execute-spec.ts +++ b/packages/app/cypress/e2e/support/execute-spec.ts @@ -1,7 +1,6 @@ import { shouldHaveTestResults } from '../runner/support/spec-loader' -export interface ExpectedResults -{ +export interface ExpectedResults { passCount?: number failCount?: number pendingCount?: number @@ -23,13 +22,10 @@ declare global { } } -// Here we export the function with no intention to import it -// This only tells the typescript type checker that this definitely is a module -// This way, we are allowed to use the global namespace declaration -export const waitForSpecToFinish = (expectedResults, timeout?: number) => { +const waitForSpecToFinish = (expectedResults, timeout?: number) => { // First ensure the test is loaded - cy.get('.passed > .num').should('contain', '--') - cy.get('.failed > .num').should('contain', '--') + cy.get('.passed > .num').should('exist') + cy.get('.failed > .num').should('exist') // Then ensure the tests are running cy.contains('Your tests are loading...', { timeout: timeout || 20000 }).should('not.exist') @@ -43,3 +39,8 @@ export const waitForSpecToFinish = (expectedResults, timeout?: number) => { } Cypress.Commands.add('waitForSpecToFinish', waitForSpecToFinish) + +// Here we export an empty object to tell the +// typescript type checker that this definitely is a module. +// This way, we are allowed to use the global namespace declaration +export {}