Skip to content

Commit

Permalink
Issue #3351733: Move Varbase profile from docroot/profiles/varbase to…
Browse files Browse the repository at this point in the history
… docroot/profiles/contrib/varbase
  • Loading branch information
Natshah committed Apr 3, 2023
1 parent 95012f2 commit f19cc6e
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 8 deletions.
15 changes: 13 additions & 2 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ default:
verbose: true
paths: false
snippets: false
junit:
html:
verbose: true
paths: false
snippets: false
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
151 changes: 147 additions & 4 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -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: [email protected]
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: [email protected]
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: [email protected]
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: [email protected]
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: [email protected]
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: [email protected]
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: [email protected]
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 <[email protected]>.
> [notice] Message: Account /Normal user/ has been deleted.
>
----------------------------------------------------------------
User name: Editor
User mail: [email protected]
User password: dD.123123ddd
User role: editor
=================================================================
[warning] All content created by Editor will be deleted.
// Cancel user account?: : yes.
> [notice] Deleted user: Editor <[email protected]>.
> [notice] Message: Account /Editor/ has been deleted.
>
----------------------------------------------------------------
User name: Content admin
User mail: [email protected]
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 <[email protected]>.
> [notice] Message: Account /Content admin/ has been deleted.
>
----------------------------------------------------------------
User name: SEO admin
User mail: [email protected]
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 <[email protected]>.
> [notice] Message: Account /SEO admin/ has been deleted.
>
----------------------------------------------------------------
User name: Site admin
User mail: [email protected]
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 <[email protected]>.
> [notice] Message: Account /Site admin/ has been deleted.
>
----------------------------------------------------------------
User name: Super admin
User mail: [email protected]
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 <[email protected]>.
> [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`.
2 changes: 1 addition & 1 deletion scripts/add-testing-users.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion scripts/delete-testing-users.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit f19cc6e

Please sign in to comment.