2021-03-19 16:40:04 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
echo "Initializing WooCommerce E2E"
|
|
|
|
|
2021-07-30 19:38:31 +00:00
|
|
|
wp plugin activate woocommerce
|
2021-03-19 16:40:04 +00:00
|
|
|
|
|
|
|
wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=password --role=subscriber --path=/var/www/html
|
|
|
|
|
|
|
|
# we cannot create API keys for the API, so we using basic auth, this plugin allows that.
|
|
|
|
wp plugin install https://github.com/WP-API/Basic-Auth/archive/master.zip --activate
|
|
|
|
|
|
|
|
# update permalinks to `pretty` to make it easier for testing APIs with k6
|
|
|
|
wp option update permalink_structure '/%postname%'
|
|
|
|
|
|
|
|
# install the WP Mail Logging plugin to test emails
|
|
|
|
wp plugin install wp-mail-logging --activate
|
|
|
|
|
|
|
|
# Installing and activating the WordPress Importer plugin to import sample products"
|
|
|
|
wp plugin install wordpress-importer --activate
|
|
|
|
|
|
|
|
# Adding basic WooCommerce settings"
|
|
|
|
wp option set woocommerce_store_address "Example Address Line 1"
|
|
|
|
wp option set woocommerce_store_address_2 "Example Address Line 2"
|
|
|
|
wp option set woocommerce_store_city "Example City"
|
|
|
|
wp option set woocommerce_default_country "US:CA"
|
|
|
|
wp option set woocommerce_store_postcode "94110"
|
|
|
|
wp option set woocommerce_currency "USD"
|
|
|
|
wp option set woocommerce_product_type "both"
|
|
|
|
wp option set woocommerce_allow_tracking "no"
|
2021-07-30 19:38:31 +00:00
|
|
|
wp option set woocommerce_enable_checkout_login_reminder "yes"
|
2021-03-19 16:40:04 +00:00
|
|
|
wp option set --format=json woocommerce_cod_settings '{"enabled":"yes"}'
|
|
|
|
|
|
|
|
# WooCommerce shop pages
|
|
|
|
wp wc --user=admin tool run install_pages
|
|
|
|
|
|
|
|
# Importing WooCommerce sample products"
|
|
|
|
wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=skip
|
|
|
|
|
|
|
|
# install Storefront
|
|
|
|
wp theme install storefront --activate
|
|
|
|
|
2021-03-19 16:58:02 +00:00
|
|
|
echo "Success! Your E2E Test Environment is now ready."
|