From 02a0f72a8dc758bfd2faeb419beef46d57b58fcd Mon Sep 17 00:00:00 2001 From: mioyu-ubiq Date: Tue, 25 Nov 2025 16:47:49 +0800 Subject: [PATCH] MDL-87091 behat: Test authloginviaemail setting behavior --- login/tests/behat/email_login.feature | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 login/tests/behat/email_login.feature diff --git a/login/tests/behat/email_login.feature b/login/tests/behat/email_login.feature new file mode 100644 index 00000000000..606fa89ce4c --- /dev/null +++ b/login/tests/behat/email_login.feature @@ -0,0 +1,26 @@ +@core +Feature: Login using email address + Users should be able to access their site + As a user + I should be able to login using email + + Background: + Given the following "users" exist: + | username | password | firstname | lastname | email | + | testuser | test | Test | User | user@example.com | + + Scenario Outline: A user can login using their email address + Given the following config values are set as admin: + | authloginviaemail | | + When I follow "Log in" + And I set the field "Username" to "" + And I set the field "Password" to "test" + And I press "Log in" + Then I should see "" + + Examples: + | authloginviaemail | login | message | + | 0 | testuser | You are logged in as | + | 0 | user@example.com | Invalid login, please try again | + | 1 | testuser | You are logged in as | + | 1 | user@example.com | You are logged in as |