-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Initialise the Test Environment
- Loading branch information
mattallan
committed
Jul 14, 2020
1 parent
b6b2bbe
commit f0ec47d
Showing
3 changed files
with
20 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Remove all pages - Docker wait-for-build uses a page with "ready" title to determine the environment is setup. We need to remove this file | ||
wp post delete $(wp post list --post_type='page' --format=ids) | ||
|
||
echo "Updating permalink structure" | ||
wp rewrite structure '/%postname%/' | ||
|
||
echo "Initializing WooCommerce E2E" | ||
wp plugin install woocommerce --activate | ||
wp theme install storefront --activate | ||
wp user create customer [email protected] --user_pass=password --role=customer --path=/var/www/html | ||
wp plugin activate woocommerce-gateway-paypal-express-checkout | ||
|
||
echo "Adding basic WooCommerce settings..." | ||
wp option set woocommerce_store_address "60 29th Street" | ||
|
@@ -19,4 +22,14 @@ wp option set woocommerce_product_type "both" | |
wp option set woocommerce_allow_tracking "no" | ||
|
||
echo "Importing WooCommerce shop pages..." | ||
wp wc --user=admin tool run install_pages | ||
wp wc --user=admin tool run install_pages | ||
|
||
echo "Installing and activating the WordPress Importer plugin" | ||
wp plugin install wordpress-importer --activate | ||
echo "Importing the WooCommerce sample data..." | ||
wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=skip | ||
|
||
wp user create customer [email protected] --user_pass=password --role=customer | ||
# Create the page which is used to determine if the test environment has been setup | ||
wp post create --post_type=page --post_status=publish --post_title='Ready' --post_content='E2E-tests.' | ||
echo "Success! E2E test environment has been setup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters