mirror of
https://github.com/moodle/moodle.git
synced 2025-07-24 15:51:56 +02:00
MDL-44246 behat: New mod_quiz test when JS is disabled
Also including a modification in behat_question_base to make the internal method work with both JS and non-JS.
This commit is contained in:
committed by
Marina Glancy
parent
5a22864234
commit
0176d12dd6
@@ -40,7 +40,10 @@ Feature: Add a quiz
|
||||
And I press "Next"
|
||||
And I should see "Answer saved"
|
||||
And I press "Submit all and finish"
|
||||
And I press "Yes"
|
||||
|
||||
@javascript
|
||||
Scenario: Add and configure small quiz and perform an attempt as a student with Javascript enabled
|
||||
Then I click on "Yes" "button" in the "Confirmation" "dialogue"
|
||||
And I should see "So you think it is true"
|
||||
And I should see "Thank you, this is the general feedback"
|
||||
And I should see "The correct answer is 'False'."
|
||||
@@ -48,5 +51,10 @@ Feature: Add a quiz
|
||||
And I should see "Highest grade: 0.00 / 10.00."
|
||||
And I log out
|
||||
|
||||
@javascript
|
||||
Scenario: Add and configure small quiz and perform an attempt as a student with Javascript enabled
|
||||
Scenario: Add and configure small quiz and perform an attempt as a student with Javascript disabled
|
||||
Then I should see "So you think it is true"
|
||||
And I should see "Thank you, this is the general feedback"
|
||||
And I should see "The correct answer is 'False'."
|
||||
And I follow "Finish review"
|
||||
And I should see "Highest grade: 0.00 / 10.00."
|
||||
And I log out
|
||||
|
@@ -51,12 +51,9 @@ class behat_question_base extends behat_base {
|
||||
* @return Given[] the steps.
|
||||
*/
|
||||
protected function finish_adding_question($questiontypename, TableNode $questiondata) {
|
||||
$questiontypename = $this->getSession()->getSelectorsHandler()->xpathLiteral($questiontypename);
|
||||
$questiontypexpath = "//span[@class='qtypename'][normalize-space(.)=$questiontypename]" .
|
||||
"/ancestor::div[@class='qtypeoption']/descendant::input";
|
||||
|
||||
return array(
|
||||
new Given('I click on "' . $this->escape($questiontypexpath) . '" "xpath_element"'),
|
||||
new Given('I set the field "' . $this->escape($questiontypename) . '" to "1"'),
|
||||
new Given('I click on "#chooseqtype_submit" "css_element"'),
|
||||
new Given('I set the following fields to these values:', $questiondata),
|
||||
new Given('I press "id_submitbutton"')
|
||||
|
Reference in New Issue
Block a user