New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Dismiss Alert tests for WPT wdspec tests #7353
Implement Dismiss Alert tests for WPT wdspec tests #7353
Conversation
Build PENDINGStarted: None Failing Jobs
View more information about this build on: |
Testing webdriver dismiss alert spec. |
|
||
def test_dismiss_confirm(session): | ||
# 18.1 step 3 | ||
session.execute_script("window.confirm(\"Hello\");") |
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.
window.confirm
returns a boolean based on whether it is accepted or dismissed. You should store that value on the window global and validate it.
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.
fixed
|
||
def test_dismiss_prompt(session): | ||
# 18.1 step 3 | ||
session.execute_script("window.prompt(\"Enter Your Name: \", \"Federer\");") |
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.
window.prompt
returns an empty string if accepted without value or null otherwise. Set this value on the window global to verify that the prompt gets dismissed.
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.
fixed
# 18.1 step 3 | ||
session.execute_script("window.result = window.prompt(\"Enter Your Name: \", \"Federer\");") | ||
response = dismiss_alert(session) | ||
assert None == session.execute_script("return window.result") |
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.
This should be assert session.execute_script("return window.result") is None
.
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.
fixed
session.execute_script("window.result = window.prompt(\"Enter Your Name: \", \"Federer\");") | ||
response = dismiss_alert(session) | ||
assert None == session.execute_script("return window.result") | ||
assert_success(response) |
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.
This should come before the assertion?
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.
fixed
session.execute_script("window.result = window.confirm(\"Hello\");") | ||
response = dismiss_alert(session) | ||
assert False == session.execute_script("return window.result;") | ||
assert_success(response) |
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.
This should come before the assertion?
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.
fixed
# 18.1 step 3 | ||
session.execute_script("window.result = window.confirm(\"Hello\");") | ||
response = dismiss_alert(session) | ||
assert False == session.execute_script("return window.result;") |
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.
Should be session.execute_script("return window.result") is False
.
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.
fixed
…ing value of dialog
No description provided.