Skip to content
Browse files

MDL-53956 behat: Avoid before and after step and switch

After pressing the button, if system is slow then
after step and before step might fail as the window
is closed by then. Execute steps one after other
  • Loading branch information...
Rajesh Taneja
Rajesh Taneja committed May 18, 2016
1 parent 65cbefc commit 1ef6a5e30af0192b879a10f10d24d38608efa3f6
Showing with 17 additions and 2 deletions.
  1. +16 −0 lib/tests/behat/behat_forms.php
  2. +1 −2 mod/quiz/tests/behat/manually_mark_question.feature
@@ -57,6 +57,22 @@ public function press_button($button) {
* Press button with specified id|name|title|alt|value and switch to main window.
* @When /^I press "(?P<button_string>(?:[^"]|\\")*)" and switch to main window$/
* @throws ElementNotFoundException Thrown by behat_base::find
* @param string $button
public function press_button_and_switch_to_main_window($button) {
// Ensures the button is present, before pressing.
$buttonnode = $this->find_button($button);
// Switch to main window.
* Fills a form with field/value data. More info in
@@ -53,8 +53,7 @@ Feature: Teachers can override the grade for any question
And I press "Save"
And I should see "That is not a valid number."
And I set the field "Mark" to "10.0"
And I press "Save"
And I switch to the main window
And I press "Save" and switch to main window
And I should see "Complete" in the "Manually graded 10 with comment: " "table_row"
# This time is same as time the window is open. So wait for it to close before proceeding.
And I wait "2" seconds

0 comments on commit 1ef6a5e

Please sign in to comment.
You can’t perform that action at this time.