Commit 131d4ac2 authored by Rajesh Taneja's avatar Rajesh Taneja Committed by Rajesh Taneja
Browse files

MDL-50163 behat: Restart session after scenario with switch_window

Restart session after a scenario with switch window
is finished. This will close all open browser windows
and open a new browser window
parent 821ab27c
......@@ -384,6 +384,18 @@ class behat_hooks extends behat_base {
}
}
/**
* Executed after scenario having switch window to restart session.
* This is needed to close all extra browser windows and starting
* one browser window.
*
* @param ScenarioEvent $event event fired after scenario.
* @AfterScenario @_switch_window
*/
public function after_scenario_switchwindow(ScenarioEvent $event) {
$this->getSession()->restart();
}
/**
* Getter for self::$faildumpdirname
*
......
......@@ -4,7 +4,7 @@ Feature: In a book, verify log entries
As an admin
I need to perform various actions in a book.
@javascript
@javascript @_switch_window
Scenario: perform various book actions and verify log entries.
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
......
......@@ -68,7 +68,7 @@ Feature: Allow students to redo questions in a practice quiz, without starting a
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
Then "Redo question" "button" should not exist
@javascript
@javascript @_switch_window
Scenario: Teachers reviewing can see all the qestions attempted in a slot
When I follow "Quiz 1"
And I press "Attempt quiz now"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment