From 838f1bfa7b9ebf53e4b50a5a759d331cee2fd750 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Tue, 24 Jul 2018 10:35:30 +0800 Subject: [PATCH] MDL-62959 calendar: add behat to test event type changing --- calendar/tests/behat/calendar.feature | 49 ++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/calendar/tests/behat/calendar.feature b/calendar/tests/behat/calendar.feature index 9fc33df2c30..fceb146f8ce 100644 --- a/calendar/tests/behat/calendar.feature +++ b/calendar/tests/behat/calendar.feature @@ -21,6 +21,7 @@ Feature: Perform basic calendar functionality | student1 | C1 | student | | student3 | C1 | student | | teacher1 | C1 | teacher | + | admin | C1 | editingteacher | And the following "groups" exist: | name | course | idnumber | | Group 1 | C1 | G1 | @@ -195,7 +196,6 @@ Feature: Perform basic calendar functionality Scenario: Admin can only see all courses if calendar_adminseesall setting is enabled. Given I log in as "admin" And I am on "Course 1" course homepage - And I enrol "admin" user as "Teacher" And I am viewing site calendar And I click on "New event" "button" And I set the field "Type of event" to "Course" @@ -247,3 +247,50 @@ Feature: Perform basic calendar functionality Then the page should meet accessibility standards And the page should meet "wcag131, wcag143, wcag412" accessibility standards And the page should meet accessibility standards with "wcag131, wcag143, wcag412" extra tests + + @javascript + Scenario: Changing the event type should clear previous data + Given I log in as "admin" + And I am on "Course 1" course homepage + And I follow "This month" + And I press "New event" + And I set the following fields to these values: + | Event title | Group 1 event | + | Type of event | Group | + And I press "Save" + And I am on "Course 1" course homepage + And I follow "This month" + And I click on "Group 1 event" "link" + And I should see "Group event" + And I should see "Group 1" + When I click on "Edit" "button" + And I set the following fields to these values: + | Event title | My own user event | + | Type of event | user | + And I press "Save" + And I click on "My own user event" "link" + Then I should see "User event" + And I should not see "Group 1" + And I click on "Edit" "button" + And I set the following fields to these values: + | Event title | Site event | + | Type of event | site | + And I press "Save" + And I click on "Site event" "link" + And I should see "Site event" + And I click on "Edit" "button" + And I set the following fields to these values: + | Event title | Course 1 event | + | Type of event | course | + And I expand the "Course" autocomplete + And I click on "Course 1" item in the autocomplete list + And I press "Save" + And I click on "Course 1 event" "link" + And I should see "Course event" + And I click on "Edit" "button" + And I set the following fields to these values: + | Event title | Category event | + | Type of event | category | + And I press "Save" + And I click on "Category event" "link" + And I should see "Category event"