MDL-56630 behat: Click on link in specificed block/region

This commit is contained in:
Rajesh Taneja 2016-11-08 14:38:48 +08:00
parent 1fd6b25579
commit dc90838aaa
No known key found for this signature in database
GPG key ID: B363F7FB787F80E4
55 changed files with 216 additions and 183 deletions

View file

@ -32,7 +32,7 @@ Feature: Backup and restore of quizzes
And I duplicate "Quiz 1" activity editing the new copy with:
| Name | Quiz 2 |
And I follow "Quiz 2"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then I should see "TF1"
And I should see "TF2"
@ -46,6 +46,6 @@ Feature: Backup and restore of quizzes
And I press "Save changes"
And I restore "moodle_28_quiz.mbz" backup into "Course 1" course using this options:
And I follow "Restored Moodle 2.8 quiz"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then I should see "TF1"
And I should see "TF2"

View file

@ -192,7 +192,7 @@ Feature: Edit quiz page - adding things
# Add Essay 03 from question bank.
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I open the "last" add to quiz menu
And I follow "from question bank"
And I click on "Add to quiz" "link" in the "Essay 03" "table_row"

View file

@ -33,7 +33,7 @@ Feature: Edit quiz page - drag-and-drop
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
@javascript
Scenario: Re-order questions by clicking on the move icon.

View file

@ -36,7 +36,7 @@ Feature: Edit quiz page - remove questions
| Question A | 1 |
| Question B | 1 |
| Question C | 2 |
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
# Confirm the starting point.
Then I should see "Question A" on quiz page "1"
@ -81,7 +81,7 @@ Feature: Edit quiz page - remove questions
| heading | firstslot | shuffle |
| Heading 1 | 1 | 1 |
| Heading 2 | 2 | 1 |
When I follow "Edit quiz"
When I click on "Edit quiz" "link" in the "Administration" "block"
Then "Delete" "link" in the "Question A" "list_item" should not be visible
Then "Delete" "link" in the "Question B" "list_item" should be visible
Then "Delete" "link" in the "Question C" "list_item" should be visible
@ -94,6 +94,6 @@ Feature: Edit quiz page - remove questions
And quiz "Quiz 1" contains the following questions:
| question | page |
| Question A | 1 |
When I follow "Edit quiz"
When I click on "Edit quiz" "link" in the "Administration" "block"
And I delete "Question A" in the quiz by clicking the delete icon
Then I should see "Questions: 0"

View file

@ -21,7 +21,7 @@ Feature: Edit quiz page - pagination
When I log in as "teacher1"
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
@javascript
Scenario: Repaginate questions with N question(s) per page as well as clicking

View file

@ -32,7 +32,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| TF1 | 1 | 1 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then "be attempted" "link" should not be visible
# The text "be attempted" is used as a relatively unique string in both the add and remove links.
@ -51,7 +51,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| TF2 | 1 | 1 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then "This question cannot be attempted until the previous question has been completed." "link" should be visible
@javascript
@ -69,7 +69,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| TF1 | 1 | 1 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then "This question cannot be attempted until the previous question has been completed." "link" should be visible
@javascript
@ -89,7 +89,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| TF3 | 1 | 0 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
When I follow "No restriction on when question 2 can be attempted Click to change"
Then "Question 2 cannot be attempted until the previous question 1 has been completed Click to change" "link" should be visible
And "No restriction on when question 3 can be attempted Click to change" "link" should be visible
@ -111,7 +111,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| TF3 | 1 | 1 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
When I follow "Question 3 cannot be attempted until the previous question 2 has been completed Click to change"
Then "Question 2 cannot be attempted until the previous question 1 has been completed Click to change" "link" should be visible
And "No restriction on when question 3 can be attempted Click to change" "link" should be visible
@ -133,7 +133,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| TF2 | 1 | 1 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then "be attempted" "link" in the "TF1" "list_item" should not be visible
Then "be attempted" "link" in the "TF2" "list_item" should not be visible
@ -155,7 +155,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| Section 1 | 1 | 1 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then "be attempted" "link" in the "TF2" "list_item" should not be visible
@javascript
@ -177,7 +177,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| Section 2 | 2 | 0 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then "be attempted" "link" in the "TF2" "list_item" should not be visible
@javascript
@ -195,7 +195,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| TF2 | 1 | 1 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then "be attempted" "link" in the "TF2" "list_item" should not be visible
@javascript
@ -213,7 +213,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| TF1 | 1 | 0 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then "be attempted" "link" in the "TF1" "list_item" should not be visible
@javascript
@ -231,7 +231,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| TF1 | 1 | 0 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then "be attempted" "link" in the "TF1" "list_item" should not be visible
@javascript
@ -251,7 +251,7 @@ Feature: Edit quizzes where some questions require the previous one to have been
| TF3 | 1 | 1 |
And I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
When I move "Question 1" to "After Question 3" in the quiz by clicking the move icon
Then "Question 2 cannot be attempted until the previous question 1 has been completed Click to change" "link" should be visible
And "No restriction on when question 3 can be attempted Click to change" "link" should be visible

View file

@ -37,7 +37,7 @@ Feature: Edit quiz page - section headings
| TF3 | 3 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then I should see "Shuffle"
@javascript
@ -47,7 +47,7 @@ Feature: Edit quiz page - section headings
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I change quiz section heading "" to "This is section one"
Then I should see "This is section one"
@ -76,7 +76,7 @@ Feature: Edit quiz page - section headings
| Heading 3 | 3 | 1 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I change quiz section heading "" to "This is section one"
And I change quiz section heading "Heading 2" to "This is section two"
Then I should see "This is section one"
@ -107,7 +107,7 @@ Feature: Edit quiz page - section headings
| Heading 3 | 3 | 1 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
When I change quiz section heading "Heading 1" to ""
Then I should not see "Heading 1"
And I should see "Heading 2"
@ -145,7 +145,7 @@ Feature: Edit quiz page - section headings
| Heading 3 | 3 | 1 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I follow "Remove heading 'Heading 2'"
And I should see "Are you sure you want to remove the 'Heading 2' section heading?"
And I click on "Yes" "button" in the "Confirm" "dialogue"
@ -173,7 +173,7 @@ Feature: Edit quiz page - section headings
| Heading 2 | 2 | 0 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I change quiz section heading "Heading 2" to "Edited heading"
Then I should see "Edited heading"
And "Edit heading 'Edited heading'" "link" should be visible
@ -207,7 +207,7 @@ Feature: Edit quiz page - section headings
| Heading 3 | 5 | 1 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I move "TF5" to "After Question 2" in the quiz by clicking the move icon
Then I should see "TF5" on quiz page "2"
@ -239,7 +239,7 @@ Feature: Edit quiz page - section headings
| Heading 3 | 5 | 1 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I move "TF1" to "After Question 3" in the quiz by clicking the move icon
Then I should see "TF1" on quiz page "2"
@ -265,7 +265,7 @@ Feature: Edit quiz page - section headings
| Heading 3 | 3 | 1 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
Then "Remove heading 'Heading 1'" "link" should not exist
And "Remove heading 'Heading 2'" "link" should exist
And "Remove heading 'Heading 3'" "link" should exist
@ -292,7 +292,7 @@ Feature: Edit quiz page - section headings
| Heading 3 | 3 | 0 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I click on shuffle for section "Heading 1" on the quiz edit page
And I click on shuffle for section "Heading 2" on the quiz edit page
Then shuffle for section "Heading 1" should be "On" on the quiz edit page
@ -320,7 +320,7 @@ Feature: Edit quiz page - section headings
| Heading 3 | 3 | 1 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I click on shuffle for section "Heading 1" on the quiz edit page
And I click on shuffle for section "Heading 2" on the quiz edit page
Then shuffle for section "Heading 1" should be "Off" on the quiz edit page
@ -346,7 +346,7 @@ Feature: Edit quiz page - section headings
| TF3 | 2 |
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I click on the "Add" page break icon after question "TF1"
And I click on "Add" "link" in the "Page 1" "list_item"
Then "a new section heading" "link" in the "Page 1" "list_item" should not be visible
@ -381,7 +381,7 @@ Feature: Edit quiz page - section headings
When I follow "Course 1"
And I follow "Quiz 1"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
And I click on the "Remove" page break icon after question "TF1"
And I open the "Page 2" add to quiz menu
And I choose "a new section heading" in the open action menu

View file

@ -66,7 +66,7 @@ Feature: In order to create a quiz that awards marks the way I want
| Decimal places in grades | 3 |
| Decimal places in question grades | 5 |
And I press "Save and display"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
# Then the field "maxgrade" matches value "20.000" -- with exact match on decimal places.
Then "//input[@name = 'maxgrade' and @value = '20.000']" "xpath_element" should exist
And I should see "2.00000"

View file

@ -78,7 +78,7 @@ Feature: In order to create a quiz that awards marks the way I want
| Decimal places in grades | 3 |
| Decimal places in question grades | 5 |
And I press "Save and display"
And I follow "Edit quiz"
And I click on "Edit quiz" "link" in the "Administration" "block"
# Then the field "maxgrade" matches value "20.000" -- with exact match on decimal places.
Then "//input[@name = 'maxgrade' and @value = '20.000']" "xpath_element" should exist
And I should see "2.00000"