Skip to content

Commit

Permalink
MDL-51100 behat: Remove javascript tag from usermenu steps
Browse files Browse the repository at this point in the history
These tests only needed the javascript tag because of the user menu.
Now that issue has been resolved, they do not need it.

Note: Some were also not using the singleselect feature, so would fail
without changes to use this too as they were not handling proper selection
of the singleselect element.
  • Loading branch information
andrewnicols committed Aug 14, 2015
1 parent 317fd6f commit 711b1d6
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 58 deletions.
4 changes: 0 additions & 4 deletions admin/tool/behat/tests/behat/nasty_strings.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Feature: Transform steps arguments
And I follow "Preferences" in the user menu
And I follow "Edit profile"

@javascript
Scenario: Use nasty strings on steps arguments
When I set the field "Surname" to "$NASTYSTRING1"
And I set the field "Description" to "$NASTYSTRING2"
Expand All @@ -24,7 +23,6 @@ Feature: Transform steps arguments
And the field "Surname" matches value "$NASTYSTRING1"
And the field "City/town" matches value "$NASTYSTRING3"

@javascript
Scenario: Use nasty strings on table nodes
When I set the following fields to these values:
| Surname | $NASTYSTRING1 |
Expand All @@ -36,7 +34,6 @@ Feature: Transform steps arguments
And the field "Surname" matches value "$NASTYSTRING1"
And the field "City/town" matches value "$NASTYSTRING3"

@javascript
Scenario: Use double quotes
When I set the following fields to these values:
| First name | va"lue1 |
Expand All @@ -49,7 +46,6 @@ Feature: Transform steps arguments
And the field "Description" matches value "va\\"lue2"
And the field "City/town" matches value "va\"lue3"

@javascript
Scenario: Nasty strings with other contents
When I set the field "First name" to "My Firstname $NASTYSTRING1"
And I set the following fields to these values:
Expand Down
2 changes: 0 additions & 2 deletions blocks/tags/tests/behat/tagcloud.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Feature: Block tags displaying tag cloud
And I press "Update profile"
And I log out

@javascript
Scenario: Add Tags block on a front page
When I log in as "admin"
And I am on site homepage
Expand All @@ -41,7 +40,6 @@ Feature: Block tags displaying tag cloud
And I click on "Dogs" "link" in the "Tags" "block"
And I should see "Log in to the site" in the ".breadcrumb" "css_element"

@javascript
Scenario: Add Tags block in a course
When I log in as "teacher1"
And I follow "Course 1"
Expand Down
1 change: 0 additions & 1 deletion blog/tests/behat/blog_visibility.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Feature: Blogs can be set to be only visible by the author.
And I press "Save changes"
And I log out

@javascript
Scenario: A student can not see another student's blog entries.
Given I log in as "testuser"
And I follow "Course 1"
Expand Down
1 change: 0 additions & 1 deletion course/tests/behat/navigate_course_list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Feature: Browse course list and return back from enrolment page
| Sample course | C1 | 0 |
| Course 1 | COURSE1 | CAT1 |

@javascript
Scenario: A user can return to the category page from enrolment page
When I log in as "user2"
And I click on "Courses" "link" in the "Navigation" "block"
Expand Down
25 changes: 6 additions & 19 deletions grade/tests/behat/grade_aggregation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ Feature: We can use calculated grade totals
And I set the field "Grade display type" to "Real (percentage)"
And I press "Save changes"

@javascript
Scenario: Mean of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Mean of grades |
Expand All @@ -81,7 +80,6 @@ Feature: We can use calculated grade totals
And I follow "Grades" in the user menu
And I should see "30.42 (30.42 %)" in the "overview-grade" "table"

@javascript
Scenario: Weighted mean of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Weighted mean of grades |
Expand All @@ -104,7 +102,6 @@ Feature: We can use calculated grade totals
And I follow "Grades" in the user menu
And I should see "26.94 (26.94 %)" in the "overview-grade" "table"

@javascript
Scenario: Simple weighted mean of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Simple weighted mean of grades |
Expand All @@ -125,7 +122,6 @@ Feature: We can use calculated grade totals
And I follow "Grades" in the user menu
And I should see "48.57 (48.57 %)" in the "overview-grade" "table"

@javascript
Scenario: Mean of grades (with extra credits) aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Mean of grades (with extra credits) |
Expand All @@ -146,7 +142,6 @@ Feature: We can use calculated grade totals
And I follow "Grades" in the user menu
And I should see "47.22 (47.22 %)" in the "overview-grade" "table"

@javascript
Scenario: Median of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Median of grades |
Expand All @@ -165,7 +160,6 @@ Feature: We can use calculated grade totals
And I follow "Grades" in the user menu
And I should see "25.83 (25.83 %)" in the "overview-grade" "table"

@javascript
Scenario: Lowest grade aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Lowest grade |
Expand All @@ -188,7 +182,6 @@ Feature: We can use calculated grade totals
And I follow "Grades" in the user menu
And I should see "0.00 (0.00 %)" in the "overview-grade" "table"

@javascript
Scenario: Highest grade aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Highest grade |
Expand All @@ -209,7 +202,6 @@ Feature: We can use calculated grade totals
And I follow "Grades" in the user menu
And I should see "50.00 (50.00 %)" in the "overview-grade" "table"

@javascript
Scenario: Mode of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Mode of grades |
Expand All @@ -230,7 +222,6 @@ Feature: We can use calculated grade totals
And I follow "Grades" in the user menu
And I should see "50.00 (50.00 %)" in the "overview-grade" "table"

@javascript
Scenario: Natural aggregation on outcome items with natural weights
And the following config values are set as admin:
| enableoutcomes | 1 |
Expand Down Expand Up @@ -292,7 +283,6 @@ Feature: We can use calculated grade totals
And I follow "Course 1"
And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"

@javascript
Scenario: Natural aggregation on outcome items with modified weights
And the following config values are set as admin:
| enableoutcomes | 1 |
Expand Down Expand Up @@ -329,7 +319,6 @@ Feature: We can use calculated grade totals
And I follow "Course 1"
And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"

@javascript
Scenario: Natural aggregation
And I set the following settings for grade item "Sub category 1":
| Aggregation | Natural |
Expand All @@ -353,8 +342,8 @@ Feature: We can use calculated grade totals
And I set the field "Show contribution to course total" to "Show"
And I set the field "Show weightings" to "Show"
And I press "Save changes"
And I set the field "Grade report" to "User report"
And I set the field "Select all or one user" to "Student 1"
And I select "User report" from the "Grade report" singleselect
And I select "Student 1" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Range | Contribution to course total |
| Test assignment five | 28.57 % | 10.00 (50.00 %) | 020 | 1.03 % |
Expand Down Expand Up @@ -382,7 +371,6 @@ Feature: We can use calculated grade totals
| Test assignment three | 30.93 %( Extra credit ) | 40.00 (26.67 %) | 0150 | 8.25 % |
| Test assignment four | 30.93 % | - | 0150 | 0.00 % |

@javascript
Scenario: Natural aggregation with drop lowest
When I log out
And I log in as "admin"
Expand All @@ -401,7 +389,6 @@ Feature: We can use calculated grade totals
| Exclude empty grades | 0 |
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I press "Add category"
And I click on "Show more" "link"
And I set the following fields to these values:
| Category name | Sub category 3 |
| Aggregation | Natural |
Expand Down Expand Up @@ -465,7 +452,7 @@ Feature: We can use calculated grade totals

@javascript
Scenario: Natural aggregation from the setup screen
And I set the field "Grade report" to "Categories and items"
And I select "Categories and items" from the "Grade report" singleselect
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
And I set the following settings for grade item "Sub category 1":
Expand Down Expand Up @@ -527,7 +514,7 @@ Feature: We can use calculated grade totals
| Aggregation | Natural |
| Exclude empty grades | 0 |
And I turn editing mode off
And I set the field "Grade report" to "Categories and items"
And I select "Categories and items" from the "Grade report" singleselect
And I set the field "Override weight of Test assignment one" to "1"
And I set the field "Weight of Test assignment one" to "0"
And I set the field "Override weight of Test assignment six" to "1"
Expand All @@ -542,8 +529,8 @@ Feature: We can use calculated grade totals
And I set the field "Show weightings" to "Show"
And I press "Save changes"
Then I should see "75.00 (16.85 %)" in the ".course" "css_element"
And I set the field "Grade report" to "User report"
And I set the field "Select all or one user" to "Student 1"
And I select "User report" from the "Grade report" singleselect
And I select "Student 1" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Contribution to course total |
| Test assignment five | 57.14 % | 10.00 (50.00 %) | 2.25 % |
Expand Down
12 changes: 4 additions & 8 deletions grade/tests/behat/grade_scales.feature
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ Feature: View gradebook when scales are used
And I follow "Grader report"
And I turn editing mode on

@javascript
Scenario: Test displaying scales in gradebook in aggregation method Natural
When I turn editing mode off
Then the following should exist in the "user-grades" table:
Expand All @@ -85,14 +84,13 @@ Feature: View gradebook when scales are used
| Range | FA | 0.005.00 | 0.005.00 |
| Overall average | C | 3.00 | 3.00 |
And I follow "User report"
And I set the field "Select all or one user" to "Student 3"
And I click on "Select all or one user" "select"
And I select "Student 3" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table:
| Grade item | Grade | Range | Percentage | Contribution to course total |
| Test assignment one | C | FA | 50.00 % | 60.00 % |
| Sub category 1 total | 3.00 | 05 | 60.00 % | - |
| Course total | 3.00 | 05 | 60.00 % | - |
And I set the field "jump" to "Categories and items"
And I select "Categories and items" from the "Grade report" singleselect
And the following should exist in the "grade_edit_tree_table" table:
| Name | Max grade |
| Test assignment one | 5.00 |
Expand All @@ -108,7 +106,6 @@ Feature: View gradebook when scales are used
| Sub category 1 total | 4.00 | 05 | 80.00 % | - |
| Course total | 4.00 | 05 | 80.00 % | - |

@javascript
Scenario Outline: Test displaying scales in gradebook in all other aggregation methods
When I follow "Edit Course 1"
And I set the field "Aggregation" to "<aggregation>"
Expand All @@ -133,14 +130,13 @@ Feature: View gradebook when scales are used
| Range | FA | 1.005.00 | 0.00100.00 |
| Overall average | C | 3.00 | <overallavg> |
And I follow "User report"
And I set the field "Select all or one user" to "Student 3"
And I click on "Select all or one user" "select"
And I select "Student 3" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table:
| Grade item | Grade | Range | Percentage | Contribution to course total |
| Test assignment one | C | FA | 50.00 % | <contrib3> |
| Sub category (<aggregation>) total<aggregation>. | 3.00 | 15 | 50.00 % | - |
| Course total<aggregation>. | <coursetotal3> | 0100 | <courseperc3> | - |
And I set the field "jump" to "Categories and items"
And I select "Categories and items" from the "Grade report" singleselect
And the following should exist in the "grade_edit_tree_table" table:
| Name | Max grade |
| Test assignment one | A (5) |
Expand Down
8 changes: 3 additions & 5 deletions grade/tests/behat/grade_view.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ Feature: We can enter in grades and view reports from the gradebook
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment name 2"
And I press "Save changes"

@javascript
Scenario: Grade a grade item and ensure the results display correctly in the gradebook
When I set the field "Grade report" to "User report"
When I select "User report" from the "Grade report" singleselect
And the "Grade report" select box should contain "Grader report"
And the "Grade report" select box should contain "Outcomes report"
And the "Grade report" select box should contain "User report"
Expand All @@ -80,14 +79,13 @@ Feature: We can enter in grades and view reports from the gradebook
And "Course 1" row "Grade" column of "overview-grade" table should contain "170.00"
And "Course 1" row "Grade" column of "overview-grade" table should not contain "90.00"

@javascript
Scenario: We can add a weighting to a grade item and it is displayed properly in the user report
When I set the field "Grade report" to "Categories and items"
When I select "Categories and items" from the "Grade report" singleselect
And I set the following settings for grade item "Course 1":
| Aggregation | Weighted mean of grades |
And I set the field "Extra credit value for Test assignment name" to "0.72"
And I press "Save changes"
And I set the field "Grade report" to "User report"
And I select "User report" from the "Grade report" singleselect
And I navigate to "Course grade settings" node in "Grade administration > Setup"
And I set the following fields to these values:
| Show weightings | Show |
Expand Down
2 changes: 1 addition & 1 deletion message/tests/behat/display_history.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@core @core_message @javascript
@core @core_message
Feature: Message history displays correctly
In order to read messages between two users
As a user
Expand Down
2 changes: 1 addition & 1 deletion message/tests/behat/manage_contacts.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@core @core_message @javascrript
@core @core_message
Feature: Manage contacts
In order to easily access the users I interact more with
As a user
Expand Down
8 changes: 4 additions & 4 deletions message/tests/behat/recent_conversations.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@core @core_message @javascript
@core @core_message
Feature: Recent conversations contains my recent conversations
In order to view my recent conversations
As a user
Expand All @@ -14,7 +14,7 @@ Feature: Recent conversations contains my recent conversations
Scenario: View that I don't have recent conversations
Given I log in as "user1"
And I follow "Messages" in the user menu
When I set the field "Message navigation:" to "Recent conversations"
When I select "Recent conversations" from the "Message navigation:" singleselect
Then I should not see "User Two"
And I should not see "User Three"

Expand All @@ -23,14 +23,14 @@ Feature: Recent conversations contains my recent conversations
And I send "Message from user1 to user2" message to "User Two" user
And I send "Message from user1 to user3" message to "User Three" user
And I follow "Messages" in the user menu
When I set the field "Message navigation:" to "Recent conversations"
When I select "Recent conversations" from the "Message navigation:" singleselect
Then I should see "User Two"
And I should see "User Three"
And I should see "Message from user1 to user2"
And I should see "Message from user1 to user3"
And I log out
And I log in as "user2"
And I follow "Messages" in the user menu
And I set the field "Message navigation:" to "Recent conversations"
And I select "Recent conversations" from the "Message navigation:" singleselect
And I should see "Message from user1 to user2"
And I should not see "Message from user1 to user3"
2 changes: 1 addition & 1 deletion mod/forum/tests/behat/my_forum_posts.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@mod @mod_forum @javascript
@mod @mod_forum
Feature: A user can view their posts and discussions
In order to ensure a user can view their posts and discussions
As a student
Expand Down
3 changes: 0 additions & 3 deletions mod/lesson/tests/behat/lesson_practice.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Feature: Practice mode in a lesson activity
| id_answer_editor_1 | False |
And I press "Save page"

@javascript
Scenario: Non-practice lesson records grades in the gradebook
Given I follow "Test lesson name"
And I navigate to "Edit settings" node in "Lesson administration"
Expand All @@ -55,7 +54,6 @@ Feature: Practice mode in a lesson activity
And I follow "Course 1"
And I should see "Non-practice lesson"

@javascript
Scenario: Practice lesson doesn't record grades in the gradebook
Given I follow "Test lesson name"
And I navigate to "Edit settings" node in "Lesson administration"
Expand All @@ -76,7 +74,6 @@ Feature: Practice mode in a lesson activity
And I follow "Course 1"
And I should not see "Practice lesson"

@javascript
Scenario: Practice lesson with scale doesn't record grades in the gradebook
Given I follow "Test lesson name"
And I navigate to "Edit settings" node in "Lesson administration"
Expand Down
11 changes: 3 additions & 8 deletions report/outline/tests/behat/user.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Feature: View the user page for the outline report
| Description | URL description |
| External URL | http://www.google.com |

@javascript
Scenario: View the user page when only the legacy log reader is enabled
Given I navigate to "Manage log stores" node in "Site administration > Plugins > Logging"
And I click on "Enable" "link" in the "Legacy log" "table_row"
Expand All @@ -48,20 +47,17 @@ Feature: View the user page for the outline report
And I follow "URL name"
And I follow "URL name"
And I follow "URL name"
And I click on "Student 1" "link"
And I follow "Profile" in the open menu
And I follow "Profile" in the user menu
And I follow "Course 1"
When I follow "Outline report"
Then I should see "4 views" in the "Folder name" "table_row"
And I should see "3 views" in the "URL name" "table_row"
And I click on "Student 1" "link"
And I follow "Profile" in the open menu
And I follow "Profile" in the user menu
And I follow "Course 1"
When I follow "Complete report"
And I follow "Complete report"
And I should see "4 views"
And I should see "3 views"

@javascript
Scenario: View the user page when only the standard log reader is enabled
Given I navigate to "Manage log stores" node in "Site administration > Plugins > Logging"
And "Enable" "link" should exist in the "Legacy log" "table_row"
Expand Down Expand Up @@ -90,7 +86,6 @@ Feature: View the user page for the outline report
And I should see "4 views"
And I should see "3 views"

@javascript
Scenario: View the user page when both the standard and legacy log readers are enabled
Given I navigate to "Manage log stores" node in "Site administration > Plugins > Logging"
And I click on "Enable" "link" in the "Legacy log" "table_row"
Expand Down

0 comments on commit 711b1d6

Please sign in to comment.