From 7354d0c833be11c7b400cba78649eeaa620068a5 Mon Sep 17 00:00:00 2001
From: Rajab Natshah <rajabn@gmail.com>
Date: Tue, 1 Nov 2022 13:19:29 +0300
Subject: [PATCH] Issue #3317088: Change Varbase Automated Functional Testing
 to follow with changes on the Password Policy, and EntityQueue modules

---
 .phpcs.xml                                    |  2 +-
 gulpfile.js                                   |  8 ++--
 src/assets/varbase-robots-additions.txt       |  2 +-
 ...-important-admin-development-pages.feature | 41 ++++++++++++++++++-
 ...tyqueue-testing-content-and-config.feature |  2 +-
 tests/tools/step1-init-tests/README.md        |  1 -
 6 files changed, 46 insertions(+), 10 deletions(-)

diff --git a/.phpcs.xml b/.phpcs.xml
index 18484fed..10a4261a 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -6,7 +6,7 @@
   <!--Exclude folders used by common frontend tools. These folders match the file_scan_ignore_directories setting in default.settings.php-->
   <exclude-pattern>*/node_modules/*</exclude-pattern>
   <exclude-pattern>*/bower_components/*</exclude-pattern>
-  <!-- <exclude-pattern>*/tests/features/bootstrap/*</exclude-pattern> -->
+  <exclude-pattern>varbase.info.yml</exclude-pattern>
 
   <!--Exclude minimized css.-->
   <exclude-pattern>*/*.min.css</exclude-pattern>
diff --git a/gulpfile.js b/gulpfile.js
index dd45cc6e..8676d166 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -15,14 +15,14 @@ const paths = {
 };
 
 // Compile sass into CSS & auto-inject into browsers.
-function compile () {
+function compile() {
   var sassOptions = {
     outputStyle: 'expanded',
-    indented: true,
+    indented: TRUE,
     indentType: 'space',
     indentWidth: 2,
     linefeed: 'lf',
-    sourceMap: false
+    sourceMap: FALSE
   };
 
   return gulp.src([paths.scss.src])
@@ -34,7 +34,7 @@ function compile () {
 }
 
 // Watching scss files.
-function watch () {
+function watch() {
   gulp.watch([paths.scss.watch], compile);
 }
 
diff --git a/src/assets/varbase-robots-additions.txt b/src/assets/varbase-robots-additions.txt
index ef38c5fc..cdd52e7d 100644
--- a/src/assets/varbase-robots-additions.txt
+++ b/src/assets/varbase-robots-additions.txt
@@ -2,4 +2,4 @@
 # --------------------------------------
 # Oembed media
 Disallow: /media/oembed
-Disallow: /*/media/oembed
\ No newline at end of file
+Disallow: /*/media/oembed
diff --git a/tests/features/varbase/03-admin-management/03-00-pre-check-important-admin-development-pages.feature b/tests/features/varbase/03-admin-management/03-00-pre-check-important-admin-development-pages.feature
index 3d29c66a..0bb9caec 100644
--- a/tests/features/varbase/03-admin-management/03-00-pre-check-important-admin-development-pages.feature
+++ b/tests/features/varbase/03-admin-management/03-00-pre-check-important-admin-development-pages.feature
@@ -84,9 +84,10 @@ So that I can use them after the install or update.
       And I wait
      Then I should see "Appearance"
       And I should see "Vartheme"
-      And I should see "Base theme for Varbase standard websites. Based on Bootstrap 5 framework using SASS, and extending Radix theme."
+      And I should see "(Bootstrap 4 - SASS)"
       And I should see "Claro"
-      And I should see "Radix"
+      And I should see "Bootstrap"
+      And I should see "Bootstrap Barrio"
       And I should see "Vartheme Claro"
 
    @javascript @check @local @development @staging @production
@@ -119,3 +120,39 @@ So that I can use them after the install or update.
        And I should see "*@vardot.com" value in the "edit-allowed" input element
        And the "edit-description" checkbox is checked
        And the "edit-message" checkbox is checked
+
+   @javascript @check @local @development @staging
+   Scenario: Check Varbase password suggestions settings
+      When I go to "admin/config/system/varbase/varbase-security/password-suggestions-settings"
+       And I wait
+      Then I should see "Password Suggestions settings"
+       And I should see "Passwords match:" value in the "edit-confirmtitle" input element
+       And I should see "yes" value in the "edit-confirmsuccess" input element
+       And I should see "no" value in the "edit-confirmfailure" input element
+       And I should see "Password strength:" value in the "edit-strengthtitle" input element
+       And I should see "Recommendations to make your password stronger:" value in the "edit-hasweaknesses" input element
+       And I should see "Make it at least 8 characters" value in the "edit-tooshort" input element
+       And I should see "Add lowercase letters" value in the "edit-addlowercase" input element
+       And I should see "Add uppercase letters" value in the "edit-adduppercase" input element
+       And I should see "Add numbers" value in the "edit-addnumbers" input element
+       And I should see "Add punctuation" value in the "edit-addpunctuation" input element
+       And I should see "Make it different from your username" value in the "edit-sameasusername" input element
+       And I should see "Weak" value in the "edit-weak" input element
+       And I should see "Fair" value in the "edit-fair" input element
+       And I should see "Good" value in the "edit-good" input element
+       And I should see "Strong" value in the "edit-strong" input element
+
+   @javascript @check @local @development @staging
+   Scenario: Check password policy constraints
+      When I go to "admin/config/security/password-policy/default_policy"
+       And I wait
+       And I scroll to the bottom
+      Then I should see "Policy Constraints"
+       And I should see "Number of passwords that will be checked in the user password update history: 0"
+       And I should see "Password must not contain the user's username."
+       And I should see "Password character length of at least 8 characters"
+       And I should see "Minimum password character types: 4"
+       And I should see "Password must contain at least 1 special character"
+       And I should see "Password must contain at least 1 numeric character"
+       And I should see "Password must contain at least 1 uppercase character"
+       And I should see "Password must contain at least 1 lowercase character"
diff --git a/tests/features/varbase/05-content-management/05-00-add-default-entityqueue-testing-content-and-config.feature b/tests/features/varbase/05-content-management/05-00-add-default-entityqueue-testing-content-and-config.feature
index 68d5ba2c..9e63ecba 100644
--- a/tests/features/varbase/05-content-management/05-00-add-default-entityqueue-testing-content-and-config.feature
+++ b/tests/features/varbase/05-content-management/05-00-add-default-entityqueue-testing-content-and-config.feature
@@ -21,7 +21,7 @@ Scenario: Add Entity Queue Test Queue to be used with Test Content type
    Then I should see "Add entity queue"
    When I click "Add entity queue"
     And I wait
-   Then I should see "Configure entity queue"
+   Then I should see "Add entity queue"
    When I fill in "Test Queue" for "Name"
     And I wait for 5 seconds
     And I press "Save"
diff --git a/tests/tools/step1-init-tests/README.md b/tests/tools/step1-init-tests/README.md
index 01db55f4..04669a9e 100644
--- a/tests/tools/step1-init-tests/README.md
+++ b/tests/tools/step1-init-tests/README.md
@@ -3,4 +3,3 @@
 # Initialization of tests
 
 Moved to tests/tools
-
-- 
GitLab