From 6e95f2227cddf5fdd612dd20fcf8e4926f97cd09 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 --- public/login/tests/behat/email_login.feature | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 public/login/tests/behat/email_login.feature diff --git a/public/login/tests/behat/email_login.feature b/public/login/tests/behat/email_login.feature new file mode 100644 index 00000000000..606fa89ce4c --- /dev/null +++ b/public/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 |