| Línea 23... |
Línea 23... |
| 23 |
| course | C1 |
|
23 |
| course | C1 |
|
| 24 |
| version | 1.1 |
|
24 |
| version | 1.1 |
|
| 25 |
| language | ca |
|
25 |
| language | ca |
|
| 26 |
| description | Testing course badge description |
|
26 |
| description | Testing course badge description |
|
| 27 |
| image | badges/tests/behat/badge.png |
|
27 |
| image | badges/tests/behat/badge.png |
|
| 28 |
| imageauthorurl | http://author.example.com |
|
- |
|
| 29 |
| imagecaption | Test caption image |
|
28 |
| imagecaption | Test caption image |
|
| 30 |
# Create a site badge.
|
29 |
# Create a site badge.
|
| 31 |
And the following "core_badges > Badge" exists:
|
30 |
And the following "core_badges > Badge" exists:
|
| 32 |
| name | Testing site badge |
|
31 |
| name | Testing site badge |
|
| 33 |
| status | inactive |
|
32 |
| status | inactive |
|
| 34 |
| version | 1.1 |
|
33 |
| version | 1.1 |
|
| 35 |
| language | ca |
|
34 |
| language | ca |
|
| 36 |
| description | Testing site badge description |
|
35 |
| description | Testing site badge description |
|
| 37 |
| image | badges/tests/behat/badge.png |
|
36 |
| image | badges/tests/behat/badge.png |
|
| 38 |
| imageauthorurl | http://author.example.com |
|
- |
|
| 39 |
| imagecaption | Test caption image |
|
37 |
| imagecaption | Test caption image |
|
| 40 |
And the following "core_badges > Criterias" exist:
|
38 |
And the following "core_badges > Criterias" exist:
|
| 41 |
| badge | role |
|
39 |
| badge | role |
|
| 42 |
| Testing course badge | editingteacher |
|
40 |
| Testing course badge | editingteacher |
|
| 43 |
| Testing site badge | editingteacher |
|
41 |
| Testing site badge | editingteacher |
|
| Línea 44... |
Línea 42... |
| 44 |
|
42 |
|
| 45 |
Scenario Outline: Check navigation as different users in a course context
|
43 |
Scenario Outline: Check navigation as different users in a course context
|
| 46 |
Given I log in as "<user>"
|
44 |
Given I log in as "<user>"
|
| 47 |
And I am on "Course 1" course homepage
|
45 |
And I am on "Course 1" course homepage
|
| 48 |
When I navigate to "Badges" in current page administration
|
- |
|
| 49 |
Then "Manage badges" "button" should exist
|
46 |
When I navigate to "Badges" in current page administration
|
| 50 |
And "Add a new badge" "button" <createbutton>
|
47 |
Then "Add a new badge" "button" <createbutton>
|
| 51 |
And I should see "<activetab>" is active in secondary navigation
|
- |
|
| 52 |
And I click on "Manage badges" "button"
|
- |
|
| 53 |
And "Manage badges" "button" should not exist
|
- |
|
| 54 |
And "Back" "button" should exist
|
- |
|
| 55 |
And "Add a new badge" "button" <createbutton>
|
- |
|
| 56 |
And I should see "<activetab>" is active in secondary navigation
|
- |
|
| 57 |
And I click on "Back" "button"
|
48 |
And I should see "<activetab>" is active in secondary navigation
|
| 58 |
And "Back" "button" should not exist
|
- |
|
| 59 |
And "Manage badges" "button" should exist
|
- |
|
| 60 |
And "Add a new badge" "button" <createbutton>
|
- |
|
| 61 |
And I should see "<activetab>" is active in secondary navigation
|
- |
|
| 62 |
And I click on "Manage badges" "button"
|
49 |
And "Back" "button" should not exist
|
| 63 |
And I click on "Testing course badge" "link"
|
- |
|
| 64 |
And "Manage badges" "button" should not exist
|
50 |
And I click on "Testing course badge" "link"
|
| 65 |
And "Add a new badge" "button" should not exist
|
51 |
And "Add a new badge" "button" should not exist
|
| 66 |
And "Back" "button" should exist
|
52 |
And "Back" "button" should exist
|
| 67 |
And I should see "<activetab>" is active in secondary navigation
|
53 |
And I should see "<activetab>" is active in secondary navigation
|
| 68 |
And I click on "Back" "button"
|
- |
|
| 69 |
And "Back" "button" should exist
|
- |
|
| 70 |
And "Manage badges" "button" should not exist
|
54 |
And I click on "Back" "button"
|
| 71 |
And "Add a new badge" "button" <createbutton>
|
55 |
And "Add a new badge" "button" <createbutton>
|
| Línea 72... |
Línea 56... |
| 72 |
And I should see "<activetab>" is active in secondary navigation
|
56 |
And I should see "<activetab>" is active in secondary navigation
|
| 73 |
|
57 |
|
| 74 |
Examples:
|
58 |
Examples:
|
| 75 |
| user | createbutton | activetab |
|
59 |
| user | createbutton | activetab |
|
| 76 |
| admin | should exist | More |
|
60 |
| admin | should exist | More |
|
| Línea 77... |
Línea 61... |
| 77 |
| teacher | should exist | More |
|
61 |
| teacher | should exist | More |
|
| 78 |
| nonediting | should not exist | Badges |
|
62 |
| nonediting | should not exist | More |
|
| 79 |
|
63 |
|
| 80 |
Scenario: Check navigation as a student
|
64 |
Scenario: Check navigation as a student
|
| 81 |
Given I am on the "C1" "Course" page logged in as "student1"
|
65 |
Given I am on the "C1" "Course" page logged in as "student1"
|
| 82 |
And "Badges" "link" should not exist in current page administration
|
66 |
And "Badges" "link" should not exist in current page administration
|
| 83 |
And I log out
|
67 |
And I log out
|
| 84 |
# Enable one badge.
|
- |
|
| 85 |
When I am on the "C1" "Course" page logged in as "admin"
|
68 |
# Enable one badge.
|
| 86 |
And I navigate to "Badges" in current page administration
|
69 |
When I am on the "C1" "Course" page logged in as "admin"
|
| 87 |
And I click on "Manage badges" "button"
|
70 |
And I navigate to "Badges" in current page administration
|
| 88 |
And I press "Enable access" action in the "Testing course badge" report row
|
71 |
And I press "Enable access" action in the "Testing course badge" report row
|
| 89 |
And I press "Continue"
|
72 |
And I click on "Enable" "button" in the "Confirm" "dialogue"
|
| 90 |
And I log out
|
73 |
And I log out
|
| 91 |
# Now student should see the Badges link.
|
74 |
# Now student should see the Badges link.
|
| 92 |
And I am on the "C1" "Course" page logged in as "student1"
|
75 |
And I am on the "C1" "Course" page logged in as "student1"
|
| 93 |
Then "Badges" "link" should exist in current page administration
|
- |
|
| 94 |
And I navigate to "Badges" in current page administration
|
76 |
Then "Badges" "link" should exist in current page administration
|
| 95 |
And "Back" "button" should not exist
|
77 |
And I navigate to "Badges" in current page administration
|
| Línea 96... |
Línea 78... |
| 96 |
And "Manage badges" "button" should not exist
|
78 |
And "Back" "button" should not exist
|
| 97 |
And "Add a new badge" "button" should not exist
|
79 |
And "Add a new badge" "button" should not exist
|
| 98 |
And I should see "Badges" is active in secondary navigation
|
80 |
And I should see "Badges" is active in secondary navigation
|
| 99 |
|
- |
|
| 100 |
Scenario: Check navigation as an admin in a site context
|
81 |
|
| 101 |
Given I log in as "admin"
|
82 |
Scenario: Check navigation as an admin in a site context
|
| 102 |
When I navigate to "Badges > Manage badges" in site administration
|
83 |
Given I log in as "admin"
|
| 103 |
Then "Manage badges" "button" should not exist
|
- |
|
| 104 |
And "Add a new badge" "button" should exist
|
84 |
When I navigate to "Badges > Manage badges" in site administration
|
| 105 |
And I should see "General" is active in secondary navigation
|
85 |
Then "Add a new badge" "button" should exist
|
| 106 |
And I click on "Testing site badge" "link"
|
86 |
And I should see "General" is active in secondary navigation
|
| 107 |
And "Manage badges" "button" should not exist
|
87 |
And I click on "Testing site badge" "link"
|
| 108 |
And "Add a new badge" "button" should not exist
|
88 |
And "Add a new badge" "button" should not exist
|
| 109 |
And "Back" "button" should exist
|
- |
|
| 110 |
And I should see "General" is active in secondary navigation
|
89 |
And "Back" "button" should exist
|
| Línea 111... |
Línea 90... |
| 111 |
And I click on "Back" "button"
|
90 |
And I should see "General" is active in secondary navigation
|
| 112 |
And "Back" "button" should not exist
|
91 |
And I click on "Back" "button"
|
| 113 |
And "Manage badges" "button" should not exist
|
92 |
And "Back" "button" should not exist
|
| Línea 133... |
Línea 112... |
| 133 |
|
112 |
|
| 134 |
Scenario Outline: Check secondary navigation highlights after tertiary nav jumps in course as admin
|
113 |
Scenario Outline: Check secondary navigation highlights after tertiary nav jumps in course as admin
|
| 135 |
Given I log in as "admin"
|
114 |
Given I log in as "admin"
|
| 136 |
And I am on "Course 1" course homepage
|
115 |
And I am on "Course 1" course homepage
|
| 137 |
And I navigate to "Badges" in current page administration
|
- |
|
| 138 |
And I click on "Manage badges" "button"
|
116 |
And I navigate to "Badges" in current page administration
|
| 139 |
And I click on "Testing course badge" "link"
|
117 |
And I click on "Testing course badge" "link"
|
| 140 |
When I select "<option>" from the "jump" singleselect
|
118 |
When I select "<option>" from the "jump" singleselect
|
| Línea 141... |
Línea 119... |
| 141 |
Then I should see "More" is active in secondary navigation
|
119 |
Then I should see "More" is active in secondary navigation
|