-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use win.destroy to destroy Electron windows, log more events (#5603)
* Use win.destroy to destroy windows, log more events * fix test * Add tests for onbeforeunload, beforeunload exiting successfully * add window.open beforeunload tests * beforeunload, not beforeload * just destroy those child windows
- Loading branch information
1 parent
9aeadbd
commit f5b0909
Showing
8 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/driver/test/cypress/fixtures/blocking_beforeunload_event.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
|
||
<script> | ||
window.addEventListener('beforeunload', function (e) { | ||
e.preventDefault(); | ||
e.returnValue = 'Dialog'; | ||
return; | ||
}) | ||
</script> |
9 changes: 9 additions & 0 deletions
9
packages/driver/test/cypress/fixtures/blocking_onbeforeunload.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
|
||
<script> | ||
window.onbeforeunload = function (e) { | ||
e.preventDefault(); | ||
e.returnValue = 'Dialog'; | ||
return; | ||
} | ||
</script> |
3 changes: 3 additions & 0 deletions
3
packages/driver/test/cypress/integration/e2e/abort_beforeunload_event_child_spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
it('will exit even if an beforeload event dialog is present in a child window', function () { | ||
cy.window().invoke('open', '/fixtures/blocking_beforeunload_event.html') | ||
}) |
3 changes: 3 additions & 0 deletions
3
packages/driver/test/cypress/integration/e2e/abort_beforeunload_event_spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
it('will exit even if an beforeload event dialog is present', function () { | ||
cy.visit('/fixtures/blocking_beforeunload_event.html') | ||
}) |
3 changes: 3 additions & 0 deletions
3
packages/driver/test/cypress/integration/e2e/abort_onbeforeunload_child_spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
it('will exit even if an onbeforeunload dialog is present in a child window', function () { | ||
cy.window().invoke('open', '/fixtures/blocking_onbeforeunload.html') | ||
}) |
3 changes: 3 additions & 0 deletions
3
packages/driver/test/cypress/integration/e2e/abort_onbeforeunload_spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
it('will exit even if an onbeforeunload dialog is present', function () { | ||
cy.visit('/fixtures/blocking_onbeforeunload.html') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f5b0909
There was a problem hiding this comment.
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.You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom
CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.f5b0909
There was a problem hiding this comment.
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.You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom
CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.f5b0909
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppVeyor has built the
win32 x64
version of the Test Runner.You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom
CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.f5b0909
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppVeyor has built the
win32 ia32
version of the Test Runner.You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom
CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.