From 4d08decb77d4e2477a1947f6eb7b57f3c7b3cdc6 Mon Sep 17 00:00:00 2001 From: Ramindu Deshapriya Date: Fri, 15 Apr 2016 00:04:57 +0530 Subject: [PATCH] MDL-52708 core_admin: Added Behat test to automate MDLQA-8190 --- ...e_multiple_accounts_use_same_email.feature | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 admin/tests/behat/enable_multiple_accounts_use_same_email.feature diff --git a/admin/tests/behat/enable_multiple_accounts_use_same_email.feature b/admin/tests/behat/enable_multiple_accounts_use_same_email.feature new file mode 100644 index 00000000000..30d21b97125 --- /dev/null +++ b/admin/tests/behat/enable_multiple_accounts_use_same_email.feature @@ -0,0 +1,57 @@ +@core @core_admin +Feature: Enable multiple accounts to have the same email address + In order to have multiple accounts registerd on the system with the same email address + As an admin + I need to enable multiple accounts to be registered with the same email address and verify it is applied + + Background: + Given I log in as "admin" + + Scenario: Enable registration of multiple accounts with the same email address + Given the following config values are set as admin: + | allowaccountssameemail | 1 | + When I navigate to "Add a new user" node in "Site administration>Users>Accounts" + And I set the following fields to these values: + | Username | testmultiemailuser1 | + | Choose an authentication method | Manual accounts | + | New password | test@User1 | + | First name | Test | + | Surname | Multi1 | + | Email address | testmultiemailuser@example.com | + And I press "Create user" + And I should see "Test Multi1" + And I press "Add a new user" + And I set the following fields to these values: + | Username | testmultiemailuser2 | + | Choose an authentication method | Manual accounts | + | New password | test@User2 | + | First name | Test | + | Surname | Multi2 | + | Email address | testmultiemailuser@example.com | + And I press "Create user" + Then I should see "Test Multi2" + And I should not see "This email address is already registered" + + Scenario: Disable registration of multiple accounts with the same email address + Given the following config values are set as admin: + | allowaccountssameemail | 0 | + When I navigate to "Add a new user" node in "Site administration>Users>Accounts" + And I set the following fields to these values: + | Username | testmultiemailuser1 | + | Choose an authentication method | Manual accounts | + | New password | test@User1 | + | First name | Test | + | Surname | Multi1 | + | Email address | testmultiemailuser@example.com | + And I press "Create user" + And I should see "Test Multi1" + And I press "Add a new user" + And I set the following fields to these values: + | Username | testmultiemailuser2 | + | Choose an authentication method | Manual accounts | + | New password | test@User2 | + | First name | Test | + | Surname | Multi2 | + | Email address | testmultiemailuser@example.com | + And I press "Create user" + Then I should see "This email address is already registered" \ No newline at end of file