1
1
#! /bin/bash
2
2
3
+ # 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
4
+ wp post delete $( wp post list --post_type=' page' --format=ids)
5
+
3
6
echo " Updating permalink structure"
4
7
wp rewrite structure ' /%postname%/'
5
8
6
9
echo " Initializing WooCommerce E2E"
7
10
wp plugin install woocommerce --activate
8
11
wp theme install storefront --activate
9
- wp
user create customer [email protected] --user_pass=password --role=customer --path=/var/www/html
12
+ wp plugin activate woocommerce-gateway-paypal-express-checkout
10
13
11
14
echo " Adding basic WooCommerce settings..."
12
15
wp option set woocommerce_store_address " 60 29th Street"
@@ -19,4 +22,14 @@ wp option set woocommerce_product_type "both"
19
22
wp option set woocommerce_allow_tracking " no"
20
23
21
24
echo " Importing WooCommerce shop pages..."
22
- wp wc --user=admin tool run install_pages
25
+ wp wc --user=admin tool run install_pages
26
+
27
+ echo " Installing and activating the WordPress Importer plugin"
28
+ wp plugin install wordpress-importer --activate
29
+ echo " Importing the WooCommerce sample data..."
30
+ wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=skip
31
+
32
+ wp user create customer
[email protected] --user_pass=password --role=customer
33
+ # Create the page which is used to determine if the test environment has been setup
34
+ wp post create --post_type=page --post_status=publish --post_title=' Ready' --post_content=' E2E-tests.'
35
+ echo " Success! E2E test environment has been setup"
0 commit comments