Skip to content

Commit

Permalink
chore: bump timeout for Angular webpack-dev-server tests (#24231)
Browse files Browse the repository at this point in the history
  • Loading branch information
astone123 committed Oct 12, 2022
1 parent 1e94afc commit b7213c9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions npm/webpack-dev-server/cypress/e2e/angular.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for (const project of WEBPACK_REACT) {
it('should mount a passing test', () => {
cy.visitApp()
cy.contains('app.component.cy.ts').click()
cy.waitForSpecToFinish({ passCount: 1 })
cy.waitForSpecToFinish({ passCount: 1 }, 60000)

cy.get('li.command').first().within(() => {
cy.get('.command-method').should('contain', 'mount')
Expand All @@ -33,7 +33,7 @@ for (const project of WEBPACK_REACT) {
it('should live-reload on src changes', () => {
cy.visitApp()
cy.contains('app.component.cy.ts').click()
cy.waitForSpecToFinish({ passCount: 1 })
cy.waitForSpecToFinish({ passCount: 1 }, 60000)

cy.withCtx(async (ctx) => {
await ctx.actions.file.writeFileInProject(
Expand All @@ -42,7 +42,7 @@ for (const project of WEBPACK_REACT) {
)
})

cy.waitForSpecToFinish({ failCount: 1 })
cy.waitForSpecToFinish({ failCount: 1 }, 60000)

cy.withCtx(async (ctx) => {
await ctx.actions.file.writeFileInProject(
Expand All @@ -51,14 +51,14 @@ for (const project of WEBPACK_REACT) {
)
})

cy.waitForSpecToFinish({ passCount: 1 })
cy.waitForSpecToFinish({ passCount: 1 }, 60000)
})

it('should show compilation errors on src changes', () => {
cy.visitApp()

cy.contains('app.component.cy.ts').click()
cy.waitForSpecToFinish({ passCount: 1 })
cy.waitForSpecToFinish({ passCount: 1 }, 60000)

// Create compilation error
cy.withCtx(async (ctx) => {
Expand All @@ -71,7 +71,7 @@ for (const project of WEBPACK_REACT) {
})

// The test should fail and the stack trace should appear in the command log
cy.waitForSpecToFinish({ failCount: 1 })
cy.waitForSpecToFinish({ failCount: 1 }, 60000)
cy.contains('The following error originated from your test code, not from Cypress.').should('exist')
cy.get('.test-err-code-frame').should('be.visible')
})
Expand All @@ -88,7 +88,7 @@ for (const project of WEBPACK_REACT) {
})

cy.contains('new.component.cy.ts').click()
cy.waitForSpecToFinish({ passCount: 1 })
cy.waitForSpecToFinish({ passCount: 1 }, 60000)
})
})
}
2 changes: 1 addition & 1 deletion npm/webpack-dev-server/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ declare global {
* 3. Waits (with a timeout of 30s) for the Rerun all tests button to be present. This ensures all tests have completed
*
*/
waitForSpecToFinish(expectedResults?: ExpectedResults): void
waitForSpecToFinish(expectedResults?: ExpectedResults, timeout?: number): void
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/app/cypress/e2e/support/execute-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ declare global {
* 3. Waits (with a timeout of 30s) for the Rerun all tests button to be present. This ensures all tests have completed
*
*/
waitForSpecToFinish(expectedResults?: ExpectedResults): void
waitForSpecToFinish(expectedResults?: ExpectedResults, timeout?: number): void
}
}
}

// 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) => {
export const waitForSpecToFinish = (expectedResults, timeout?: number) => {
// First ensure the test is loaded
cy.get('.passed > .num').should('contain', '--')
cy.get('.failed > .num').should('contain', '--')

// Then ensure the tests are running
cy.contains('Your tests are loading...', { timeout: 20000 }).should('not.exist')
cy.contains('Your tests are loading...', { timeout: timeout || 20000 }).should('not.exist')

// Then ensure the tests have finished
cy.get('[aria-label="Rerun all tests"]', { timeout: 30000 })
cy.get('[aria-label="Rerun all tests"]', { timeout: timeout || 30000 })

if (expectedResults) {
shouldHaveTestResults(expectedResults)
Expand Down

5 comments on commit b7213c9

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b7213c9 Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.10.1/linux-x64/develop-b7213c9bf03b0d2974ff83a52b2d7b1dfe6bba0c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b7213c9 Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.10.1/linux-arm64/develop-b7213c9bf03b0d2974ff83a52b2d7b1dfe6bba0c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b7213c9 Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.10.1/darwin-x64/develop-b7213c9bf03b0d2974ff83a52b2d7b1dfe6bba0c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b7213c9 Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.10.1/win32-x64/develop-b7213c9bf03b0d2974ff83a52b2d7b1dfe6bba0c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b7213c9 Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.10.1/darwin-arm64/develop-b7213c9bf03b0d2974ff83a52b2d7b1dfe6bba0c/cypress.tgz

Please sign in to comment.