Merge branch 'wip-mdl-54589-mac' of https://github.com/rajeshtaneja/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2016-06-22 01:42:15 +02:00
commit 0f20bf7507
21 changed files with 92 additions and 31 deletions

View File

@ -1,4 +1,4 @@
@block @block_private_files @file_upload @javascript
@block @block_private_files @_file_upload @javascript
Feature: The private files block allows users to store files privately in moodle
In order to store a private file in moodle
As a user

View File

@ -1,4 +1,4 @@
@block @block_private_files @file_upload
@block @block_private_files @_file_upload
Feature: The private files block allows users to store files privately in moodle
In order to store a private file in moodle
As a teacher

View File

@ -2,6 +2,6 @@
"require-dev": {
"phpunit/phpunit": "4.8.*",
"phpunit/dbUnit": "1.4.*",
"moodlehq/behat-extension": "3.32.0"
"moodlehq/behat-extension": "3.32.1"
}
}

27
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "0bd3021c5dea5e28a07d7a58d0f1676d",
"content-hash": "528abab2d8628a8442924ec3defc561d",
"hash": "949f8a407958a19e2dba7929b3dc0576",
"content-hash": "bd742592f8ed4700884f6c651226c961",
"packages": [],
"packages-dev": [
{
@ -797,16 +797,16 @@
},
{
"name": "moodlehq/behat-extension",
"version": "v3.32.0",
"version": "v3.32.1",
"source": {
"type": "git",
"url": "https://github.com/moodlehq/moodle-behat-extension.git",
"reference": "f0b6a44de9111fd4fa82796aca712b9e9772d07e"
"reference": "f8305058ce9140864c23c9b667e3d7d487fdc006"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/f0b6a44de9111fd4fa82796aca712b9e9772d07e",
"reference": "f0b6a44de9111fd4fa82796aca712b9e9772d07e",
"url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/f8305058ce9140864c23c9b667e3d7d487fdc006",
"reference": "f8305058ce9140864c23c9b667e3d7d487fdc006",
"shasum": ""
},
"require": {
@ -842,7 +842,7 @@
"Behat",
"moodle"
],
"time": "2016-05-09 03:32:06"
"time": "2016-06-20 07:56:08"
},
{
"name": "phpdocumentor/reflection-docblock",
@ -1597,16 +1597,16 @@
},
{
"name": "sebastian/exporter",
"version": "1.2.1",
"version": "1.2.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "7ae5513327cb536431847bcc0c10edba2701064e"
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e",
"reference": "7ae5513327cb536431847bcc0c10edba2701064e",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
"shasum": ""
},
"require": {
@ -1614,12 +1614,13 @@
"sebastian/recursion-context": "~1.0"
},
"require-dev": {
"ext-mbstring": "*",
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
"dev-master": "1.3.x-dev"
}
},
"autoload": {
@ -1659,7 +1660,7 @@
"export",
"exporter"
],
"time": "2015-06-21 07:55:53"
"time": "2016-06-17 09:04:28"
},
{
"name": "sebastian/global-state",

View File

@ -58,6 +58,9 @@ class behat_enrol extends behat_base {
array($this->escape($enrolmethod), get_string('addinstance', 'enrol'))
);
// Wait again, for page to reloaded.
$this->execute('behat_general::i_wait_to_be_redirected');
// Set form fields.
$this->execute("behat_forms::i_set_the_following_fields_to_these_values", $table);

View File

@ -48,7 +48,6 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
| grade_report_showaverages | 0 |
| grade_report_enableajax | 1 |
@javascript
Scenario: Use the grader report without editing, with AJAX on and quick feedback off
When the following config values are set as admin:

View File

@ -402,6 +402,11 @@ FloatingHeaders.prototype = {
return this;
}
if (M.cfg.behatsiterunning) {
// If the behat site is running we don't want floating elements.
return;
}
// Generate floating elements.
this._setupFloatingUserColumn();
this._setupFloatingUserHeader();

View File

@ -402,6 +402,11 @@ FloatingHeaders.prototype = {
return this;
}
if (M.cfg.behatsiterunning) {
// If the behat site is running we don't want floating elements.
return;
}
// Generate floating elements.
this._setupFloatingUserColumn();
this._setupFloatingUserHeader();

View File

@ -259,6 +259,11 @@ FloatingHeaders.prototype = {
return this;
}
if (M.cfg.behatsiterunning) {
// If the behat site is running we don't want floating elements.
return;
}
// Generate floating elements.
this._setupFloatingUserColumn();
this._setupFloatingUserHeader();

View File

@ -208,7 +208,9 @@ var removeLoaderImgs = function (elClass, parentId) {
var parentEl = document.getElementById(parentId);
if (parentEl) {
var loader = document.getElementById("loaderImg");
parentEl.removeChild(loader);
if (loader) {
parentEl.removeChild(loader);
}
}
};

View File

@ -71,16 +71,24 @@ class behat_form_select extends behat_form_field {
// Wait for all the possible AJAX requests that have been
// already triggered by selectOption() to be finished.
if ($this->running_javascript()) {
// Trigger change event as this is needed by some drivers (Phantomjs). Don't do it for
// Singleselect as this will cause multiple event fire and lead to race-around condition.
$browser = \Moodle\BehatExtension\Driver\MoodleSelenium2Driver::getBrowser();
if (!$singleselect && ($browser == 'phantomjs')) {
$script = "Syn.trigger('change', {}, {{ELEMENT}})";
try {
$this->session->getDriver()->triggerSynScript($this->field->getXpath(), $script);
} catch (Exception $e) {
// No need to do anything if element has been removed by JS.
// This is possible when inline editing element is used.
// Trigger change event and click on first skip link, as some OS/browsers (Phantomjs, Mac-FF),
// don't close select option field and trigger event.
if (!$singleselect) {
$dialoguexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue-focused ')]";
if (!$node = $this->session->getDriver()->find($dialoguexpath)) {
$script = "Syn.trigger('change', {}, {{ELEMENT}})";
try {
$this->session->getDriver()->triggerSynScript($this->field->getXpath(), $script);
$this->session->getDriver()->click('//body//div[@class="skiplinks"]');
} catch (\Exception $e) {
return;
}
} else {
try {
$this->session->getDriver()->click($dialoguexpath);
} catch (\Exception $e) {
return;
}
}
}
$this->session->wait(behat_base::TIMEOUT * 1000, behat_base::PAGE_READY_JS);

View File

@ -1541,4 +1541,22 @@ class behat_general extends behat_base {
$node->keyPress($char, $modifier);
$node->keyUp($char, $modifier);
}
/**
* Press tab key on a specific element.
*
* @When /^I press tab key in "(?P<element_string>(?:[^"]|\\")*)" "(?P<selector_string>[^"]*)"$/
* @param string $element Element we look for
* @param string $selectortype The type of what we look for
* @throws DriverException
* @throws ExpectationException
*/
public function i_post_tab_key_in_element($element, $selectortype) {
if (!$this->running_javascript()) {
throw new DriverException('Tab press step is not available with Javascript disabled');
}
// Gets the node based on the requested selector type and locator.
$node = $this->get_selected_node($selectortype, $element);
$this->getSession()->getDriver()->post_key("\xEE\x80\x84", $node->getXpath());
}
}

View File

@ -129,6 +129,7 @@ Feature: In an assignment, teacher can annotate PDF files during grading
And I follow "View all submissions"
And I click on "Edit" "link" in the "Student 2" "table_row"
And I click on "Grade" "link" in the "Student 2" "table_row"
And I wait until the page is ready
And I click on ".linebutton" "css_element"
And I draw on the pdf
And I press "Save changes"

View File

@ -51,7 +51,9 @@ Feature: In a group assignment, teacher can annotate PDF files for all users
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I wait until the page is ready
And I click on ".navigate-next-button" "css_element"
And I wait until the page is ready
And I click on ".stampbutton" "css_element"
And I draw on the pdf
And I wait until the page is ready

View File

@ -40,6 +40,7 @@ Feature: In an assignment, teachers grade multiple students on one page
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I wait until the page is ready
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"

View File

@ -54,6 +54,9 @@ class behat_mod_feedback extends behat_base {
$this->execute('behat_forms::i_select_from_the_singleselect', array($questiontype, $additem));
// Wait again, for page to reloaded.
$this->execute('behat_general::i_wait_to_be_redirected');
$rows = $questiondata->getRows();
$modifiedrows = array();
foreach ($rows as $row) {

View File

@ -39,9 +39,11 @@ Feature: A user can navigate to previous and next discussions
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 1 |
| Message | Test post message |
And I wait "1" seconds
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 2 |
| Message | Test post message |
And I wait "1" seconds
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 3 |
| Message | Test post message |

View File

@ -88,6 +88,8 @@ Feature: The various checks that may happen when an attept is started
And I should see "The quiz has a time limit of 1 hour. Time will "
And I should see "The password entered was incorrect"
And I set the field "Quiz password" to "Frog"
# On Mac/FF tab key is needed as text field in dialogue and page have same id.
And I press tab key in "Quiz password" "field"
And I press "Start attempt"
And I should see "Text of the first question"
@ -110,6 +112,8 @@ Feature: The various checks that may happen when an attept is started
And I should see "The quiz has a time limit of 1 hour. Time will "
And I should see "The password entered was incorrect"
And I set the field "Quiz password" to "Frog"
# On Mac/FF tab key is needed as text field in dialogue and page have same id.
And I press tab key in "Quiz password" "field"
And I press "Cancel"
Then I should see "Quiz 1 description"
And "Attempt quiz now" "button" should be visible

View File

@ -153,6 +153,7 @@ Feature: Edit quiz page - adding things
# Create the Essay 03 question.
And I set the field "Select a category" to "Default for C1"
And I wait until the page is ready
When I press "Create a new question ..."
And I set the field "qtype_qtype_essay" to "1"
And I press "Add"

View File

@ -10,6 +10,7 @@ Feature: Page contains a list of events
And I navigate to "Events list" node in "Site administration > Reports"
And I should see "Event name"
And I set the field "eventname" to "phase"
And I press "filterbutton"
And I should see "Phase switched"
And I should not see "Comment created"
And I press "clearbutton"