MDL-56898 behat: Ensure the page is stable before executing

This commit is contained in:
Rajesh Taneja 2016-11-16 11:41:15 +08:00
parent 7f24e5e654
commit d9a9a87835
No known key found for this signature in database
GPG Key ID: B363F7FB787F80E4
3 changed files with 14 additions and 7 deletions

View File

@ -146,7 +146,10 @@ class behat_mod_feedback extends behat_base {
// If chart data is not visible then expand.
$node = $this->get_selected_node("xpath_element", $charttabledataxpath);
if ($node && !$node->isVisible()) {
if ($node) {
if (!$node->isVisible()) {
// Focus on node, before checking if it's visible.
$node->focus();
$this->execute('behat_general::i_click_on_in_the', array(
get_string('showchartdata'),
'link',
@ -155,6 +158,7 @@ class behat_mod_feedback extends behat_base {
));
}
}
}
/**
* Ensures two feedback export files are identical

View File

@ -134,6 +134,7 @@ Feature: Lesson user override
And I set the following fields to these values:
| Password protected lesson | Yes |
| id_password | moodle_rules |
And I wait until the page is ready
And I press "Save and display"
And I navigate to "User overrides" node in "Lesson administration"
And I press "Add user override"

View File

@ -45,6 +45,7 @@ Feature: Scorm multi-sco completion
And I should see "Play of the game"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
Then I should see "Basic Multi-sco SCORM package"
And I log out
And I log in as "teacher1"
@ -80,6 +81,7 @@ Feature: Scorm multi-sco completion
And I should see "Play of the game"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
Then I should see "ADV Multi-sco SCORM package"
And I log out
And I log in as "teacher1"