diff --git a/behat.yml b/behat.yml index eac28e6e..1a07be52 100644 --- a/behat.yml +++ b/behat.yml @@ -27,7 +27,7 @@ default: verbose: true paths: false snippets: false - junit: + html: verbose: true paths: false snippets: false @@ -74,7 +74,11 @@ default: javascript_session: selenium2 Drupal\DrupalExtension: blackbox: ~ - api_driver: 'drupal' + api_driver: 'drupal' + drush: + alias: 'local' + drupal: + drupal_root: '/var/www/html/test/varbase/docroot' region_map: content: ".main-container" footer: "#footer" @@ -87,6 +91,13 @@ default: error_message_selector: '.messages.error' success_message_selector: '.messages.status' warning_message_selector: '.messages.warning' + webship\BehatHTMLFormatter\BehatHTMLFormatterExtension: + name: html + renderer: Twig,Behat2 + file_name: index + print_args: false + print_outp: false + loop_break: false DrevOps\BehatScreenshotExtension: dir: '%paths.base%/tests/screenshots' fail: true diff --git a/composer.json b/composer.json index 976e3796..2a83ac42 100644 --- a/composer.json +++ b/composer.json @@ -102,6 +102,7 @@ "drupal/core-dev": "~10", "drush/drush": "~11.0", "drupal/drupal-extension": "~5.0", + "webship/behat-html-formatter": "~1.0", "drevops/behat-screenshot": "~1.0" }, "config": { diff --git a/scripts/README.md b/scripts/README.md index 0281ed47..45ad41f6 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,13 +1,156 @@ # Varbase Scripts -### Add Varbase Testing Users +## Add Varbase Testing Users + +To add testing users for each default user role in Varbase. + ``` cd PROJECT_DIR_NAME/docroot/profiles/contrib/varbase/scripts bash add-testing-users.sh ``` -### Delete Varbase Testing Users +The out put for this bash command: +``` + ---------------------------------------------------------------- + User name: Normal user + User mail: test.authenticated@vardot.com + User password: dD.123123ddd + User role: _none_ + ================================================================= + [success] Created a new user with uid 8 + No user role for this user + ---------------------------------------------------------------- + User name: Editor + User mail: test.editor@vardot.com + User password: dD.123123ddd + User role: editor + ================================================================= + [success] Created a new user with uid 9 + [success] Added editor role to Editor + ---------------------------------------------------------------- + User name: Content admin + User mail: test.content_admin@vardot.com + User password: dD.123123ddd + User role: content_admin + ================================================================= + [success] Created a new user with uid 10 + [success] Added content_admin role to Content admin + ---------------------------------------------------------------- + User name: SEO admin + User mail: test.seo_admin@vardot.com + User password: dD.123123ddd + User role: seo_admin + ================================================================= + [success] Created a new user with uid 11 + [success] Added seo_admin role to SEO admin + ---------------------------------------------------------------- + User name: Site admin + User mail: test.site_admin@vardot.com + User password: dD.123123ddd + User role: site_admin + ================================================================= + [success] Created a new user with uid 12 + [success] Added site_admin role to Site admin + ---------------------------------------------------------------- + User name: Super admin + User mail: test.super_admin@vardot.com + User password: dD.123123ddd + User role: administrator + ================================================================= + [success] Created a new user with uid 13 + [success] Added administrator role to Super admin +``` + +## Delete Varbase Testing Users +To delete all generated testing users, with all content created by them. ``` -## cd PROJECT_DIR_NAME/docroot/profiles/contrib/varbase/scripts -## bash delete-testing-users.sh +cd PROJECT_DIR_NAME/docroot/profiles/contrib/varbase/scripts +bash delete-testing-users.sh +``` + +The out put for this bash command: +``` + ---------------------------------------------------------------- + User name: Normal user + User mail: test.authenticated@vardot.com + User password: dD.123123ddd + User role: _none_ + ================================================================= + [warning] All content created by Normal user will be deleted. + + // Cancel user account?: : yes. + +> [notice] Deleted user: Normal user . +> [notice] Message: Account /Normal user/ has been deleted. +> + ---------------------------------------------------------------- + User name: Editor + User mail: test.editor@vardot.com + User password: dD.123123ddd + User role: editor + ================================================================= + [warning] All content created by Editor will be deleted. + + // Cancel user account?: : yes. + +> [notice] Deleted user: Editor . +> [notice] Message: Account /Editor/ has been deleted. +> + ---------------------------------------------------------------- + User name: Content admin + User mail: test.content_admin@vardot.com + User password: dD.123123ddd + User role: content_admin + ================================================================= + [warning] All content created by Content admin will be deleted. + + // Cancel user account?: : yes. + +> [notice] Deleted user: Content admin . +> [notice] Message: Account /Content admin/ has been deleted. +> + ---------------------------------------------------------------- + User name: SEO admin + User mail: test.seo_admin@vardot.com + User password: dD.123123ddd + User role: seo_admin + ================================================================= + [warning] All content created by SEO admin will be deleted. + + // Cancel user account?: : yes. + +> [notice] Deleted user: SEO admin . +> [notice] Message: Account /SEO admin/ has been deleted. +> + ---------------------------------------------------------------- + User name: Site admin + User mail: test.site_admin@vardot.com + User password: dD.123123ddd + User role: site_admin + ================================================================= + [warning] All content created by Site admin will be deleted. + + // Cancel user account?: : yes. + +> [notice] Deleted user: Site admin . +> [notice] Message: Account /Site admin/ has been deleted. +> + ---------------------------------------------------------------- + User name: Super admin + User mail: test.super_admin@vardot.com + User password: dD.123123ddd + User role: administrator + ================================================================= + [warning] All content created by Super admin will be deleted. + + // Cancel user account?: : yes. + +> [notice] Deleted user: Super admin . +> [notice] Message: Account /Super admin/ has been deleted. + ``` +## Change the list of users and their passwords +* Edit the `varbase.users.yml` file. +* Add more users or change the password for the listed users +* The `add-testing-users.sh` and `delete-testing-users.sh` bash command will +read all changes and apply them.from the `varbase.users.yml`. \ No newline at end of file diff --git a/scripts/add-testing-users.sh b/scripts/add-testing-users.sh index df04b8bd..dadc5070 100644 --- a/scripts/add-testing-users.sh +++ b/scripts/add-testing-users.sh @@ -13,7 +13,7 @@ source ${current_path}/libs/bash-yaml.sh || exit 1 ; # Load the list of default users for Varbase. eval $(parse_yaml ${current_path}/varbase.users.yml); -cd ../../../ ; +cd ../../../../ ; for user in ${users[@]} do user_name="user_${user}_name"; diff --git a/scripts/delete-testing-users.sh b/scripts/delete-testing-users.sh index 44a1a399..357d5b3f 100644 --- a/scripts/delete-testing-users.sh +++ b/scripts/delete-testing-users.sh @@ -11,7 +11,7 @@ source ${current_path}/libs/bash-yaml.sh || exit 1 ; # Load the list of default users for Varbase. eval $(parse_yaml ${current_path}/varbase.users.yml); -cd ../../../ ; +cd ../../../../ ; for user in ${users[@]} do user_name="user_${user}_name";