From 6ba56ad15b9401bacbc57aecfa2e9a75b94844b4 Mon Sep 17 00:00:00 2001 From: Rostislav Wolny Date: Mon, 12 Apr 2021 16:43:47 +0200 Subject: [PATCH] Add ability to use 3rd party plugin functions in acceptance tests All plugins that we keep active during acceptance tests bootstrap are then loaded by WP Browser extension and that gives us ability to use their functions and classes within the acceptance tests. [MAILPOET-3471] --- tests/docker/codeception/docker-entrypoint.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/docker/codeception/docker-entrypoint.sh b/tests/docker/codeception/docker-entrypoint.sh index 1e500dfd12..205b5c3cc8 100755 --- a/tests/docker/codeception/docker-entrypoint.sh +++ b/tests/docker/codeception/docker-entrypoint.sh @@ -59,7 +59,7 @@ if [[ $CIRCLE_JOB == *"_latest" ]]; then WOOCOMMERCE_VERSION="latest" fi -# install WooCommerce (activate & deactivate it to populate DB for backup) +# install WooCommerce if [[ ! -d "/wp-core/wp-content/plugins/woocommerce" ]]; then cd /wp-core/wp-content/plugins WOOCOMMERCE_SOURCE_ZIP="/wp-core/wp-content/plugins/mailpoet/tools/vendor/woocommerce.zip" @@ -80,8 +80,6 @@ if [[ ! -d "/wp-core/wp-content/plugins/woocommerce" ]]; then echo "Unzip Woocommerce plugin from $WOOCOMMERCE_TARGET_ZIP" unzip -q -o "$WOOCOMMERCE_TARGET_ZIP" fi -wp plugin activate woocommerce -wp plugin deactivate woocommerce # Install WooCommerce Subscriptions if [[ ! -d "/wp-core/wp-content/plugins/woocommerce-subscriptions" ]]; then @@ -96,6 +94,10 @@ if [[ ! -d "/wp-core/wp-content/plugins/woocommerce-subscriptions" ]]; then unzip -q -o "$WOOCOMMERCE_SUBS_ZIP" -d /wp-core/wp-content/plugins/ fi +# activate all plugins which source code want to access in tests runtime +wp plugin activate woocommerce +wp plugin activate woocommerce-subscriptions + # add configuration CONFIG='' CONFIG+="define('WP_DEBUG', true);\n"