forked from MarketSquare/robotframework-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle multiple alerts with one promise
Fixes MarketSquare#3785
- Loading branch information
Showing
7 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Multiple alerts issue - example</title> | ||
</head> | ||
<body> | ||
<button id="alerts" onclick="showAlerts()">Click to show alerts</button><br><br> | ||
<button id="confirmAndPromt" onclick="showConfirmAndPromt()">Click to confirm and prompt</button> | ||
<p id="confirm"></p> | ||
<p id="prompt"></p> | ||
<script> | ||
function showConfirmAndPromt() { | ||
let trueFalse = confirm("First alert accepted?"); | ||
let input = prompt("Input in second alert!"); | ||
if (trueFalse) { | ||
document.getElementById("confirm").innerText = "First alert accepted!"; | ||
} else { | ||
document.getElementById("confirm").innerText = "First alert declined!"; | ||
} | ||
if (input) { | ||
document.getElementById("prompt").innerText = "Second alert input: " + input; | ||
} else { | ||
document.getElementById("prompt").innerText = "Second alert input: no input"; | ||
} | ||
} | ||
function showAlerts() { | ||
alert("First alert!"); | ||
alert("Second alert!"); | ||
} | ||
</script> | ||
</body> | ||
</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
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