Skip to content

Commit

Permalink
MDL-58265 core_test: remove unnecessary steps
Browse files Browse the repository at this point in the history
This commmit removes steps that take behat to site home page
to actually get to a course page.

Part of MDL-55611 epic.
  • Loading branch information
lameze authored and Damyon Wiese committed Apr 3, 2017
1 parent c987d1b commit 93be3f7
Show file tree
Hide file tree
Showing 60 changed files with 7 additions and 162 deletions.
13 changes: 0 additions & 13 deletions admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Feature: Set up contextual data for tests
| Grouping 1 | C1 | GG1 |
| Grouping 2 | C1 | GG2 |
When I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I navigate to "Users > Groups" in current page administration
Then I should see "Group 1"
Expand Down Expand Up @@ -87,7 +86,6 @@ Feature: Set up contextual data for tests
| mod/forum:editanypost | Allow | student | Course | C1 |
| mod/forum:replynews | Prevent | editingteacher | Course | C1 |
When I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I navigate to "Users > Permissions" in current page administration
And I set the field "Advanced role override" to "Student (1)"
Expand Down Expand Up @@ -144,23 +142,19 @@ Feature: Set up contextual data for tests
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 am on course page "Course 1"
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 am on course page "Course 1"
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 am on course page "Course 1"
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"
And I am on site homepage
And I am on course page "Course 1"
And I should see "You can not enrol yourself in this course."

Expand Down Expand Up @@ -199,7 +193,6 @@ Feature: Set up contextual data for tests
| activity | name | intro | course | idnumber | grade |
| assign | Test assignment name with scale | Test assignment description | C1 | assign1 | Test Scale 1 |
When I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
Then I should see "Test assignment name"
# Assignment 2.2 module type is disabled by default
Expand Down Expand Up @@ -261,7 +254,6 @@ Feature: Set up contextual data for tests
| grouping | group |
| GG1 | G1 |
When I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I navigate to "Users > Groups" in current page administration
Then the "groups" select box should contain "Group 1 (1)"
Expand Down Expand Up @@ -344,7 +336,6 @@ Feature: Set up contextual data for tests
| Test Grade Item 2 | C1 | Grade category 1 |
| Test Grade Item 3 | C1 | Grade sub category 2 |
When I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Grade Item 1"
Expand Down Expand Up @@ -373,7 +364,6 @@ Feature: Set up contextual data for tests
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
When I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I navigate to "Scales" in the course gradebook
Then I should see "Test Scale 1"
Expand All @@ -395,7 +385,6 @@ Feature: Set up contextual data for tests
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I follow "Outcomes"
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
Expand Down Expand Up @@ -424,7 +413,6 @@ Feature: Set up contextual data for tests
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Outcome Grade Item 1"
Expand All @@ -442,6 +430,5 @@ Feature: Set up contextual data for tests
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| online_users | Course | C1 | course-view-* | site-pre |
When I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
Then I should see "Online users"
3 changes: 0 additions & 3 deletions admin/tool/behat/tests/behat/get_and_set_fields.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +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 am on site homepage
And I am on course page "Course 1"
And I navigate to "Reset" node in "Course administration"
# Select (multi-select) - Checking "the select box should contain".
Expand All @@ -48,7 +47,6 @@ Feature: Verify that all form fields values can be get and set
And the "Unenrol users" select box should not contain "President"
And the "Unenrol users" select box should not contain "Baker"
And the "Unenrol users" select box should not contain "President, Baker"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on
And I follow "Test this one"
Expand Down Expand Up @@ -115,7 +113,6 @@ Feature: Verify that all form fields values can be get and set
And the field "one" matches value "1"
And the field "two" matches value ""
# Check if field xpath set/match works.
And I am on site homepage
And I am on course page "Course 1"
And I navigate to "Edit settings" node in "Course administration"
And I set the field with xpath "//input[@id='id_idnumber']" to "Course id number"
Expand Down
2 changes: 0 additions & 2 deletions admin/tool/monitor/tests/behat/subscription.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Feature: tool_monitor_subscriptions
And I log in as "admin"
And I navigate to "Event monitoring rules" node in "Site administration > Reports"
And I click on "Enable" "link"
And I am on site homepage
And I am on course page "Course 1"
And I navigate to "Event monitoring rules" node in "Course administration > Reports"
And I press "Add a new rule"
Expand Down Expand Up @@ -132,7 +131,6 @@ Feature: tool_monitor_subscriptions
And I follow "Subscribe to rule \"New rule course level\""
And I should see "Subscription successfully created"
And "#toolmonitorsubs_r0" "css_element" should exist
And I am on site homepage
And I am on course page "Course 1"
And I trigger cron
And I am on site homepage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Feature: availability_completion
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on

Expand All @@ -48,7 +47,6 @@ Feature: availability_completion
# Log back in as student.
When I log out
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"

# Page 2 should not appear yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Feature: availability_date
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on

Expand Down Expand Up @@ -55,7 +54,6 @@ Feature: availability_date
# Log back in as student.
When I log out
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"

# Page 1 should appear, but page 2 does not.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Feature: availability_grade
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on

Expand Down Expand Up @@ -91,7 +90,6 @@ Feature: availability_grade
# Log in as student without a grade yet.
When I log out
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"

# Do the assignment.
Expand All @@ -110,7 +108,6 @@ Feature: availability_grade
# Log back in as teacher.
When I log out
And I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"

# Give the assignment 40%.
Expand All @@ -126,7 +123,6 @@ Feature: availability_grade
# Log back in as student.
And I log out
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"

# Check pages are visible.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Feature: availability_group
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on

Expand All @@ -39,7 +38,6 @@ Feature: availability_group
| G2 | C1 | GI2 |
# This step used to be 'And I follow "C1"', but Chrome thinks the breadcrumb
# is not clickable, so we'll go via the home page instead.
And I am on site homepage
And I am on course page "Course 1"
And I add a "Page" to section "1"
And I expand all fieldsets
Expand Down Expand Up @@ -85,7 +83,6 @@ Feature: availability_group
# Log back in as student.
When I log out
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"

# No pages should appear yet.
Expand All @@ -99,7 +96,6 @@ Feature: availability_group
| student1 | GI1 |
And I log out
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"

# P1 (any groups) and P2 should show but not P3.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Feature: availability_grouping
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on

Expand All @@ -41,7 +40,6 @@ Feature: availability_grouping
# Back to course page but add groups.
# This step used to be 'And I follow "C1"', but Chrome thinks the breadcrumb
# is not clickable, so we'll go via the home page instead.
And I am on site homepage
And I am on course page "Course 1"
And the following "groupings" exist:
| name | course | idnumber |
Expand Down Expand Up @@ -90,7 +88,6 @@ Feature: availability_grouping
| grouping | group |
| GXI1 | GI1 |
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"

# P1 should show but not B2.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Feature: availability_profile
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on

Expand Down Expand Up @@ -56,7 +55,6 @@ Feature: availability_profile
# Log back in as student.
When I log out
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"

# I see P1 but not P2.
Expand All @@ -82,7 +80,6 @@ Feature: availability_profile
And I click on "Update profile" "button"

# Set Page activity which has requirement on this field.
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Page" to section "1"
Expand All @@ -109,6 +106,5 @@ Feature: availability_profile
# Log out and back in as student. Should be able to see activity.
And I log out
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"
Then I should see "P1" in the "region-main" "region"
5 changes: 0 additions & 5 deletions availability/tests/behat/display_availability.feature
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Feature: display_availability
Scenario: Activity availability display
# Set up.
Given I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on

Expand Down Expand Up @@ -102,7 +101,6 @@ Feature: display_availability
# Change to student view.
Given I log out
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"

# Page 1 display still there but should be dimmed and not a link.
Expand All @@ -123,7 +121,6 @@ Feature: display_availability
Scenario: Section availability display
# Set up.
Given I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on

Expand All @@ -147,7 +144,6 @@ Feature: display_availability
And I press "Save changes"

# This is necessary because otherwise it fails in Chrome, see MDL-44959
And I am on site homepage
And I am on course page "Course 1"

# Add Pages to each section.
Expand All @@ -172,7 +168,6 @@ Feature: display_availability
# Change to student view.
Given I log out
And I log in as "student1"
And I am on site homepage
And I am on course page "Course 1"

# The contents of both sections should be hidden.
Expand Down
5 changes: 0 additions & 5 deletions availability/tests/behat/edit_availability.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Feature: edit_availability
Given the following config values are set as admin:
| enableavailability | 0 |
When I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Page" to section "1"
Expand All @@ -45,7 +44,6 @@ Feature: edit_availability
And the following config values are set as admin:
| enableavailability | 1 |

And I am on site homepage
And I am on course page "Course 1"
And I add a "Page" to section "1"
Then "Restrict access" "fieldset" should exist
Expand Down Expand Up @@ -149,7 +147,6 @@ Feature: edit_availability
Scenario: Edit availability using settings in section form
# Set up.
Given I log in as "teacher1"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on

Expand All @@ -171,7 +168,6 @@ Feature: edit_availability
Given the following config values are set as admin:
| enableavailability | 0 |
And I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Forum" to section "1"
Expand All @@ -185,7 +181,6 @@ Feature: edit_availability
| name | course | idnumber |
| GX1 | C1 | GXI1 |
And I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Forum" to section "1"
Expand Down
1 change: 0 additions & 1 deletion backup/util/ui/tests/behat/restore_moodle2_courses.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Feature: Restore Moodle 2 course backups
| assign | C3 | assign1 | Test assign name | Assign description | 1 |
| data | C3 | data1 | Test database name | Database description | 2 |
And I log in as "admin"
And I am on site homepage
And I am on course page "Course 1"
And I turn editing mode on
And I add a "Forum" to section "1" and I fill the form with:
Expand Down
Loading

0 comments on commit 93be3f7

Please sign in to comment.