MDL-57494 behat: Fixed tags and removed reset in after_scenario

1. Added missing switch_window tags
2. Fixed switch_frame tags to use switch_iframe
3. Removed reset from after_scenario.
This commit is contained in:
Rajesh Taneja
2016-12-22 12:46:05 +08:00
parent 84ad325c69
commit 8d9d32653b
3 changed files with 3 additions and 25 deletions
-22
View File
@@ -343,28 +343,6 @@ class behat_hooks extends behat_base {
$this->resize_window('medium');
}
/**
* Executed after scenario to go to a page where no JS is executed.
* This will ensure there are no unwanted ajax calls from browser and
* site can be reset safely.
*
* @param AfterScenarioScope $scope scope passed by event fired after scenario.
* @AfterScenario
*/
public function after_scenario(AfterScenarioScope $scope) {
try {
$this->wait_for_pending_js();
$this->getSession()->reset();
} catch (DriverException $e) {
// Try restart session, if DriverException caught.
try {
$this->getSession()->restart();
} catch (DriverException $e) {
// Do nothing, as this will be caught while starting session in before_scenario.
}
}
}
/**
* Wait for JS to complete before beginning interacting with the DOM.
*
+2 -2
View File
@@ -34,7 +34,7 @@ Feature: Add preconfigured tools via teacher interface
And the field "Icon URL" matches value "http://download.moodle.org/unittest/test.jpg"
And the field "Secure icon URL" matches value "https://download.moodle.org/unittest/test.jpg"
@javascript
@javascript @_switch_window
Scenario: Add a preconfigured tool from a cartridge
When I log in as "teacher1"
And I follow "Course 1"
@@ -58,7 +58,7 @@ Feature: Add preconfigured tools via teacher interface
And I press "Cancel"
And I switch to the main window
@javascript
@javascript @_switch_window
Scenario: Add and use a preconfigured tool
When I log in as "teacher1"
And I follow "Course 1"
+1 -1
View File
@@ -1,4 +1,4 @@
@mod @mod_scorm @_file_upload @_switch_frame
@mod @mod_scorm @_file_upload @_switch_iframe
Feature: Add scorm activity
In order to let students access a scorm package
As a teacher