diff --git a/blocks/calendar_month/tests/behat/block_calendar_month.feature b/blocks/calendar_month/tests/behat/block_calendar_month.feature index db6f058c71a..c01b8fa39e3 100644 --- a/blocks/calendar_month/tests/behat/block_calendar_month.feature +++ b/blocks/calendar_month/tests/behat/block_calendar_month.feature @@ -141,7 +141,6 @@ Feature: Enable the calendar block in a course and test it's functionality And I add the "Calendar" block And I create a calendar event with form data: | id_eventtype | Group | - | id_groupid | Group 1 | | id_name | Group Event | And I log out Then I log in as "student1" @@ -179,7 +178,6 @@ Feature: Enable the calendar block in a course and test it's functionality And I am on "Course 1" course homepage And I create a calendar event with form data: | id_eventtype | Group | - | id_groupid | Group 1 | | id_name | Group Event 1 | And I log out Then I log in as "student1" diff --git a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_course.feature b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_course.feature index d517c5f1c84..9e092bfb0d7 100644 --- a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_course.feature +++ b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_course.feature @@ -4,7 +4,7 @@ Feature: Enable the upcoming events block in a course As a teacher I can view the event in the upcoming events block - Scenario: View a global event in the upcoming events block in a course + Background: Given the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | @@ -14,7 +14,10 @@ Feature: Enable the upcoming events block in a course And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | - When I log in as "admin" + + @javascript + Scenario: View a global event in the calendar block + Given I log in as "admin" And I create a calendar event with form data: | id_eventtype | Site | | id_name | My Site Event | diff --git a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature index ceb1898850e..0b7c739f83b 100644 --- a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature +++ b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature @@ -3,12 +3,14 @@ Feature: View a upcoming site event on the dashboard In order to view a site event As a student I can view the event in the upcoming events block - - Scenario: View a global event in the upcoming events block on the dashboard + Background: Given the following "users" exist: | username | firstname | lastname | email | idnumber | | student1 | Student | 1 | student1@example.com | S1 | - And I log in as "admin" + + @javascript + Scenario: View a global event in the upcoming events block on the dashboard + Given I log in as "admin" And I create a calendar event with form data: | id_eventtype | Site | | id_name | My Site Event | diff --git a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature index a10195280c9..448b71050d4 100644 --- a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature +++ b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_frontpage.feature @@ -4,11 +4,14 @@ Feature: View a site event on the frontpage As a teacher I can view the event in the upcoming events block - Scenario: View a global event in the upcoming events block on the frontpage + Background: Given the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | - And I log in as "admin" + + @javascript + Scenario: View a global event in the upcoming events block on the frontpage + Given I log in as "admin" And I create a calendar event with form data: | id_eventtype | Site | | id_name | My Site Event | diff --git a/calendar/tests/behat/calendar.feature b/calendar/tests/behat/calendar.feature index 81689dbef7c..291c83eecdd 100644 --- a/calendar/tests/behat/calendar.feature +++ b/calendar/tests/behat/calendar.feature @@ -1,4 +1,4 @@ -@core @core_calendar +@core @core_calendar @javascript Feature: Perform basic calendar functionality In order to ensure the calendar works as expected As an admin @@ -10,6 +10,7 @@ Feature: Perform basic calendar functionality | student1 | Student | 1 | student1@example.com | | student2 | Student | 2 | student2@example.com | | student3 | Student | 3 | student3@example.com | + | teacher1 | Teacher | 1 | teacher1@example.com | And the following "courses" exist: | fullname | shortname | format | | Course 1 | C1 | topics | @@ -17,17 +18,19 @@ Feature: Perform basic calendar functionality | user | course | role | | student1 | C1 | student | | student3 | C1 | student | + | teacher1 | C1 | teacher | And the following "groups" exist: | name | course | idnumber | | Group 1 | C1 | G1 | And the following "group members" exist: | user | group | | student1 | G1 | - When I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add the "Calendar" block + | teacher1 | G1 | Scenario: Create a site event + Given I log in as "admin" + And I am on "Course 1" course homepage with editing mode on + And I add the "Calendar" block And I create a calendar event with form data: | Type of event | site | | Event title | Really awesome event! | @@ -41,8 +44,14 @@ Feature: Perform basic calendar functionality And I log in as "student2" And I follow "This month" And I should see "Really awesome event!" + And I log out Scenario: Create a course event + Given I log in as "admin" + And I am on "Course 1" course homepage with editing mode on + And I add the "Calendar" block + And I log out + And I log in as "teacher1" And I create a calendar event with form data: | Type of event | course | | Event title | Really awesome event! | @@ -56,11 +65,16 @@ Feature: Perform basic calendar functionality And I log in as "student2" And I follow "This month" And I should not see "Really awesome event!" + And I log out Scenario: Create a group event + Given I log in as "admin" + And I am on "Course 1" course homepage with editing mode on + And I add the "Calendar" block + And I log out + And I log in as "teacher1" And I create a calendar event with form data: | Type of event | group | - | Group | Group 1 | | Event title | Really awesome event! | | Description | Come join this awesome event | And I log out @@ -68,13 +82,11 @@ Feature: Perform basic calendar functionality And I am on "Course 1" course homepage And I follow "This month" And I follow "Really awesome event!" - And "Group 1" "text" should exist in the ".eventlist" "css_element" - And I log out - And I log in as "student3" - And I follow "This month" - And I should not see "Really awesome event!" Scenario: Create a user event + Given I log in as "admin" + And I am on "Course 1" course homepage with editing mode on + And I add the "Calendar" block And I create a calendar event with form data: | Type of event | user | | Event title | Really awesome event! | @@ -86,22 +98,37 @@ Feature: Perform basic calendar functionality And I should not see "Really awesome event!" Scenario: Delete an event + Given I log in as "admin" + And I am on "Course 1" course homepage with editing mode on + And I add the "Calendar" block + And I log out + And I log in as "teacher1" And I create a calendar event with form data: | Type of event | user | | Event title | Really awesome event! | | Description | Come join this awesome event, sucka! | - And I click on "Delete event" "link" in the ".event div.commands" "css_element" + And I am on "Course 1" course homepage + And I follow "This month" + And I click on "Really awesome event!" "link" And I click on "Delete" "button" + And I click on "Yes" "button" + And I wait to be redirected And I should not see "Really awesome event!" Scenario: Edit an event + Given I log in as "admin" + And I am on "Course 1" course homepage with editing mode on + And I add the "Calendar" block And I create a calendar event with form data: | Type of event | user | | Event title | Really awesome event! | | Description | Come join this awesome event, sucka! | - And I click on "Edit event" "link" in the ".event div.commands" "css_element" + And I am on "Course 1" course homepage + And I follow "This month" + And I click on "Really awesome event!" "link" + And I click on "Edit" "button" And I set the following fields to these values: | Event title | Mediocre event :( | | Description | Wait, this event isn't that great. | - And I press "Save changes" + And I press "Save" And I should see "Mediocre event" diff --git a/calendar/tests/behat/calendar_import.feature b/calendar/tests/behat/calendar_import.feature index a9cedb12bcc..c9a38292e02 100644 --- a/calendar/tests/behat/calendar_import.feature +++ b/calendar/tests/behat/calendar_import.feature @@ -30,5 +30,19 @@ Feature: Import and edit calendar events And I should see "February 2017" And I should see "Event on 2-15-2017" And I should see "Event on 2-25-2017" - And I follow "Event on 2-15-2017" - And I should see "Event source: Test Import" + And I click on "Event on 2-15-2017" "link" + And I click on "Edit" "button" + And I set the following fields to these values: + | Event title | Event on 2-20-2017 | + | Description | Event on 2-20-2017 | + | timestart[day] | 20 | + And I press "Save" + When I view the calendar for "2" "2017" + Then I should see "Event on 2-20-2017" + And I should see "Event on 2-25-2017" + And I should not see "Event on 2-15-2017" + And I press "Manage subscriptions" + And I press "Remove" + And I view the calendar for "2" "2017" + And I should not see "Event on 2-25-2017" + And I should not see "Event on 2-20-2017" diff --git a/calendar/tests/behat/calendar_lookahead.feature b/calendar/tests/behat/calendar_lookahead.feature index 819d03e2b30..339fd65adf1 100644 --- a/calendar/tests/behat/calendar_lookahead.feature +++ b/calendar/tests/behat/calendar_lookahead.feature @@ -1,4 +1,4 @@ -@core @core_calendar +@core @core_calendar @javascript Feature: Limit displayed upcoming events In order to filter what is displayed on the calendar As a user @@ -23,10 +23,9 @@ Feature: Limit displayed upcoming events And I follow "This month" And I click on "a.next" "css_element" And I click on "a.next" "css_element" - And I create a calendar event: + When I create a calendar event: | Type of event | course | | Event title | Two months away event | - When I follow "C1" Then I should not see "Two months away event" And I am on site homepage And I follow "Preferences" in the user menu