Merge branch 'MDL-42625_master-failures-fix' of git://github.com/dmonllao/moodle

This commit is contained in:
Marina Glancy 2013-12-12 16:49:56 +11:00
commit bdd5a6c5c2
6 changed files with 11 additions and 25 deletions

View File

@ -16,7 +16,6 @@ Feature: Display extended course names
Scenario: Courses list with extended course names
Given I expand "Site administration" node
And I expand "Appearance" node
And I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][contains(., 'Appearance')]" "xpath_element"
And I check "Display extended course names"
When I press "Save changes"

View File

@ -101,7 +101,7 @@ class behat_course extends behat_base {
// Adding a forced wait until editors are loaded as otherwise selenium sometimes tries clicks on the
// format field when the editor is being rendered and the click misses the field coordinates.
$steps[] = new Given('I wait until the editors are loaded');
$steps[] = new Given('I expand all fieldsets');
$steps[] = new Given('I select "' . $formatvalue . '" from "' . $formatfield . '"');
$steps[] = new Given('I fill the moodle form with:', $table);
} else {

View File

@ -69,9 +69,6 @@ class behat_forms extends behat_base {
*/
public function i_fill_the_moodle_form_with(TableNode $data) {
// We ensure that all the editors are loaded and we can interact with them.
$this->ensure_editors_are_loaded();
// Expand all fields in case we have.
$this->expand_all_fields();
@ -110,6 +107,9 @@ class behat_forms extends behat_base {
*/
protected function expand_all_fields() {
// We ensure that all the editors are loaded and we can interact with them.
$this->ensure_editors_are_loaded();
// behat_base::find() throws an exception if there are no elements, we should not fail a test because of this.
try {

View File

@ -77,16 +77,16 @@ class behat_general extends behat_base {
// moodle_page::$periodicrefreshdelay possible values.
if (!$metarefresh = $this->getSession()->getPage()->find('xpath', "//head/descendant::meta[@http-equiv='refresh']")) {
// We don't fail the scenario if no redirection with message is found to avoid race condition false failures.
return false;
return true;
}
// Wrapped in try & catch in case the redirection has already been executed.
try {
$content = $metarefresh->getAttribute('content');
} catch (NoSuchElement $e) {
return false;
return true;
} catch (StaleElementReference $e) {
return false;
return true;
}
// Getting the refresh time and the url if present.
@ -219,21 +219,6 @@ class behat_general extends behat_base {
$this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS);
}
/**
* Waits until the editors are all completely loaded.
*
* @Given /^I wait until the editors are loaded$/
* @throws DriverException
*/
public function wait_until_editors_are_loaded() {
if (!$this->running_javascript()) {
throw new DriverException('Editors are not loaded when running without Javascript support');
}
$this->ensure_editors_are_loaded();
}
/**
* Waits until the provided element selector exists in the DOM
*

View File

@ -57,7 +57,7 @@ class behat_navigation extends behat_base {
// Administration menu is not loaded by default any more. Click the link to expand.
return new Given('I click on "'.$nodetext.'" "link" in the "'.get_string('administration').'" "block"');
}
return false;
return true;
}
// Avoid problems with quotes.
@ -91,7 +91,7 @@ class behat_navigation extends behat_base {
// No collapsible nodes with non-JS browsers.
if (!$this->running_javascript()) {
return false;
return true;
}
// Avoid problems with quotes.

View File

@ -17,3 +17,5 @@ Feature: Enable/disable password field based on authentication selected.
And the "newpassword" "field" should be disabled
And I select "Email-based self-registration" from "auth"
And the "newpassword" "field" should be enabled
# We need to cancel/submit a form that has been modified.
And I press "Create user"