diff --git a/mod_form.php b/mod_form.php index ea6e8707..4f7824fc 100644 --- a/mod_form.php +++ b/mod_form.php @@ -63,7 +63,7 @@ public function definition() { $isnew = empty($this->_cm); - $service = new mod_zoom_webservice(); + $service = new \mod_zoom\webservice(); // UofR HACK ADDED. $zoomuser = zoom_email_alias($USER, $service); // END of ADDED. diff --git a/tests/behat/zoomtest.feature b/tests/behat/zoomtest.feature new file mode 100644 index 00000000..a314d33a --- /dev/null +++ b/tests/behat/zoomtest.feature @@ -0,0 +1,45 @@ +@mod @mod_zoom +Feature: Create and delete a Zoom activity + In order to manage course content + As a user + I need to be able to create and delete a Zoom activity in Moodle + + Background: + Given the following "courses" exist: + | fullname | shortname | category | + | Test Course | TC | 0 | + And the following "users" exist: + | username | firstname | lastname | email | + | admin2 | Admin | 2 | lane206j@uregina.ca | + And the following "course enrolments" exist: + | user | course | role | + | admin2 | TC | manager | + And the following config values are set as admin: + | accountid | mPu89yKFStKeho7aseleyQ | zoom | + | clientid | rjYCdmTpRf2zW5uBW3Rtg | zoom | + | clientsecret | K5urZmDwufjyYiMokKwdvZJRC9AZioHW | zoom | + | zoomurl | https://uregina-ca.zoom.us | zoom | + And I log in as "admin2" + And I am on "Test Course" course homepage with editing mode on + + @javascript + Scenario: Create and delete a Zoom activity + Given I click on "Add an activity or resource" "button" in the "Topic 1" "section" + And I click on "Zoom meeting" "link" in the ".modal-body" "css_element" + And I set the field "Title" to "Test Zoom Meeting" + And I set the field "Description" to "This is a test Zoom meeting." + And I set the field "start_time[day]" to "20" + And I set the field "start_time[month]" to "July" + And I set the field "start_time[year]" to "2024" + And I set the field "start_time[hour]" to "10" + And I set the field "duration[number]" to "2" + And I set the field "duration[timeunit]" to "hours" + And I set the field "option_participants_video" to "1" + And I press "Save and return to course" + And I should see "Test Zoom Meeting" in the "Topic 1" "section" + + When I turn editing mode on + And I open "Test Zoom Meeting" actions menu + And I click on "Delete" "link" in the "Test Zoom Meeting" activity + And I click on "Delete" "button" in the ".modal-footer" "css_element" + And I should not see "Test Zoom Meeting" in the "Topic 1" "section" \ No newline at end of file