Skip to content

Commit 7a12a02

Browse files
committed
MDL-56614 behat: add navigation block when required
Most of these hacks have links to corresponding MDL issues
1 parent 44f460c commit 7a12a02

File tree

16 files changed

+116
-19
lines changed

16 files changed

+116
-19
lines changed

admin/tool/availabilityconditions/tests/behat/manage_conditions.feature

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Feature: Manage availability conditions
88
Scenario: Display list of availability conditions
99
# Check the report doesn't show when not enabled.
1010
Given I log in as "admin"
11+
And I press "Customise this page"
12+
And I add the "Administration" block if not present
1113
And the following config values are set as admin:
1214
| enableavailability | 0 |
1315
And I expand "Site administration" node

admin/tool/recyclebin/tests/behat/basic_functionality.feature

+8-3
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,21 @@ Feature: Basic recycle bin functionality
4242
And I should see "Test assign" in the "Topic 1" "section"
4343

4444
Scenario: Restore a deleted course
45+
# TODO MDL-57250 remove extra category.
46+
Given the following "categories" exist:
47+
| name | idnumber |
48+
| There is a bug with navigation and we need an extra category | CAT1 |
4549
Given I log in as "admin"
4650
And I go to the courses management page
4751
And I click on "delete" action for "Course 2" in management course listing
4852
And I press "Delete"
4953
And I should see "Deleting C2"
5054
And I should see "C2 has been completely deleted"
5155
And I press "Continue"
52-
And I go to the courses management page
53-
And I should not see "Course 2" in the "#course-listing" "css_element"
54-
When I navigate to "Recycle bin" node in "Category: Miscellaneous"
56+
And I am on course index
57+
And I follow "Miscellaneous"
58+
And I should not see "Course 2"
59+
When I navigate to "Recycle bin" in current page administration
5560
Then I should see "Course 2"
5661
And I should see "Contents will be permanently deleted after 14 days"
5762
And I click on "Restore" "link" in the "region-main" "region"

badges/tests/behat/add_badge.feature

+4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ Feature: Add badges to the system
1414
And I set the field "Default badge issuer name" to "Test Badge Site"
1515
And I set the field "Default badge issuer contact details" to "[email protected]"
1616
And I press "Save changes"
17+
And I follow "Badges"
1718
When I follow "Add a new badge"
1819
Then the field "issuercontact" matches value "[email protected]"
1920
And the field "issuername" matches value "Test Badge Site"
2021

2122
@javascript
2223
Scenario: Accessing the badges
24+
And I press "Customise this page"
25+
# TODO MDL-57120 site "Badges" link not accessible without navigation block.
26+
And I add the "Navigation" block if not present
2327
Given I navigate to "Site badges" node in "Site pages"
2428
Then I should see "There are no badges available."
2529

blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Feature: Feature: Students can use the recent blog entries block to view recent
1212
And I am on site homepage
1313
And I navigate to "Turn editing on" node in "Front page settings"
1414
And I add the "Recent blog entries" block
15+
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
16+
And I add the "Navigation" block if not present
1517
And I log out
1618

1719
Scenario: Students use the recent blog entries block to view blogs

blocks/blog_tags/tests/behat/blogtag.feature

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ Feature: Adding blog tag block
2424
And I follow "Course 1"
2525
And I turn editing mode on
2626
And I add the "Blog tags" block
27+
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
28+
And I add the "Navigation" block if not present
2729

28-
And I navigate to "Course blogs" node in "My courses > c1 > Participants"
30+
And I navigate to course participants
31+
And I click on "Course blogs" "link" in the "Navigation" "block"
2932
And I follow "Blog about this Course"
3033
And I set the following fields to these values:
3134
| Entry title | Blog post from teacher |
@@ -35,7 +38,8 @@ Feature: Adding blog tag block
3538
And I log out
3639
And I log in as "student1"
3740
And I follow "Course 1"
38-
And I navigate to "Course blogs" node in "My courses > c1 > Participants"
41+
And I navigate to course participants
42+
And I click on "Course blogs" "link" in the "Navigation" "block"
3943
And I follow "Blog about this Course"
4044
And I set the following fields to these values:
4145
| Entry title | Blog post from student |

blog/tests/behat/comment.feature

+14-8
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ Feature: Comment on a blog entry
99
| username | firstname | lastname | email |
1010
| testuser | Test | User | moodle@example.com |
1111
| testuser2 | Test2 | User2 | moodle2@example.com |
12+
And I log in as "admin"
13+
And I am on site homepage
14+
And I turn editing mode on
15+
# TODO MDL-57120 "Site blogs" link not accessible without navigation block.
16+
And I add the "Navigation" block if not present
17+
And I configure the "Navigation" block
18+
And I set the following fields to these values:
19+
| Page contexts | Display throughout the entire site |
20+
And I press "Save changes"
21+
And I log out
1222
And I log in as "testuser"
13-
And I expand "Site pages" node
14-
And I follow "Site blogs"
23+
And I navigate to "Site blogs" node in "Site pages"
1524
And I follow "Add a new entry"
1625
And I set the following fields to these values:
1726
| Entry title | Blog post from user 1 |
@@ -23,8 +32,7 @@ Feature: Comment on a blog entry
2332
Scenario: Commenting on my own blog entry
2433
Given I am on site homepage
2534
And I log in as "testuser"
26-
And I expand "Site pages" node
27-
And I follow "Site blogs"
35+
And I navigate to "Site blogs" node in "Site pages"
2836
And I follow "Blog post from user 1"
2937
And I should see "User 1 blog post content"
3038
And I follow "Comments (0)"
@@ -39,8 +47,7 @@ Feature: Comment on a blog entry
3947
Scenario: Deleting my own comment
4048
Given I am on site homepage
4149
And I log in as "testuser"
42-
And I expand "Site pages" node
43-
And I follow "Site blogs"
50+
And I navigate to "Site blogs" node in "Site pages"
4451
And I follow "Blog post from user 1"
4552
And I should see "User 1 blog post content"
4653
And I follow "Comments (0)"
@@ -60,8 +67,7 @@ Feature: Comment on a blog entry
6067
Given I am on site homepage
6168
And I log in as "testuser2"
6269
And I am on site homepage
63-
And I expand "Site pages" node
64-
And I follow "Site blogs"
70+
And I navigate to "Site blogs" node in "Site pages"
6571
And I follow "Blog post from user 1"
6672
When I follow "Comments (0)"
6773
And I set the field "content" to "$My own >nasty< \"string\"!"

blog/tests/behat/delete.feature

+12-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,18 @@ Feature: Delete a blog entry
88
Given the following "users" exist:
99
| username | firstname | lastname | email |
1010
| testuser | Test | User | moodle@example.com |
11+
And I log in as "admin"
12+
And I am on site homepage
13+
And I turn editing mode on
14+
# TODO MDL-57120 "Site blogs" link not accessible without navigation block.
15+
And I add the "Navigation" block if not present
16+
And I configure the "Navigation" block
17+
And I set the following fields to these values:
18+
| Page contexts | Display throughout the entire site |
19+
And I press "Save changes"
20+
And I log out
1121
And I log in as "testuser"
12-
And I expand "Site pages" node
13-
And I follow "Site blogs"
22+
And I navigate to "Site blogs" node in "Site pages"
1423
And I follow "Add a new entry"
1524
And I set the following fields to these values:
1625
| Entry title | Blog post one |
@@ -22,8 +31,7 @@ Feature: Delete a blog entry
2231
| Blog entry body | User 1 blog post content |
2332
And I press "Save changes"
2433
And I am on site homepage
25-
And I expand "Site pages" node
26-
And I follow "Site blogs"
34+
And I navigate to "Site blogs" node in "Site pages"
2735

2836
Scenario: Delete blog post results in post deleted
2937
Given I follow "Blog post one"

course/tests/behat/coursetags.feature

+6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ Feature: Tagging courses
4848
And I press "Save and display"
4949
And I log out
5050
And I log in as "user1"
51+
And I press "Customise this page"
52+
# TODO MDL-57120 "Tags" link not accessible without navigation block.
53+
And I add the "Navigation" block if not present
5154
And I navigate to "Tags" node in "Site pages"
5255
And I follow "Mathematics"
5356
Then I should see "Course 1"
@@ -82,6 +85,9 @@ Feature: Tagging courses
8285
And I press "Save changes"
8386
And I log out
8487
And I log in as "user1"
88+
And I press "Customise this page"
89+
# TODO MDL-57120 "Tags" link not accessible without navigation block.
90+
And I add the "Navigation" block if not present
8591
And I navigate to "Tags" node in "Site pages"
8692
And I follow "Mathematics"
8793
Then I should see "Course 1"

course/tests/behat/navigate_course_list.feature

+9
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ Feature: Browse course list and return back from enrolment page
3232

3333
@javascript
3434
Scenario: A user can return to the previous page from enrolment page by clicking navigation links
35+
Given I log in as "admin"
36+
And I am on site homepage
37+
And I turn editing mode on
38+
And I add the "Navigation" block if not present
39+
And I configure the "Navigation" block
40+
And I set the following fields to these values:
41+
| Page contexts | Display throughout the entire site |
42+
And I press "Save changes"
43+
And I log out
3544
When I log in as "user2"
3645
And I follow "Preferences" in the user menu
3746
And I click on "Edit profile" "link" in the "region-main" "region"

notes/tests/behat/participants_notes.feature

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ Feature: Add notes to course participants
2020
| student1 | C1 | student |
2121
| student2 | C1 | student |
2222
| student3 | C1 | student |
23+
# TODO MDL-57120 "Notes" and site "Participants" links are not accessible without navigation block.
24+
Given I log in as "admin"
25+
And I am on site homepage
26+
And I turn editing mode on
27+
And I add the "Navigation" block if not present
28+
And I configure the "Navigation" block
29+
And I set the following fields to these values:
30+
| Page contexts | Display throughout the entire site |
31+
And I press "Save changes"
32+
And I log out
2333
And I log in as "teacher1"
2434
And I follow "Course 1"
2535
And I follow "Participants"

tag/tests/behat/collections.feature

+3
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ Feature: Managers can create and manage tag collections
117117
| Searchable | 0 |
118118
And I press "Create"
119119
And "Yes" "text" should not exist in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Hiddencoll')]" "xpath_element"
120+
And I press "Blocks editing on"
121+
# TODO MDL-57120 "Tags" link not accessible without navigation block.
122+
And I add the "Navigation" block if not present
120123
And I navigate to "Tags" node in "Site pages"
121124
Then the "Select tag collection" select box should contain "Default collection"
122125
And the "Select tag collection" select box should contain "Hobbies"

tag/tests/behat/edit_tag.feature

+9
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Feature: Users can edit tags to add description or rename
3131
| moodle/user:viewdetails | Allow |
3232
And I log out
3333
When I log in as "editor1"
34+
And I press "Customise this page"
35+
# TODO MDL-57120 site "Participants" link not accessible without navigation block.
36+
And I add the "Navigation" block if not present
3437
And I navigate to "Participants" node in "Site pages"
3538
And I follow "User 1"
3639
And I follow "Cat"
@@ -52,6 +55,9 @@ Feature: Users can edit tags to add description or rename
5255
@javascript
5356
Scenario: Manager can change tag description, related tags and rename the tag from tag view page
5457
When I log in as "manager1"
58+
And I press "Customise this page"
59+
# TODO MDL-57120 site "Participants" link not accessible without navigation block.
60+
And I add the "Navigation" block if not present
5561
And I navigate to "Participants" node in "Site pages"
5662
And I follow "User 1"
5763
And I follow "Cat"
@@ -81,6 +87,9 @@ Feature: Users can edit tags to add description or rename
8187

8288
Scenario: Renaming the tag from tag view page
8389
When I log in as "manager1"
90+
And I press "Customise this page"
91+
# TODO MDL-57120 site "Participants" link not accessible without navigation block.
92+
And I add the "Navigation" block if not present
8493
And I navigate to "Participants" node in "Site pages"
8594
And I follow "User 1"
8695
And I follow "Cat"

tag/tests/behat/flag_tags.feature

+7
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,25 @@ Feature: Users can flag tags and manager can reset flags
2424
| moodle/user:viewdetails | Allow |
2525
And I log out
2626
And I log in as "user2"
27+
And I press "Customise this page"
28+
# TODO MDL-57120 site "Participants" link not accessible without navigation block.
29+
And I add the "Navigation" block if not present
2730
And I navigate to "Participants" node in "Site pages"
2831
And I follow "User 1"
2932
And I follow "Badtag"
3033
And I follow "Flag as inappropriate"
3134
And I should see "The person responsible will be notified"
35+
And I am on homepage
3236
And I navigate to "Participants" node in "Site pages"
3337
And I follow "User 1"
3438
And I follow "Sweartag"
3539
And I follow "Flag as inappropriate"
3640
And I should see "The person responsible will be notified"
3741
And I log out
3842
And I log in as "user3"
43+
And I press "Customise this page"
44+
# TODO MDL-57120 site "Participants" link not accessible without navigation block.
45+
And I add the "Navigation" block if not present
3946
And I navigate to "Participants" node in "Site pages"
4047
And I follow "User 1"
4148
And I follow "Sweartag"

tag/tests/behat/tagindex.feature

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Feature: Browsing tagged items
2222

2323
Scenario: Browse tag index with javascript disabled
2424
When I log in as "user1"
25+
And I press "Customise this page"
26+
# TODO MDL-57120 "Tags" link not accessible without navigation block.
27+
And I add the "Navigation" block if not present
2528
And I navigate to "Tags" node in "Site pages"
2629
And I follow "Cat"
2730
Then I should see "Courses" in the ".tag-index-items h3" "css_element"
@@ -66,6 +69,9 @@ Feature: Browsing tagged items
6669
@javascript
6770
Scenario: Browse tag index with javascript enabled
6871
When I log in as "user1"
72+
And I press "Customise this page"
73+
# TODO MDL-57120 "Tags" link not accessible without navigation block.
74+
And I add the "Navigation" block if not present
6975
And I navigate to "Tags" node in "Site pages"
7076
And I follow "Cat"
7177
Then I should see "Courses" in the "#tagarea-core-course" "css_element"

user/tests/behat/set_default_homepage.feature

+11-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,20 @@ Feature: Set the site home page and dashboard as the default home page
88
Given the following "courses" exist:
99
| fullname | shortname | category | groupmode |
1010
| Course 1 | C1 | 0 | 1 |
11+
# TODO MDL-57208 this functionality does not work without administration block.
12+
And I log in as "admin"
13+
And I am on site homepage
14+
And I turn editing mode on
15+
And I add the "Administration" block if not present
16+
And I configure the "Administration" block
17+
And I set the following fields to these values:
18+
| Page contexts | Display throughout the entire site |
19+
And I press "Save changes"
20+
And I log out
1121

1222
Scenario: Admin sets the site page and then the dashboard as the default home page
1323
Given I log in as "admin"
14-
And I navigate to "Navigation" node in "Site administration > Appearance"
24+
And I navigate to "Appearance > Navigation" in site administration
1525
And I set the field "Default home page for users" to "User preference"
1626
And I press "Save changes"
1727
And I am on site homepage

user/tests/behat/user_grade_navigation.feature

+7-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ Feature: The student can navigate to their grades page and user grade report.
6666
And I am on site homepage
6767
And I turn editing mode on
6868
And I add the "Mentees" block
69+
# TODO MDL-57216 this functionality should work without navigation block.
70+
And I add the "Navigation" block if not present
71+
And I configure the "Navigation" block
72+
And I set the following fields to these values:
73+
| Page contexts | Display throughout the entire site |
74+
And I press "Save changes"
6975
And I navigate to "Define roles" node in "Site administration > Users > Permissions"
7076
And I click on "Add a new role" "button"
7177
And I click on "Continue" "button"
@@ -89,7 +95,7 @@ Feature: The student can navigate to their grades page and user grade report.
8995
And I log in as "parent1"
9096
And I am on site homepage
9197
And I follow "Student 1"
92-
And I navigate to "Grades" node in "Users > Student 1"
98+
And I click on "Grades" "link" in the "Navigation" "block"
9399
Then the following should exist in the "overview-grade" table:
94100
| Course name | Grade |
95101
| Course 2 | - |

0 commit comments

Comments
 (0)