From 7f11a9377d3ae9e5ee81b62346b6a84f97d94af9 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Thu, 17 Nov 2022 16:03:16 +0100 Subject: [PATCH] MOBILE-4081 behat: Fix tests for 3.9 --- .../login/tests/behat/signup-39.feature | 43 +++++++++++++++++++ .../features/login/tests/behat/signup.feature | 1 + 2 files changed, 44 insertions(+) create mode 100644 src/core/features/login/tests/behat/signup-39.feature diff --git a/src/core/features/login/tests/behat/signup-39.feature b/src/core/features/login/tests/behat/signup-39.feature new file mode 100644 index 000000000..2abb29a49 --- /dev/null +++ b/src/core/features/login/tests/behat/signup-39.feature @@ -0,0 +1,43 @@ +@auth @core_auth @app @javascript @lms_upto3.9 +Feature: Test signup in app + I need basic signup functionality to work + + Background: + Given the following config values are set as admin: + | registerauth | email | + | auth_instructions | These are the authentication instructions. | + | passwordpolicy | 0 | + + Scenario: Check password policy in signup + Given the following config values are set as admin: + | passwordpolicy | 1 | + | minpasswordlength | 8 | + | minpassworddigits | 1 | + | minpasswordlower | 1 | + | minpasswordupper | 1 | + | minpasswordnonalphanum | 1 | + When I launch the app + And I set the field "Your site" to "$WWWROOT" in the app + And I press "Connect to your site" in the app + And I press "Create new account" in the app + Then I should find "The password must have at least 8 characters" in the app + And I set the following fields to these values in the app: + | Username | u1 | + | Password | pu1 | + | Email address | u1@u1.com | + | Email (again) | u1@u1.com | + | First name | User | + | Surname | Test | + | City/town | Barcelona | + | Country | Spain | + And I press "Create my new account" in the app + Then I should find "Error" in the app + And I should find "Passwords must be at least 8 characters long" in the app + And I should find "Passwords must have at least 1 upper case letter(s)" in the app + And I should find "Passwords must have at least 1 non-alphanumeric character(s)" in the app + But I should not find "An email should have been sent to your address" in the app + + When I press "OK" in the app + And I set the field "Password" to "Password1$" in the app + And I press "Create my new account" in the app + Then I should find "An email should have been sent to your address" in the app diff --git a/src/core/features/login/tests/behat/signup.feature b/src/core/features/login/tests/behat/signup.feature index 68e991ff7..caf9e1be6 100755 --- a/src/core/features/login/tests/behat/signup.feature +++ b/src/core/features/login/tests/behat/signup.feature @@ -78,6 +78,7 @@ Feature: Test signup in app Then I should find "Barcelona, Spain" in the app And I should find "u1@u1.com" in the app + @lms_from3.10 Scenario: Check password policy in signup Given the following config values are set as admin: | passwordpolicy | 1 |