Skip to content

Commit

Permalink
Remove onbeforeunload callback in test
Browse files Browse the repository at this point in the history
- Implements a workaround described here: cypress-io/cypress#2118
  • Loading branch information
zifgu committed Jul 14, 2022
1 parent 391d060 commit d5a8379
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ jobs:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG: 'cypress:server:*'
DEBUG: 'cypress:server:reporter, cypress:server:util:process_profiler'
24 changes: 16 additions & 8 deletions templates/vue/cypress/integration/import-export-zip.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ describe("Import Export Zip Files", () => {
.should("have.length", 3)
cy.task("log", "Line 28")

// cy.contains("button", /confirm/i).click()
// cy.task("log", "Line 31")
// cy.wait("@load")
// cy.task("log", "Line 33")
cy.window().then(win => {
win.onbeforeunload = null
})

cy.contains("button", /confirm/i).click()
cy.task("log", "Line 31")
cy.wait("@load")
cy.task("log", "Line 33")

cy.getByTestId("tapestry-loading").should("not.exist")
cy.task("log", "Line 36")
Expand Down Expand Up @@ -72,10 +76,14 @@ describe("Import Export Zip Files", () => {
.should("have.length", 5)
cy.task("log", "Line 73")

// cy.contains("button", /confirm/i).click()
// cy.task("log", "Line 76")
// cy.wait("@load")
// cy.task("log", "Line 78")
cy.window().then(win => {
win.onbeforeunload = null
})

cy.contains("button", /confirm/i).click()
cy.task("log", "Line 76")
cy.wait("@load")
cy.task("log", "Line 78")

cy.getByTestId("tapestry-loading").should("not.exist")
cy.task("log", "Line 81")
Expand Down

0 comments on commit d5a8379

Please sign in to comment.