Commit 221210e9 authored by Damyon Wiese's avatar Damyon Wiese Committed by Adrian Greeve
Browse files

MDL-49412 Behat: Fix behat tests for all of @mod

This is after the navigation changes for 2.9.

Part of MDL-45774.
parent 3a8b9b65
...@@ -34,7 +34,7 @@ Feature: Outcome grading ...@@ -34,7 +34,7 @@ Feature: Outcome grading
| Short name | OT | | Short name | OT |
| Scale | Test Scale | | Scale | Test Scale |
And I press "Save changes" And I press "Save changes"
And I am on homepage And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I follow "Outcomes" And I follow "Outcomes"
And I set the field "Available standard outcomes" to "Outcome Test" And I set the field "Available standard outcomes" to "Outcome Test"
...@@ -87,7 +87,7 @@ Feature: Outcome grading ...@@ -87,7 +87,7 @@ Feature: Outcome grading
And I follow "Groups" And I follow "Groups"
And I add "Student 0 (student0@asd.com)" user to "Group 1" group members And I add "Student 0 (student0@asd.com)" user to "Group 1" group members
And I add "Student 1 (student1@asd.com)" user to "Group 1" group members And I add "Student 1 (student1@asd.com)" user to "Group 1" group members
And I am on homepage And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with: And I add a "Assignment" to section "1" and I fill the form with:
......
...@@ -18,6 +18,7 @@ Feature: In an assignment, teachers grade multiple students on one page ...@@ -18,6 +18,7 @@ Feature: In an assignment, teachers grade multiple students on one page
| teacher1 | C1 | editingteacher | | teacher1 | C1 | editingteacher |
| student1 | C1 | student | | student1 | C1 | student |
When I log in as "admin" When I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with: And I add a "Assignment" to section "1" and I fill the form with:
...@@ -34,6 +35,7 @@ Feature: In an assignment, teachers grade multiple students on one page ...@@ -34,6 +35,7 @@ Feature: In an assignment, teachers grade multiple students on one page
And I press "Save changes" And I press "Save changes"
And I log out And I log out
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I follow "Test assignment name" And I follow "Test assignment name"
And I follow "View/grade all submissions" And I follow "View/grade all submissions"
...@@ -126,8 +128,8 @@ Feature: In an assignment, teachers grade multiple students on one page ...@@ -126,8 +128,8 @@ Feature: In an assignment, teachers grade multiple students on one page
And I follow "Test assignment name" And I follow "Test assignment name"
And I should see "I'm the teacher first feedback" And I should see "I'm the teacher first feedback"
And I should see "60.0" And I should see "60.0"
And I follow "My grades" in the user menu
And I follow "Course 1" And I follow "Course 1"
And I follow "Grades"
And I should see "1337" And I should see "1337"
And I log out And I log out
And I log in as "student2" And I log in as "student2"
...@@ -135,8 +137,8 @@ Feature: In an assignment, teachers grade multiple students on one page ...@@ -135,8 +137,8 @@ Feature: In an assignment, teachers grade multiple students on one page
And I follow "Test assignment name" And I follow "Test assignment name"
And I should not see "I'm the teacher first feedback" And I should not see "I'm the teacher first feedback"
And I should not see "60.0" And I should not see "60.0"
And I follow "My grades" in the user menu
And I follow "Course 1" And I follow "Course 1"
And I follow "Grades"
And I should not see "1337" And I should not see "1337"
And I log out And I log out
And I log in as "teacher1" And I log in as "teacher1"
...@@ -165,8 +167,8 @@ Feature: In an assignment, teachers grade multiple students on one page ...@@ -165,8 +167,8 @@ Feature: In an assignment, teachers grade multiple students on one page
And I follow "Test assignment name" And I follow "Test assignment name"
And I should see "I'm the teacher first feedback" And I should see "I'm the teacher first feedback"
And I should see "60.0" And I should see "60.0"
And I follow "My grades" in the user menu
And I follow "Course 1" And I follow "Course 1"
And I follow "Grades"
And I should see "1337" And I should see "1337"
And I log out And I log out
And I log in as "student2" And I log in as "student2"
...@@ -174,6 +176,6 @@ Feature: In an assignment, teachers grade multiple students on one page ...@@ -174,6 +176,6 @@ Feature: In an assignment, teachers grade multiple students on one page
And I follow "Test assignment name" And I follow "Test assignment name"
And I should not see "I'm the teacher first feedback" And I should not see "I'm the teacher first feedback"
And I should not see "60.0" And I should not see "60.0"
And I follow "My grades" in the user menu
And I follow "Course 1" And I follow "Course 1"
And I follow "Grades"
And I should not see "1337" And I should not see "1337"
...@@ -10,6 +10,7 @@ Feature: In a book, verify log entries ...@@ -10,6 +10,7 @@ Feature: In a book, verify log entries
| fullname | shortname | category | groupmode | | fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 | | Course 1 | C1 | 0 | 1 |
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
When I add a "Book" to section "1" and I fill the form with: When I add a "Book" to section "1" and I fill the form with:
...@@ -63,4 +64,4 @@ Feature: In a book, verify log entries ...@@ -63,4 +64,4 @@ Feature: In a book, verify log entries
And I click on "Chapter created" "link" in the "#report_log_r9_c5" "css_element" And I click on "Chapter created" "link" in the "#report_log_r9_c5" "css_element"
And I switch to "action" window And I switch to "action" window
And I should see "1 First chapter edited" in the ".book_content" "css_element" And I should see "1 First chapter edited" in the ".book_content" "css_element"
And I switch to the main window And I switch to the main window
\ No newline at end of file
...@@ -11,6 +11,7 @@ Feature: Add choice activity ...@@ -11,6 +11,7 @@ Feature: Add choice activity
| fullname | shortname | category | | fullname | shortname | category |
| Course 1 | C1 | 0 | | Course 1 | C1 | 0 |
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
And I add a "Choice" to section "1" and I fill the form with: And I add a "Choice" to section "1" and I fill the form with:
......
...@@ -77,4 +77,4 @@ Feature: Multiple option choice response ...@@ -77,4 +77,4 @@ Feature: Multiple option choice response
And I should see "Option 3" And I should see "Option 3"
And the "#choice_1" "css_element" should be disabled And the "#choice_1" "css_element" should be disabled
And the "#choice_2" "css_element" should be disabled And the "#choice_2" "css_element" should be disabled
And the "#choice_3" "css_element" should be enabled And the "#choice_3" "css_element" should be enabled
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Feature: Test the display of the choice module on my home Feature: Test the display of the choice module on my home
In order to know my status in a choice activity In order to know my status in a choice activity
As a user As a user
I need to see it in My home. I need to see it in My dashboard.
Background: Background:
Given the following "users" exist: Given the following "users" exist:
...@@ -39,7 +39,7 @@ Feature: Test the display of the choice module on my home ...@@ -39,7 +39,7 @@ Feature: Test the display of the choice module on my home
@javascript @javascript
Scenario: View my home as a student before answering the choice Scenario: View my home as a student before answering the choice
Given I log in as "student1" Given I log in as "student1"
When I click on "My home" "link" in the "Navigation" "block" When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should see "You have Choices that need attention" Then I should see "You have Choices that need attention"
And I click on ".collapsibleregioncaption" "css_element" And I click on ".collapsibleregioncaption" "css_element"
And I should see "Not answered yet" And I should see "Not answered yet"
...@@ -52,7 +52,7 @@ Feature: Test the display of the choice module on my home ...@@ -52,7 +52,7 @@ Feature: Test the display of the choice module on my home
And I should see "Your selection: Option 1" And I should see "Your selection: Option 1"
And I should see "Your choice has been saved" And I should see "Your choice has been saved"
And "Save my choice" "button" should not exist And "Save my choice" "button" should not exist
When I click on "My home" "link" in the "Navigation" "block" When I click on "Dashboard" "link" in the "Navigation" "block"
Then I should not see "You have Choices that need attention" Then I should not see "You have Choices that need attention"
And I log out And I log out
...@@ -66,8 +66,8 @@ Feature: Test the display of the choice module on my home ...@@ -66,8 +66,8 @@ Feature: Test the display of the choice module on my home
And "Save my choice" "button" should not exist And "Save my choice" "button" should not exist
And I log out And I log out
When I log in as "teacher1" When I log in as "teacher1"
And I click on "My home" "link" in the "Navigation" "block" And I click on "Dashboard" "link" in the "Navigation" "block"
Then I should see "You have Choices that need attention" Then I should see "You have Choices that need attention"
And I click on ".collapsibleregioncaption" "css_element" And I click on ".collapsibleregioncaption" "css_element"
And I should see "View 1 responses" And I should see "View 1 responses"
And I log out And I log out
\ No newline at end of file
...@@ -15,6 +15,7 @@ Feature: Students can choose from 4 discussion display options and their choice ...@@ -15,6 +15,7 @@ Feature: Students can choose from 4 discussion display options and their choice
| user | course | role | | user | course | role |
| student1 | C1 | student | | student1 | C1 | student |
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
And I add a "Forum" to section "1" and I fill the form with: And I add a "Forum" to section "1" and I fill the form with:
......
...@@ -17,6 +17,7 @@ Feature: A user can navigate to previous and next discussions ...@@ -17,6 +17,7 @@ Feature: A user can navigate to previous and next discussions
| student1 | C1 | student | | student1 | C1 | student |
| student2 | C1 | student | | student2 | C1 | student |
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I navigate to "Groups" node in "Users" And I navigate to "Groups" node in "Users"
And I press "Create group" And I press "Create group"
...@@ -29,7 +30,7 @@ Feature: A user can navigate to previous and next discussions ...@@ -29,7 +30,7 @@ Feature: A user can navigate to previous and next discussions
And I press "Save changes" And I press "Save changes"
And I add "Student 1" user to "Group 1" group members And I add "Student 1" user to "Group 1" group members
And I add "Student 2" user to "Group 2" group members And I add "Student 2" user to "Group 2" group members
And I am on homepage And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
......
...@@ -15,6 +15,7 @@ Feature: A user can control their own subscription preferences for a discussion ...@@ -15,6 +15,7 @@ Feature: A user can control their own subscription preferences for a discussion
| user | course | role | | user | course | role |
| student1 | C1 | student | | student1 | C1 | student |
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
...@@ -134,6 +135,7 @@ Feature: A user can control their own subscription preferences for a discussion ...@@ -134,6 +135,7 @@ Feature: A user can control their own subscription preferences for a discussion
And "You are not subscribed to this discussion. Click to subscribe." "link" should exist in the "Test post subject two" "table_row" And "You are not subscribed to this discussion. Click to subscribe." "link" should exist in the "Test post subject two" "table_row"
And I log out And I log out
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I follow "Test forum name" And I follow "Test forum name"
And I click on "Edit settings" "link" in the "Administration" "block" And I click on "Edit settings" "link" in the "Administration" "block"
...@@ -179,6 +181,7 @@ Feature: A user can control their own subscription preferences for a discussion ...@@ -179,6 +181,7 @@ Feature: A user can control their own subscription preferences for a discussion
And "You are not subscribed to this discussion. Click to subscribe." "link" should exist in the "Test post subject two" "table_row" And "You are not subscribed to this discussion. Click to subscribe." "link" should exist in the "Test post subject two" "table_row"
And I log out And I log out
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I follow "Test forum name" And I follow "Test forum name"
And I click on "Edit settings" "link" in the "Administration" "block" And I click on "Edit settings" "link" in the "Administration" "block"
...@@ -271,7 +274,7 @@ Feature: A user can control their own subscription preferences for a discussion ...@@ -271,7 +274,7 @@ Feature: A user can control their own subscription preferences for a discussion
And the field "Discussion subscription" matches value "I don't want to be notified of new posts in this discussion" And the field "Discussion subscription" matches value "I don't want to be notified of new posts in this discussion"
Scenario: A guest should not be able to subscribe to a discussion Scenario: A guest should not be able to subscribe to a discussion
Given I click on "Home" "link" in the "Navigation" "block" Given I am on site homepage
And I add a "Forum" to section "1" and I fill the form with: And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name | | Forum name | Test forum name |
| Forum type | Standard forum for general use | | Forum type | Standard forum for general use |
...@@ -289,7 +292,7 @@ Feature: A user can control their own subscription preferences for a discussion ...@@ -289,7 +292,7 @@ Feature: A user can control their own subscription preferences for a discussion
And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist
Scenario: A user who is not logged in should not be able to subscribe to a discussion Scenario: A user who is not logged in should not be able to subscribe to a discussion
Given I click on "Home" "link" in the "Navigation" "block" Given I am on site homepage
And I add a "Forum" to section "1" and I fill the form with: And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name | | Forum name | Test forum name |
| Forum type | Standard forum for general use | | Forum type | Standard forum for general use |
......
...@@ -20,7 +20,7 @@ Feature: Students can edit or delete their forum posts within a set time limit ...@@ -20,7 +20,7 @@ Feature: Students can edit or delete their forum posts within a set time limit
And I follow "Site policies" And I follow "Site policies"
And I set the field "Maximum time to edit posts" to "1 minutes" And I set the field "Maximum time to edit posts" to "1 minutes"
And I press "Save changes" And I press "Save changes"
And I am on homepage And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
And I add a "Forum" to section "1" and I fill the form with: And I add a "Forum" to section "1" and I fill the form with:
......
...@@ -15,6 +15,7 @@ Feature: A user can control their own subscription preferences for a forum ...@@ -15,6 +15,7 @@ Feature: A user can control their own subscription preferences for a forum
| user | course | role | | user | course | role |
| student1 | C1 | student | | student1 | C1 | student |
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
......
...@@ -17,6 +17,7 @@ Feature: A user can control their default discussion subscription settings ...@@ -17,6 +17,7 @@ Feature: A user can control their default discussion subscription settings
| student1 | C1 | student | | student1 | C1 | student |
| student2 | C1 | student | | student2 | C1 | student |
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
......
@mod @mod_forum @mod @mod_forum @javascript
Feature: A user can view their posts and discussions Feature: A user can view their posts and discussions
In order to ensure a user can view their posts and discussions In order to ensure a user can view their posts and discussions
As a student As a student
...@@ -31,9 +31,11 @@ Feature: A user can view their posts and discussions ...@@ -31,9 +31,11 @@ Feature: A user can view their posts and discussions
| Message | How awesome is this forum discussion? | | Message | How awesome is this forum discussion? |
And I reply "Forum discussion 1" post from "Test forum name" forum with: And I reply "Forum discussion 1" post from "Test forum name" forum with:
| Message | Actually, I've seen better. | | Message | Actually, I've seen better. |
When I navigate to "Posts" node in "My profile > Forum posts" When I follow "My profile" in the user menu
And I follow "My forum posts"
Then I should see "How awesome is this forum discussion?" Then I should see "How awesome is this forum discussion?"
And I should see "Actually, I've seen better." And I should see "Actually, I've seen better."
And I navigate to "Discussions" node in "My profile > Forum posts" And I follow "My profile" in the user menu
And I follow "My forum discussions"
And I should see "How awesome is this forum discussion?" And I should see "How awesome is this forum discussion?"
And I should not see "Actually, I've seen better." And I should not see "Actually, I've seen better."
...@@ -34,6 +34,7 @@ Feature: Posting to groups in a separate group discussion when restricted to gro ...@@ -34,6 +34,7 @@ Feature: Posting to groups in a separate group discussion when restricted to gro
| G1 | G1G2 | | G1 | G1G2 |
| G2 | G2G1 | | G2 | G2G1 |
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
And I add a "Forum" to section "1" and I fill the form with: And I add a "Forum" to section "1" and I fill the form with:
......
...@@ -17,6 +17,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos ...@@ -17,6 +17,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
| student1 | C1 | student | | student1 | C1 | student |
| student2 | C1 | student | | student2 | C1 | student |
And I log in as "admin" And I log in as "admin"
And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
And I turn editing mode on And I turn editing mode on
...@@ -84,7 +85,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos ...@@ -84,7 +85,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
Scenario: Tracking forum posts forced with user tracking on Scenario: Tracking forum posts forced with user tracking on
Given the following config values are set as admin: Given the following config values are set as admin:
| forum_allowforcedreadtracking | 1 | | forum_allowforcedreadtracking | 1 |
And I follow "Home" And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
Given I add a "Forum" to section "1" and I fill the form with: Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name | | Forum name | Test forum name |
...@@ -108,7 +109,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos ...@@ -108,7 +109,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
Scenario: Tracking forum posts forced with user tracking off Scenario: Tracking forum posts forced with user tracking off
Given the following config values are set as admin: Given the following config values are set as admin:
| forum_allowforcedreadtracking | 1 | | forum_allowforcedreadtracking | 1 |
And I follow "Home" And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
Given I add a "Forum" to section "1" and I fill the form with: Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name | | Forum name | Test forum name |
...@@ -132,7 +133,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos ...@@ -132,7 +133,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
Scenario: Tracking forum posts forced (with force disabled) with user tracking on Scenario: Tracking forum posts forced (with force disabled) with user tracking on
Given the following config values are set as admin: Given the following config values are set as admin:
| forum_allowforcedreadtracking | 1 | | forum_allowforcedreadtracking | 1 |
And I follow "Home" And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
Given I add a "Forum" to section "1" and I fill the form with: Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name | | Forum name | Test forum name |
...@@ -164,7 +165,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos ...@@ -164,7 +165,7 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos
Scenario: Tracking forum posts forced (with force disabled) with user tracking off Scenario: Tracking forum posts forced (with force disabled) with user tracking off
Given the following config values are set as admin: Given the following config values are set as admin:
| forum_allowforcedreadtracking | 1 | | forum_allowforcedreadtracking | 1 |
And I follow "Home" And I am on site homepage
And I follow "Course 1" And I follow "Course 1"
Given I add a "Forum" to section "1" and I fill the form with: Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name | | Forum name | Test forum name |
......
...@@ -51,7 +51,8 @@ Feature: Practice mode in a lesson activity ...@@ -51,7 +51,8 @@ Feature: Practice mode in a lesson activity
| True | 1 | | True | 1 |
And I press "Submit" And I press "Submit"
Then I should see "View grades" Then I should see "View grades"
And I navigate to "Grades" node in "Course administration" And I follow "My grades" in the user menu
And I follow "Course 1"
And I should see "Non-practice lesson" And I should see "Non-practice lesson"
@javascript @javascript
...@@ -71,7 +72,8 @@ Feature: Practice mode in a lesson activity ...@@ -71,7 +72,8 @@ Feature: Practice mode in a lesson activity
| True | 1 | | True | 1 |
And I press "Submit" And I press "Submit"
Then I should not see "View grades" Then I should not see "View grades"
And I navigate to "Grades" node in "Course administration" And I follow "My grades" in the user menu
And I follow "Course 1"
And I should not see "Practice lesson" And I should not see "Practice lesson"
@javascript @javascript
...@@ -92,5 +94,6 @@ Feature: Practice mode in a lesson activity ...@@ -92,5 +94,6 @@ Feature: Practice mode in a lesson activity
| True | 1 | | True | 1 |
And I press "Submit" And I press "Submit"
Then I should not see "View grades" Then I should not see "View grades"
And I navigate to "Grades" node in "Course administration" And I follow "My grades" in the user menu
And I follow "Course 1"
And I should not see "Practice lesson with scale" And I should not see "Practice lesson with scale"
...@@ -17,7 +17,7 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ ...@@ -17,7 +17,7 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ
| teacher1 | C1 | editingteacher | | teacher1 | C1 | editingteacher |
| student1 | C1 | student | | student1 | C1 | student |
And I log in as "teacher1" And I log in as "teacher1"
And I navigate to "My private files" node in "My profile" And I follow "Manage my private files"
And I upload "mod/lesson/tests/fixtures/moodle_logo.jpg" file to "Files" filemanager And I upload "mod/lesson/tests/fixtures/moodle_logo.jpg" file to "Files" filemanager
And I click on "Save changes" "button" And I click on "Save changes" "button"
When I am on homepage When I am on homepage
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment