Skip to content

Commit 11b251f

Browse files
Merge pull request #4545 from dpalou/MOBILE-4842
MOBILE-4842 behat: Disable activity modules behats in 5.1+
2 parents ef68562 + df3042a commit 11b251f

12 files changed

+100
-23
lines changed

src/addons/block/activitymodules/tests/behat/block_activitymodules.feature

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
@addon_block_activity_modules @app @block @block_activity_modules @javascript
1+
@addon_block_activity_modules @app @block @block_activity_modules @javascript @lms_upto5.0
22
Feature: Basic tests of activity modules block
33

44
Background:
5-
Given the following "users" exist:
5+
Given the Moodle site is compatible with this feature
6+
And the following "users" exist:
67
| username | firstname | lastname | email | idnumber |
78
| student1 | Student | 1 | student1@example.com | S1 |
89
And the following "courses" exist:

src/addons/block/sitemainmenu/tests/behat/block_sitemainmenu-405.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@addon_block_site_main_menu @app @block @block_site_main_menu @javascript @lms_upto4.5
2-
Feature: Basic tests of Main menu block
2+
Feature: Basic tests of Additional activities block
33

44
Background:
55
Given the Moodle site is compatible with this feature
@@ -10,19 +10,19 @@ Feature: Basic tests of Main menu block
1010
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
1111
| site_main_menu | System | 1 | site-index | side-pre |
1212

13-
Scenario: View the Main menu block in site home
13+
Scenario: View the Additional activities block in site home
1414
Given the following "activities" exist:
1515
| activity | course | section | name |
1616
| forum | Acceptance test site | 0 | My forum name |
1717
And I entered the app as "student1"
1818
When I press "Site home" in the app
1919
And I press "Open block drawer" in the app
20-
Then I should find "My forum name" within "Main menu" "ion-card" in the app
20+
Then I should find "My forum name" within "Additional activities" "ion-card" in the app
2121
When I press "My forum name" in the app
2222
Then the header should be "My forum name" in the app
2323

2424
@lms_from4.3
25-
Scenario: Activities in main menu block can be made available but not visible on a course page
25+
Scenario: Activities in additional activities block can be made available but not visible on a course page
2626
Given the following config values are set as admin:
2727
| allowstealth | 1 |
2828
And the following "activities" exist:
@@ -37,8 +37,8 @@ Feature: Basic tests of Main menu block
3737
And I entered the app as "student1"
3838
When I press "Site home" in the app
3939
And I press "Open block drawer" in the app
40-
Then I should find "Visible forum" within "Main menu" "ion-card" in the app
41-
Then I should not find "My forum name" within "Main menu" "ion-card" in the app
40+
Then I should find "Visible forum" within "Additional activities" "ion-card" in the app
41+
Then I should not find "My forum name" within "Additional activities" "ion-card" in the app
4242
When I press "Visible forum" in the app
4343
Then the header should be "Visible forum" in the app
4444

@@ -52,4 +52,4 @@ Feature: Basic tests of Main menu block
5252
And I entered the app as "student1"
5353
When I press "Site home" in the app
5454
And I press "Open block drawer" in the app
55-
Then I should not find "Main menu" in the app
55+
Then I should not find "Additional activities" in the app
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
@addon_coursecompletion @app @block @block_completionstatus @block_selfcompletion @javascript @lms_upto5.0
2+
Feature: Course completion navigation
3+
4+
Background:
5+
Given the Moodle site is compatible with this feature
6+
And the following "users" exist:
7+
| username | firstname | lastname | email | idnumber |
8+
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
9+
| student1 | Student | 1 | student1@example.com | S1 |
10+
And the following "courses" exist:
11+
| fullname | shortname | category | enablecompletion | showcompletionconditions |
12+
| Course 1 | C1 | 0 | 1 | 1 |
13+
| Course 2 | C2 | 0 | | |
14+
And the following "course enrolments" exist:
15+
| user | course | role |
16+
| teacher1 | C1 | editingteacher |
17+
| teacher1 | C2 | editingteacher |
18+
| student1 | C1 | student |
19+
| student1 | C2 | student |
20+
And the following "activity" exists:
21+
| activity | assign |
22+
| course | C1 |
23+
| name | Test assignment name |
24+
| assignsubmission_onlinetext_enabled | 1 |
25+
| grade[modgrade_type] | Point |
26+
| grade[modgrade_point] | 100 |
27+
| gradepass | 70 |
28+
| completion | 2 |
29+
| completionusegrade | 1 |
30+
| completionpassgrade | 1 |
31+
And the following "activity" exists:
32+
| activity | page |
33+
| course | C2 |
34+
| name | P1 |
35+
And I enable "selfcompletion" "block" plugin
36+
And the following "blocks" exist:
37+
| blockname | contextlevel | reference | pagetypepattern | defaultregion | configdata |
38+
| completionstatus | Course | C1 | course-view-* | side-pre | |
39+
| selfcompletion | Course | C1 | course-view-* | side-pre | |
40+
| html | Course | C1 | course-view-* | side-pre | Tzo4OiJzdGRDbGFzcyI6Mjp7czo1OiJ0aXRsZSI7czoxNToiSFRNTCB0aXRsZSB0ZXN0IjtzOjQ6InRleHQiO3M6OToiYm9keSB0ZXN0Ijt9 |
41+
| completionstatus | Course | C2 | course-view-* | side-pre | |
42+
| selfcompletion | Course | C2 | course-view-* | side-pre | |
43+
| html | Course | C2 | course-view-* | side-pre | Tzo4OiJzdGRDbGFzcyI6Mjp7czo1OiJ0aXRsZSI7czoxNToiSFRNTCB0aXRsZSB0ZXN0IjtzOjQ6InRleHQiO3M6OToiYm9keSB0ZXN0Ijt9 |
44+
And the following config values are set as admin:
45+
| enablecompletion | 1 |
46+
And I am on the "Course 1" course page logged in as teacher1
47+
And I navigate to "Course completion" in current page administration
48+
And I click on "Condition: Activity completion" "link"
49+
And I set the field "Assignment - Test assignment name" to "1"
50+
And I expand all fieldsets
51+
And I set the following fields to these values:
52+
| id_criteria_self | 1 |
53+
And I press "Save changes"
54+
55+
Scenario: Completion is available only when enabled for the course
56+
Given I entered the course "Course 1" as "student1" in the app
57+
When I press "Open block drawer" in the app
58+
Then I should find "Course completion status" in the app
59+
And I should find "Self completion" in the app
60+
When I press "Close" in the app
61+
And I press "Completion" in the app
62+
Then I should find "Status" in the app
63+
64+
Given I entered the course "Course 2" as "student1" in the app
65+
When I press "Open block drawer" in the app
66+
Then I should not find "Course completion status" in the app
67+
And I should not find "Self completion" in the app
68+
When I press "Close" in the app
69+
Then I should not find "Completion" in the app
70+
71+
Given the following config values are set as admin:
72+
| enablecompletion | 0 |
73+
Then I entered the course "Course 1" as "student1" in the app
74+
And I pull to refresh in the app
75+
When I press "Open block drawer" in the app
76+
Then I should not find "Course completion status" in the app
77+
And I should not find "Self completion" in the app
78+
When I press "Close" in the app
79+
Then I should not find "Completion" in the app

src/addons/coursecompletion/tests/behat/navigation.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@addon_coursecompletion @app @block @block_completionstatus @block_selfcompletion @javascript
1+
@addon_coursecompletion @app @block @block_completionstatus @block_selfcompletion @javascript @lms_from5.1
22
Feature: Course completion navigation
33

44
Background:
@@ -34,13 +34,13 @@ Feature: Course completion navigation
3434
| name | P1 |
3535
And I enable "selfcompletion" "block" plugin
3636
And the following "blocks" exist:
37-
| blockname | contextlevel | reference |
38-
| completionstatus | Course | C1 |
39-
| selfcompletion | Course | C1 |
40-
| activity_modules | Course | C1 |
41-
| completionstatus | Course | C2 |
42-
| selfcompletion | Course | C2 |
43-
| activity_modules | Course | C2 |
37+
| blockname | contextlevel | reference | pagetypepattern | defaultregion | configdata |
38+
| completionstatus | Course | C1 | course-view-* | side-pre | |
39+
| selfcompletion | Course | C1 | course-view-* | side-pre | |
40+
| html | Course | C1 | course-view-* | side-pre | Tzo4OiJzdGRDbGFzcyI6Mjp7czo1OiJ0aXRsZSI7czoxNToiSFRNTCB0aXRsZSB0ZXN0IjtzOjQ6InRleHQiO3M6OToiYm9keSB0ZXN0Ijt9 |
41+
| completionstatus | Course | C2 | course-view-* | side-pre | |
42+
| selfcompletion | Course | C2 | course-view-* | side-pre | |
43+
| html | Course | C2 | course-view-* | side-pre | Tzo4OiJzdGRDbGFzcyI6Mjp7czo1OiJ0aXRsZSI7czoxNToiSFRNTCB0aXRsZSB0ZXN0IjtzOjQ6InRleHQiO3M6OToiYm9keSB0ZXN0Ijt9 |
4444
And the following config values are set as admin:
4545
| enablecompletion | 1 |
4646
And I am on the "Course 1" course page logged in as teacher1

src/addons/mod/assign/tests/behat/basic_usage.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Feature: Test basic usage of assignment activity in app
7575
Given I entered the assign activity "assignment1" on course "Course 1" as "student1" in the app
7676
Then I should find "assignment1" in the app
7777

78-
When I replace "/Assignment is overdue by: .*/" within "addon-mod-assign-submission core-tabs ion-item:nth-child(2)" with "Assignment is overdue by: [Overdue date]"
78+
When I replace "/Assignment is overdue by: .*/" within "addon-mod-assign-submission ion-item.overdue" with "Assignment is overdue by: [Overdue date]"
7979
Then the UI should match the snapshot
8080

8181
When I press "Add submission" in the app

src/addons/mod/assign/tests/behat/single_activity.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Feature: Test single activity of assign type in app
2424

2525
When I set "page-core-course-index core-course-image" styles to "background" "lightblue"
2626
And I set "page-core-course-index core-course-image" styles to "--core-image-visibility" "hidden"
27+
And I replace "/Assignment is overdue by: .*/" within "addon-mod-assign-submission ion-item.overdue" with "Assignment is overdue by: [Overdue date]"
2728
Then the UI should match the snapshot
2829

2930
And I press "Add submission" in the app
Loading

src/addons/mod/chat/tests/behat/basic_usage.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Feature: Test basic usage of chat in app
8383
Given I entered the chat activity "Test chat name" on course "Course 1" as "student2" in the app
8484
When I press "Past sessions" in the app
8585
And I press "Show incomplete sessions" in the app
86-
And I press "david student" near "(2)" in the app
86+
And I press "david student" in the app
8787
Then I should find "Hi!" in the app
8888
And I should find "I am David" in the app
8989

0 commit comments

Comments
 (0)