Skip to content

Commit c731c37

Browse files
committed
Add keyboard shortcuts to MasterQA mode
1 parent 7d402a3 commit c731c37

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

seleniumbase/masterqa/master_qa.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,22 @@ def __jq_confirm_dialog(self, question):
139139
title: '%s',
140140
content: '',
141141
buttons: {
142-
fail_button: {
143-
btnClass: 'btn-red',
144-
text: 'NO / FAIL',
145-
action: function(){
146-
$jqc_status = "Failure!"
147-
}
148-
},
149142
pass_button: {
150143
btnClass: 'btn-green',
151144
text: 'YES / PASS',
145+
keys: ['y', 'p', '1'],
152146
action: function(){
153-
$jqc_status = "Success!"
147+
$jqc_status = "Success!";
148+
jconfirm.lastButtonText = "Success!";
149+
}
150+
},
151+
fail_button: {
152+
btnClass: 'btn-red',
153+
text: 'NO / FAIL',
154+
keys: ['n', 'f', '2'],
155+
action: function(){
156+
$jqc_status = "Failure!";
157+
jconfirm.lastButtonText = "Failure!";
154158
}
155159
}
156160
}
@@ -210,12 +214,7 @@ def __manual_page_check(self, *args):
210214
try:
211215
status = self.execute_script("return $jqc_status")
212216
except Exception:
213-
status = "Failure!"
214-
pre_status = self.execute_script(
215-
"return jconfirm.lastClicked.hasClass('btn-green')"
216-
)
217-
if pre_status:
218-
status = "Success!"
217+
status = self.execute_script("return jconfirm.lastButtonText")
219218
else:
220219
# Fallback to plain js confirm dialogs if can't load jquery_confirm
221220
if self.browser == "ie":

0 commit comments

Comments
 (0)