From 96aaae3f19dbeb5d73b58ad09a5b08c88e67d04e Mon Sep 17 00:00:00 2001 From: Laurent David Date: Thu, 5 Jan 2023 19:53:34 +0100 Subject: [PATCH] MDL-76620 mod_bigbluebuttonbn: Fix guest behat test * Refactor guest_access.feature behat test --- .../tests/behat/guest_access.feature | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/mod/bigbluebuttonbn/tests/behat/guest_access.feature b/mod/bigbluebuttonbn/tests/behat/guest_access.feature index 8735ea5b626..d1a1bfe5d9e 100644 --- a/mod/bigbluebuttonbn/tests/behat/guest_access.feature +++ b/mod/bigbluebuttonbn/tests/behat/guest_access.feature @@ -13,17 +13,16 @@ Feature: Guest access allows external users to connect to a meeting | bigbluebuttonbn | RoomRecordingsWithGuest | Test Room with guest | C1 | bigbluebuttonbn1 | 0 | 0 | 1 | @javascript - Scenario: I need to enable guest access to see the instance parameters + Scenario Outline: I need to enable guest access to see the instance parameters Given the following config values are set as admin: - | bigbluebuttonbn_guestaccess_enabled | 1 | + | bigbluebuttonbn_guestaccess_enabled | | When I am on the "RoomRecordings" "bigbluebuttonbn activity editing" page logged in as "admin" - Then I should see "Guest access" - Then I log out - Given the following config values are set as admin: - | bigbluebuttonbn_guestaccess_enabled | 0 | - When I am on the "RoomRecordings" "bigbluebuttonbn activity editing" page logged in as "admin" - Then I should not see "Guest access" + Then I "Guest access" Then I log out + Examples: + | guestaccess | result | + | 1 | should see | + | 0 | should not see | @javascript Scenario: I should see Guest settings on the module form @@ -44,7 +43,7 @@ Feature: Guest access allows external users to connect to a meeting Then I log out @javascript - Scenario: I should be able to invite guest to the meeting + Scenario: I should be able to use the guest link and see the popup dialog Given the following config values are set as admin: | bigbluebuttonbn_guestaccess_enabled | 1 | When I am on the "RoomRecordingsWithGuest" "bigbluebuttonbn activity" page logged in as "admin" @@ -53,11 +52,25 @@ Feature: Guest access allows external users to connect to a meeting And I should see "Meeting password" And I should see "Copy link" And I should see "Copy password" - When I set the field "Guest emails" to "123" + + @javascript + Scenario: I should see errors when submitting the guest access form with erroneous values + Given the following config values are set as admin: + | bigbluebuttonbn_guestaccess_enabled | 1 | + And I am on the "RoomRecordingsWithGuest" "bigbluebuttonbn activity" page logged in as "admin" + And I click on "Add guests" "button" + And I set the field "Guest emails" to "123" When I click on "OK" "button" in the "Add guests to this meeting" "dialogue" Then I should see "Invalid email: 123" - When I set the field "Guest emails" to "testuser@email.com" - When I click on "OK" "button" in the "Add guests to this meeting" "dialogue" + + @javascript + Scenario: I should be able to invite guest to the meeting + Given the following config values are set as admin: + | bigbluebuttonbn_guestaccess_enabled | 1 | + And I am on the "RoomRecordingsWithGuest" "bigbluebuttonbn activity" page logged in as "admin" + And I click on "Add guests" "button" + And I set the field "Guest emails" to "testuser@email.com" + And I click on "OK" "button" in the "Add guests to this meeting" "dialogue" Then I should see "An invitation will be sent to testuser@email.com." Then I log out @@ -66,4 +79,4 @@ Feature: Guest access allows external users to connect to a meeting | bigbluebuttonbn_guestaccess_enabled | 1 | | forcelogin | 1 | When I am on the "RoomRecordingsWithGuest" "mod_bigbluebuttonbn > BigblueButtonBN Guest" page - Then I should see "C1: RoomRecordingsWithGuest" \ No newline at end of file + Then I should see "C1: RoomRecordingsWithGuest"