mirrored from git://git.moodle.org/moodle.git
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-56993 boost: Add behat tests for boost nav menus
- Loading branch information
Damyon Wiese
committed
Nov 23, 2016
1 parent
ea5084f
commit c0f8986
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@javascript @theme_boost | ||
Feature: Context settings menu | ||
To navigate in boost theme I need to use the context settings menu | ||
|
||
Background: | ||
Given the following "courses" exist: | ||
| fullname | shortname | | ||
| Course 1 | C1 | | ||
And the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| teacher1 | Teacher | 1 | teacher1@example.com | | ||
| student1 | Student | 1 | student1@example.com | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| teacher1 | C1 | editingteacher | | ||
| student1 | C1 | student | | ||
|
||
Scenario: Teacher can use the context settings menu | ||
And I log in as "teacher1" | ||
And I am on site homepage | ||
And I follow "Course 1" | ||
And I click on ".context-header-settings-menu [role=button]" "css_element" | ||
And I choose "Edit settings" in the open action menu | ||
And I should see "Edit course settings" | ||
And I log out | ||
|
||
Scenario: Student cannot use the context settings menu | ||
And I log in as "student1" | ||
And I am on site homepage | ||
And I follow "Course 1" | ||
And ".context-header-settings-menu [role=button]" "css_element" should not exist | ||
And I log out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@javascript @theme_boost | ||
Feature: Region main settings menu | ||
To navigate in boost theme I need to use the region main settings menu | ||
|
||
Background: | ||
Given the following "courses" exist: | ||
| fullname | shortname | newsitems | | ||
| Course 1 | C1 | 5 | | ||
And the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| teacher1 | Teacher | 1 | teacher1@example.com | | ||
| student1 | Student | 1 | student1@example.com | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| teacher1 | C1 | editingteacher | | ||
| student1 | C1 | student | | ||
And the following "activities" exist: | ||
| activity | name | intro | course | idnumber | option | | ||
| choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | | ||
|
||
Scenario: Teacher can use the region main settings menu | ||
And I log in as "teacher1" | ||
And I am on site homepage | ||
And I follow "Course 1" | ||
And "#region-main-settings-menu [role=button]" "css_element" should not exist | ||
And I follow "Choice name" | ||
And I click on "#region-main-settings-menu [role=button]" "css_element" | ||
And I choose "Edit settings" in the open action menu | ||
And I should see "Updating: Choice" | ||
And I follow "Participants" | ||
And I click on "#region-main-settings-menu [role=button]" "css_element" | ||
And I choose "Enrolment methods" in the open action menu | ||
And I should see "Enrolment methods" | ||
And I log out | ||
|
||
Scenario: Student cannot use all options in the region main settings menu | ||
And I log in as "student1" | ||
And I am on site homepage | ||
And I follow "Course 1" | ||
And "#region-main-settings-menu [role=button]" "css_element" should not exist | ||
And I follow "Choice name" | ||
And "#region-main-settings-menu [role=button]" "css_element" should not exist | ||
And I log out |