mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
Merge branch 'MDL-55071-master-behat-fixes' of https://github.com/FMCorz/moodle
This commit is contained in:
commit
f4760ed4bf
@ -39,7 +39,7 @@
|
||||
}}
|
||||
<div class="form-group">
|
||||
{{#selects}}
|
||||
<select id="{{id}}{{key}}" name="{{name}}[]">
|
||||
<select id="{{id}}{{key}}" name="{{name}}[]" class="form-select">
|
||||
{{#options}}
|
||||
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
|
||||
{{/options}}
|
||||
|
@ -89,8 +89,10 @@ class behat_admin extends behat_base {
|
||||
} catch (ElementNotFoundException $e) {
|
||||
|
||||
// Multi element settings, interacting only the first one.
|
||||
$fieldxpath = "//*[label[.= $label]|span[.= $label]]/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-item ')]" .
|
||||
"/descendant::div[@class='form-group']/descendant::*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]";
|
||||
$fieldxpath = "//*[label[normalize-space(.)= $label]|span[normalize-space(.)= $label]]/" .
|
||||
"ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-item ')]" .
|
||||
"/descendant::div[@class='form-group']/descendant::*[self::input | self::textarea | self::select]" .
|
||||
"[not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]";
|
||||
$fieldnode = $this->find('xpath', $fieldxpath);
|
||||
|
||||
// It is the same one that contains the type.
|
||||
|
@ -560,8 +560,8 @@ table.quizreviewsummary td.cell {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#page-mod-quiz-edit ul.section li.pagenumber:first-child .add-menu-outer .menu :first-child,
|
||||
#page-mod-quiz-edit .last-add-menu .add-menu-outer .menu :first-child {
|
||||
#page-mod-quiz-edit ul.section li.pagenumber:first-child .add-menu-outer .menu > :first-child,
|
||||
#page-mod-quiz-edit .last-add-menu .add-menu-outer .menu > :first-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ Feature: Edit quiz page - adding things
|
||||
Scenario: Add some new question to the quiz using '+ a new question' options of the 'Add' menu.
|
||||
And I open the "last" add to quiz menu
|
||||
And I follow "a new question"
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay 01 new"
|
||||
@ -38,7 +38,7 @@ Feature: Edit quiz page - adding things
|
||||
|
||||
And I open the "Page 1" add to quiz menu
|
||||
And I follow "a new question"
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay 02 new"
|
||||
@ -50,7 +50,7 @@ Feature: Edit quiz page - adding things
|
||||
|
||||
And I open the "Page 1" add to quiz menu
|
||||
And I follow "a new question"
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay 03 new"
|
||||
@ -63,7 +63,7 @@ Feature: Edit quiz page - adding things
|
||||
|
||||
And I open the "Page 1" add to quiz menu
|
||||
And I follow "a new question"
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay 04 new"
|
||||
@ -89,7 +89,7 @@ Feature: Edit quiz page - adding things
|
||||
# Add a question to page 2.
|
||||
When I open the "Page 2" add to quiz menu
|
||||
And I choose "a new question" in the open action menu
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding an Essay question"
|
||||
When I set the field "Question name" to "Essay for page 2"
|
||||
@ -129,7 +129,7 @@ Feature: Edit quiz page - adding things
|
||||
|
||||
# Create the Essay 01 question.
|
||||
When I press "Create a new question ..."
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "Add"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay 01"
|
||||
@ -142,7 +142,7 @@ Feature: Edit quiz page - adding things
|
||||
And I should see "Select a category"
|
||||
And I set the field "Select a category:" to "Subcat 1"
|
||||
When I press "Create a new question ..."
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "Add"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay 02"
|
||||
@ -155,7 +155,7 @@ Feature: Edit quiz page - adding things
|
||||
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 set the field "item_qtype_essay" to "1"
|
||||
And I press "Add"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay 03"
|
||||
@ -166,7 +166,7 @@ Feature: Edit quiz page - adding things
|
||||
|
||||
# Create the TF 01 question.
|
||||
When I press "Create a new question ..."
|
||||
And I set the field "qtype_qtype_truefalse" to "1"
|
||||
And I set the field "item_qtype_truefalse" to "1"
|
||||
And I press "Add"
|
||||
Then I should see "Adding a True/False question"
|
||||
And I set the field "Question name" to "TF 01"
|
||||
@ -178,7 +178,7 @@ Feature: Edit quiz page - adding things
|
||||
|
||||
# Create the TF 02 question.
|
||||
When I press "Create a new question ..."
|
||||
And I set the field "qtype_qtype_truefalse" to "1"
|
||||
And I set the field "item_qtype_truefalse" to "1"
|
||||
And I press "Add"
|
||||
Then I should see "Adding a True/False question"
|
||||
And I set the field "Question name" to "TF 02"
|
||||
@ -242,7 +242,7 @@ Feature: Edit quiz page - adding things
|
||||
# Add a random question to page 4.
|
||||
And I open the "Page 4" add to quiz menu
|
||||
And I choose "a new question" in the open action menu
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay for page 4"
|
||||
|
@ -70,7 +70,7 @@ Feature: Edit quiz page - drag-and-drop
|
||||
When I click on the "Add" page break icon after question "Question A"
|
||||
When I open the "Page 2" add to quiz menu
|
||||
And I choose "a new question" in the open action menu
|
||||
And I set the field "qtype_qtype_description" to "1"
|
||||
And I set the field "item_qtype_description" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding a description"
|
||||
And I set the following fields to these values:
|
||||
|
@ -32,7 +32,7 @@ Feature: Edit quiz page - pagination
|
||||
# Add the first Essay question.
|
||||
And I follow "Add"
|
||||
And I follow "a new question"
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay 01 new"
|
||||
@ -44,7 +44,7 @@ Feature: Edit quiz page - pagination
|
||||
# Add the second Essay question.
|
||||
And I follow "Add"
|
||||
And I follow "a new question"
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay 02 new"
|
||||
@ -69,7 +69,7 @@ Feature: Edit quiz page - pagination
|
||||
# Add the third Essay question.
|
||||
And I follow "Add"
|
||||
And I follow "a new question"
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding an Essay question"
|
||||
And I set the field "Question name" to "Essay 03 new"
|
||||
@ -117,7 +117,7 @@ Feature: Edit quiz page - pagination
|
||||
# Add the forth Essay question in a new page (Page 4).
|
||||
When I open the "Page 3" add to quiz menu
|
||||
And I choose "a new question" in the open action menu
|
||||
And I set the field "qtype_qtype_essay" to "1"
|
||||
And I set the field "item_qtype_essay" to "1"
|
||||
And I press "submitbutton"
|
||||
Then I should see "Adding an Essay question"
|
||||
When I set the field "Question name" to "Essay 04 new"
|
||||
|
Loading…
x
Reference in New Issue
Block a user