Skip to content

Commit

Permalink
MDL-56614 behat: navigate without navigation and admin blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Dec 6, 2016
1 parent 50bd633 commit e5287f9
Show file tree
Hide file tree
Showing 169 changed files with 585 additions and 656 deletions.
3 changes: 1 addition & 2 deletions admin/tests/behat/display_short_names.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ Feature: Display extended course names
And I should not see "C_shortname Course fullname"

Scenario: Courses list with extended course names
Given I expand "Site administration" node
And I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][contains(., 'Appearance')]" "xpath_element"
Given I navigate to "Appearance > Courses" in site administration
And I set the field "Display extended course names" to "1"
When I press "Save changes"
And I am on site homepage
Expand Down
2 changes: 1 addition & 1 deletion admin/tests/behat/filter_users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
And I log in as "admin"
And I add "User Two ([email protected])" user to "CH1" cohort members
And I add "User Three ([email protected])" user to "CH1" cohort members
And I follow "Browse list of users"
And I navigate to "Users > Accounts > Browse list of users" in site administration

Scenario: Filter user accounts by role and cohort
When I set the following fields to these values:
Expand Down
25 changes: 11 additions & 14 deletions admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I navigate to "Users > Groups" in current page administration
Then I should see "Group 1"
And I should see "Group 2"
And I follow "Groupings"
Expand Down Expand Up @@ -90,8 +89,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Permissions"
And I navigate to "Users > Permissions" in current page administration
And I set the field "Advanced role override" to "Student (1)"
Then "mod/forum:editanypost" capability has "Allow" permission
And I press "Cancel"
Expand Down Expand Up @@ -134,30 +132,31 @@ Feature: Set up contextual data for tests
And the following "course enrolments" exist:
| user | course | role |
| user4 | C1 | custom1 |
| user2 | C1 | student |
| user3 | C1 | editingteacher |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| user1 | manager | System | |
| user2 | editingteacher | Category | CAT1 |
| user3 | editingteacher | Course | C1 |
| user5 | custom2 | System | |
When I log in as "user1"
And I am on site homepage
Then I should see "Front page settings"
Then "Edit settings" "link" should exist in current page administration
And I log out
And I log in as "user2"
And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And "Turn editing on" "link" should exist in current page administration
And I log out
And I log in as "user3"
And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And "Turn editing on" "link" should exist in current page administration
And I log out
And I log in as "user4"
And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And "Turn editing on" "link" should exist in current page administration
And I log out
And I log in as "user5"
And I should see "You are logged in as"
Expand Down Expand Up @@ -264,8 +263,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I navigate to "Users > Groups" in current page administration
Then the "groups" select box should contain "Group 1 (1)"
And the "groups" select box should contain "Group 2 (1)"
And I set the field "groups" to "Group 1 (1)"
Expand Down Expand Up @@ -302,7 +300,7 @@ Feature: Set up contextual data for tests
| System cohort A | 1 |
| System cohort B | 2 |
And I should not see "Cohort in category"
And I follow "Courses"
And I am on course index
And I follow "Cat 1"
And I follow "Cohorts"
And I should not see "System cohort"
Expand All @@ -322,8 +320,7 @@ Feature: Set up contextual data for tests
| fullname | course | gradecategory |
| Grade sub category 2 | C1 | Grade category 1 |
When I log in as "admin"
And I am on site homepage
And I follow "Courses"
And I am on course index
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
Then I should see "Grade category 1"
Expand Down
5 changes: 2 additions & 3 deletions admin/tool/behat/tests/behat/edit_permissions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ Feature: Edit capabilities
Scenario: Course capabilities overrides
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Permissions"
And I navigate to "Users > Permissions" in current page administration
And I override the system permissions of "Student" role with:
| mod/forum:deleteanypost | Prohibit |
| mod/forum:editanypost | Prevent |
Expand All @@ -52,7 +51,7 @@ Feature: Edit capabilities
| Forum name | I'm the name |
| Description | I'm the introduction |
And I follow "I'm the name"
And I navigate to "Permissions" node in "Forum administration"
And I navigate to "Permissions" in current page administration
And I override the system permissions of "Student" role with:
| mod/forum:deleteanypost | Prohibit |
| mod/forum:editanypost | Prevent |
Expand Down
14 changes: 5 additions & 9 deletions admin/tool/behat/tests/behat/get_and_set_fields.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ Feature: Verify that all form fields values can be get and set
| activity | course | idnumber | name | intro | firstpagetitle | wikimode | visible |
| wiki | C1 | wiki1 | Test this one | Test this one | Test this one | collaborative | 0 |
And I log in as "admin"
And I expand "Site administration" node
And I expand "Appearance" node
And I am on site homepage
And I follow "Course 1"
And I navigate to "Reset" node in "Course administration"
Expand All @@ -60,9 +58,8 @@ Feature: Verify that all form fields values can be get and set
| HTML format | Student page contents |
And I press "Save"
Then I should see "Student page contents" in the "region-main" "region"
And I click on "Edit" "link" in the "Administration" "block"
# Select (multi-select) - Checking "I set the field".
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
# Checkbox - Checking "I set the field".
And I set the field "Display description on course page" to "1"
Expand All @@ -75,7 +72,7 @@ Feature: Verify that all form fields values can be get and set
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
# Checkbox - Checking "the field matches value" and "the following fields match these values".
And the following fields match these values:
| Display description on course page | 1 |
Expand All @@ -91,7 +88,7 @@ Feature: Verify that all form fields values can be get and set
# Select (simple) - Checking "I set the field".
And I set the field "Group mode" to "Separate groups"
And I press "Save and display"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
And the following fields match these values:
| Default format | NWiki |
| Group mode | Separate groups |
Expand Down Expand Up @@ -134,8 +131,7 @@ Feature: Verify that all form fields values can be get and set
@javascript
Scenario: with JS enabled all form fields getters and setters works as expected
Then I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I navigate to "Users > Groups" in current page administration
# Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain".
And I set the field "groups" to "Group 2"
And the "members" select box should contain "Student 2"
Expand All @@ -158,7 +154,7 @@ Feature: Verify that all form fields values can be get and set
And the "available[day]" "field" should be enabled
And the field "deadline[enabled]" matches value "1"
And I press "Save and display"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
And the field "available[enabled]" matches value "1"
And the "available[day]" "field" should be enabled
And the field "deadline[enabled]" matches value "1"
Expand Down
15 changes: 6 additions & 9 deletions admin/tool/lp/tests/behat/framework_crud.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ Feature: Manage competency frameworks
Background:
Given I log in as "admin"
And I am on site homepage
And I expand "Site administration" node
When I expand "Competencies" node
Then I should see "Competency frameworks"

Scenario: Create a new framework
Given I follow "Competency frameworks"
Given I navigate to "Competencies > Competency frameworks" in site administration
And I should see "List of competency frameworks"
And I click on "Add new competency framework" "button"
And I should see "General"
Expand All @@ -34,7 +31,7 @@ Feature: Manage competency frameworks
Given the following lp "frameworks" exist:
| shortname | idnumber |
| Science Year-2 | sc-y-2 |
And I follow "Competency frameworks"
And I navigate to "Competencies > Competency frameworks" in site administration
And I should see "Science Year-2"
When I click on "Science Year-2" "link"
Then I should see "Science Year-2"
Expand All @@ -43,7 +40,7 @@ Feature: Manage competency frameworks
Given the following lp "frameworks" exist:
| shortname | idnumber |
| Science Year-3 | sc-y-3 |
And I follow "Competency frameworks"
And I navigate to "Competencies > Competency frameworks" in site administration
And I should see "Science Year-3"
And I click on "Edit" of edit menu in the "Science Year-3" row
And the field "Name" matches value "Science Year-3 "
Expand All @@ -57,7 +54,7 @@ Feature: Manage competency frameworks
Given the following lp "frameworks" exist:
| shortname | idnumber |
| Science Year-4 | sc-y-4 |
And I follow "Competency frameworks"
And I navigate to "Competencies > Competency frameworks" in site administration
And I should see "Science Year-4"
And I should see "sc-y-4"
And I click on "Delete" of edit menu in the "Science Year-4" row
Expand Down Expand Up @@ -90,7 +87,7 @@ Scenario: Edit a framework with competencies in user competency
| user | competency |
| admin | Comp1 |
| admin | Comp2 |
And I follow "Competency frameworks"
And I navigate to "Competencies > Competency frameworks" in site administration
And I should see "Science Year-5"
And I click on "Edit" of edit menu in the "Science Year-5" row
And the field "Name" matches value "Science Year-5 "
Expand Down Expand Up @@ -120,7 +117,7 @@ Scenario: Edit a framework with competencies in user competency plan
| user | competency | plan |
| admin | Comp1 | Plan Science-6 |
| admin | Comp2 | Plan Science-6 |
And I follow "Competency frameworks"
And I navigate to "Competencies > Competency frameworks" in site administration
And I should see "Science Year-6"
And I click on "Edit" of edit menu in the "Science Year-6" row
And the field "Name" matches value "Science Year-6 "
Expand Down
8 changes: 2 additions & 6 deletions admin/tool/lp/tests/behat/plan_crud.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ Feature: Manage plearning plan
| shortname | description |
| Science template | science template description |
And I follow "Home"
And I expand "Site administration" node
And I expand "Competencies" node
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I click on ".template-userplans" "css_element" in the "Science template" "table_row"
And I click on ".form-autocomplete-downarrow" "css_element"
And I click on "Admin" item in the autocomplete list
Expand All @@ -52,9 +50,7 @@ Feature: Manage plearning plan
| student-plan1 | COHORTPLAN |
| student-plan2 | COHORTPLAN |
And I follow "Home"
And I expand "Site administration" node
And I expand "Competencies" node
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I click on ".template-cohorts" "css_element" in the "Science template cohort" "table_row"
And I click on ".form-autocomplete-downarrow" "css_element"
And I click on "cohort plan" item in the autocomplete list
Expand Down
15 changes: 3 additions & 12 deletions admin/tool/lp/tests/behat/plan_workflow.feature
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@ Feature: Manage plan workflow
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
And I log in as "manager1"
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
And I follow "Browse list of users"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
And I follow "Learning plans"
And I should see "List of learning plans"
Expand All @@ -167,10 +164,7 @@ Feature: Manage plan workflow
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
And I log in as "manager1"
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
And I follow "Browse list of users"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
And I follow "Learning plans"
And I should see "List of learning plans"
Expand All @@ -191,10 +185,7 @@ Scenario: Manager reopen a complete learning plan
| Test-Plan3 | user1 | Description of plan 3 for user 1 | complete | manager1 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | complete | manager1 |
And I log in as "manager1"
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
And I follow "Browse list of users"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
And I follow "Learning plans"
And I should see "List of learning plans"
Expand Down
11 changes: 4 additions & 7 deletions admin/tool/lp/tests/behat/template_crud.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ Feature: Manage plearning plan templates
Background:
Given I log in as "admin"
And I am on site homepage
And I expand "Site administration" node
When I expand "Competencies" node
Then I should see "Learning plan templates"

Scenario: Create a new learning plan template
Given I follow "Learning plan templates"
Given I navigate to "Competencies > Learning plan templates" in site administration
And I should see "List of learning plan templates"
And I click on "Add new learning plan template" "button"
And I should see "Add new learning plan template"
Expand All @@ -26,7 +23,7 @@ Feature: Manage plearning plan templates
Given the following lp "templates" exist:
| shortname | description |
| Science template Year-2 | science template description |
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I should see "Science template Year-2"
When I click on "Science template Year-2" "link"
Then I should see "Science template Year-2"
Expand All @@ -36,7 +33,7 @@ Feature: Manage plearning plan templates
Given the following lp "templates" exist:
| shortname | description |
| Science template Year-3 | science template description |
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I should see "Science template Year-3"
And I click on "Edit" of edit menu in the "Science template Year-3" row
And the field "Name" matches value "Science template Year-3"
Expand All @@ -49,7 +46,7 @@ Feature: Manage plearning plan templates
Given the following lp "templates" exist:
| shortname | description |
| Science template Year-4 | science template description |
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I should see "Science template Year-4"
And I click on "Delete" of edit menu in the "Science template Year-4" row
And "Confirm" "dialogue" should be visible
Expand Down
5 changes: 2 additions & 3 deletions admin/tool/uploaduser/tests/behat/upload_users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ Feature: Upload users
And I should see "Section 1"
And I press "Upload users"
And I press "Continue"
And I follow "Browse list of users"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I should see "Tom Jones"
And I should see "Trent Reznor"
And I should see "[email protected]"
And I am on site homepage
And I follow "Maths"
And I expand "Users" node
And I follow "Groups"
And I navigate to "Users > Groups" in current page administration
And I set the field "groups" to "Section 1 (1)"
And the "members" select box should contain "Tom Jones"

Expand Down
8 changes: 4 additions & 4 deletions admin/tool/usertours/tests/behat/create_tour.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: Add a new user tour
And I add steps to the "First tour" tour:
| targettype | targetvalue_selector | Title | Content |
| Selector | .usermenu | User menu | This is your personal user menu. You'll find your personal preferences and your user profile here. |
When I click on "Dashboard" "link" in the "Navigation" "block"
When I am on homepage
Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
And I press "Next"
And I should see "This area shows you what's happening in some of your courses"
Expand All @@ -38,7 +38,7 @@ Feature: Add a new user tour
And I should see "This area shows you what's happening in some of your courses"
And I press "End tour"
And I should not see "This area shows you what's happening in some of your courses"
And I click on "Dashboard" "link" in the "Navigation" "block"
And I am on homepage
And I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
And I should not see "This area shows you what's happening in some of your courses"
And I follow "Reset user tour on this page"
Expand All @@ -58,7 +58,7 @@ Feature: Add a new user tour
And I add steps to the "First tour" tour:
| targettype | Title | Content |
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
When I click on "Dashboard" "link" in the "Navigation" "block"
When I am on homepage
Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"

@javascript
Expand All @@ -77,5 +77,5 @@ Feature: Add a new user tour
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
And I open the User tour settings page
When I click on "Enable" "link" in the "My first tour" "table_row"
And I click on "Dashboard" "link" in the "Navigation" "block"
And I am on homepage
Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
Loading

0 comments on commit e5287f9

Please sign in to comment.