From a06aaec4a9c904c57ba2ac55b63afeac041f66a5 Mon Sep 17 00:00:00 2001
From: Rajab Natshah <rajabn@gmail.com>
Date: Tue, 18 Jun 2019 20:10:08 +0300
Subject: [PATCH] Issue #3060823: Change the [ Feature: Create default testing
 users ] Automated Functional Acceptance Testing to work with changes after
 enabling [Generate Password] module in the 8.x-7.x branch

---
 .../01-create-default-testing-users.feature   | 117 +++++++++++++-----
 1 file changed, 88 insertions(+), 29 deletions(-)

diff --git a/tests/features/varbase/step1-init-tests/01-create-default-testing-users.feature b/tests/features/varbase/step1-init-tests/01-create-default-testing-users.feature
index 04944927..50aeb64a 100644
--- a/tests/features/varbase/step1-init-tests/01-create-default-testing-users.feature
+++ b/tests/features/varbase/step1-init-tests/01-create-default-testing-users.feature
@@ -17,78 +17,137 @@ Feature: Create default testing users.
      Then I should see "Add user"
      When I fill in "authenticated.test@vardot.com" for "Email address"
       And I fill in "test_authenticated" for "Username"
-      And I fill in "dD.123123ddd" for "Password"
-      And I fill in "dD.123123ddd" for "Confirm password"
       And I press "Create new account"
       And I wait
-     Then I should not see "The name test_authenticated is already taken."
+      And I go to "/admin/people"
+      And I wait
+      And I fill in "test_authenticated" for "Name or email contains"
+      And I press "Filter"
+      And I wait
+     Then I should see "test_authenticated"
+     When I click "Edit" in the "test_authenticated" row
+     Then I should see "test_authenticated"
+     When I fill in "dD.123123ddd" for "Password"
+      And I fill in "dD.123123ddd" for "Confirm password"
+      And I press "Save"
+      And I wait
+     Then I should see "The changes have been saved."
 
   @init @tools @local @development @staging
   Scenario: Create the test_editor user.
      When I go to "/admin/people/create"
       And I wait
      Then I should see "Add user"
-     When I fill in "editor.test@vardot.com" for "Email address"
+     When I check the box "Editor"
+      And I fill in "editor.test@vardot.com" for "Email address"
       And I fill in "test_editor" for "Username"
-      And I fill in "dD.123123ddd" for "Password"
-      And I fill in "dD.123123ddd" for "Confirm password"
-      And I check the box "Editor"
       And I press "Create new account"
       And I wait
-     Then I should not see "The name test_editor is already taken."
+      And I go to "/admin/people"
+      And I wait
+      And I fill in "test_editor" for "Name or email contains"
+      And I press "Filter"
+      And I wait
+     Then I should see "test_editor"
+     When I click "Edit" in the "test_editor" row
+     Then I should see "test_editor"
+     When I fill in "dD.123123ddd" for "Password"
+      And I fill in "dD.123123ddd" for "Confirm password"
+      And I press "Save"
+      And I wait
+     Then I should see "The changes have been saved."
 
   @init @tools @local @development @staging
   Scenario: Create the test_content_admin user.
      When I go to "/admin/people/create"
       And I wait
      Then I should see "Add user"
-     When I fill in "content.admin.test@vardot.com" for "Email address"
+     When I check the box "Content Admin"
+      And I fill in "content.admin.test@vardot.com" for "Email address"
       And I fill in "test_content_admin" for "Username"
-      And I fill in "dD.123123ddd" for "Password"
-      And I fill in "dD.123123ddd" for "Confirm password"
-      And I check the box "Content Admin"
       And I press "Create new account"
       And I wait
-     Then I should not see "The name test_content_admin is already taken."
+      And I go to "/admin/people"
+      And I wait
+      And I fill in "test_content_admin" for "Name or email contains"
+      And I press "Filter"
+      And I wait
+     Then I should see "test_content_admin"
+     When I click "Edit" in the "test_content_admin" row
+     Then I should see "test_content_admin"
+     When I fill in "dD.123123ddd" for "Password"
+      And I fill in "dD.123123ddd" for "Confirm password"
+      And I press "Save"
+      And I wait
+     Then I should see "The changes have been saved."
 
   @init @tools @local @development @staging
   Scenario: Create the test_seo_admin user.
      When I go to "/admin/people/create"
       And I wait
-     Then I should see "Add user"
-     When I fill in "seo.admin.test@vardot.com" for "Email address"
+     When I check the box "SEO Admin"
+      And I fill in "seo.admin.test@vardot.com" for "Email address"
       And I fill in "test_seo_admin" for "Username"
-      And I fill in "dD.123123ddd" for "Password"
-      And I fill in "dD.123123ddd" for "Confirm password"
-      And I check the box "SEO Admin"
       And I press "Create new account"
       And I wait
-     Then I should not see "The name test_seo_admin is already taken."
+      And I go to "/admin/people"
+      And I wait
+      And I fill in "test_seo_admin" for "Name or email contains"
+      And I press "Filter"
+      And I wait
+     Then I should see "test_seo_admin"
+     When I click "Edit" in the "test_seo_admin" row
+     Then I should see "test_seo_admin"
+     When I fill in "dD.123123ddd" for "Password"
+      And I fill in "dD.123123ddd" for "Confirm password"
+      And I press "Save"
+      And I wait
+     Then I should see "The changes have been saved."
 
   @init @tools @local @development @staging
   Scenario: Create the test_site_admin user.
      When I go to "/admin/people/create"
       And I wait
      Then I should see "Add user"
-     When I fill in "site.admin.test@vardot.com" for "Email address"
+     When I check the box "Site Admin"
+      And I fill in "site.admin.test@vardot.com" for "Email address"
       And I fill in "test_site_admin" for "Username"
-      And I fill in "dD.123123ddd" for "Password"
-      And I fill in "dD.123123ddd" for "Confirm password"
-      And I check the box "Site Admin"
       And I press "Create new account"
       And I wait
-     Then I should not see "The name test_site_admin is already taken."
+      And I go to "/admin/people"
+      And I wait
+      And I fill in "test_site_admin" for "Name or email contains"
+      And I press "Filter"
+      And I wait
+     Then I should see "test_site_admin"
+     When I click "Edit" in the "test_site_admin" row
+     Then I should see "test_site_admin"
+     When I fill in "dD.123123ddd" for "Password"
+      And I fill in "dD.123123ddd" for "Confirm password"
+      And I press "Save"
+      And I wait
+     Then I should see "The changes have been saved."
 
   @init @tools @local @development @staging
   Scenario: Create the test_super_admin user.
      When I go to "/admin/people/create"
       And I wait
      Then I should see "Add user"
-     When I fill in "super.admin.test@vardot.com" for "Email address"
+     When I check the box "Super Admin"
+      And I fill in "super.admin.test@vardot.com" for "Email address"
       And I fill in "test_super_admin" for "Username"
-      And I fill in "dD.123123ddd" for "Password"
-      And I fill in "dD.123123ddd" for "Confirm password"
-      And I check the box "Super Admin"
       And I press "Create new account"
       And I wait
-     Then I should not see "The name test_super_admin is already taken."
+      And I go to "/admin/people"
+      And I wait
+      And I fill in "test_super_admin" for "Name or email contains"
+      And I press "Filter"
+      And I wait
+     Then I should see "test_super_admin"
+     When I click "Edit" in the "test_super_admin" row
+     Then I should see "test_super_admin"
+     When I fill in "dD.123123ddd" for "Password"
+      And I fill in "dD.123123ddd" for "Confirm password"
+      And I press "Save"
+      And I wait
+     Then I should see "The changes have been saved."
-- 
GitLab