Commit b477cb8d3 for woocommerce
commit b477cb8d3a74c5dcf0954bd4ba28558ef4e844d8
Author: Ron Rennick <ron@ronandandrea.com>
Date: Wed Jan 13 07:27:11 2021 -0400
only activate WooCommerce in E2E initialization (#28588)
* only activate WooCommerce in E2E initialization
* use project basename for default plugin path
diff --git a/tests/e2e/docker/initialize.sh b/tests/e2e/docker/initialize.sh
index 86426ca19..c5cbea471 100755
--- a/tests/e2e/docker/initialize.sh
+++ b/tests/e2e/docker/initialize.sh
@@ -2,9 +2,9 @@
echo "Initializing WooCommerce E2E"
-wp plugin install woocommerce --activate
+wp plugin activate woocommerce
wp theme install twentynineteen --activate
-wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=password --role=customer --path=/var/www/html
+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
diff --git a/tests/e2e/env/bin/docker-compose.js b/tests/e2e/env/bin/docker-compose.js
index a547b59db..39fcc3da7 100755
--- a/tests/e2e/env/bin/docker-compose.js
+++ b/tests/e2e/env/bin/docker-compose.js
@@ -4,7 +4,7 @@ const { spawnSync } = require( 'child_process' );
const program = require( 'commander' );
const path = require( 'path' );
const fs = require( 'fs' );
-const { getAppRoot, getAppName, getTestConfig } = require( '../utils' );
+const { getAppBase, getAppRoot, getAppName, getTestConfig } = require( '../utils' );
const dockerArgs = [];
let command = '';
@@ -65,7 +65,7 @@ const testConfig = getTestConfig();
// Set some environment variables
if ( ! process.env.WC_E2E_FOLDER_MAPPING ) {
- envVars.WC_E2E_FOLDER_MAPPING = '/var/www/html/wp-content/plugins/' + envVars.APP_NAME;
+ envVars.WC_E2E_FOLDER_MAPPING = '/var/www/html/wp-content/plugins/' + getAppBase();
}
if ( ! process.env.WORDPRESS_PORT ) {
process.env.WORDPRESS_PORT = testConfig.port;
diff --git a/tests/e2e/env/utils/app-name.js b/tests/e2e/env/utils/app-name.js
index 9692b15e5..1b3e69253 100644
--- a/tests/e2e/env/utils/app-name.js
+++ b/tests/e2e/env/utils/app-name.js
@@ -13,8 +13,15 @@ const getAppName = () => {
if ( testConfig.appName ) {
return testConfig.appName;
}
+ return getAppBase();
+};
+
+const getAppBase = () => {
const appRoot = getAppRoot();
return path.basename( appRoot );
-};
+}
-module.exports = getAppName;
+module.exports = {
+ getAppName,
+ getAppBase,
+};
diff --git a/tests/e2e/env/utils/index.js b/tests/e2e/env/utils/index.js
index 0bdeb8afc..88bacb6c7 100644
--- a/tests/e2e/env/utils/index.js
+++ b/tests/e2e/env/utils/index.js
@@ -1,8 +1,9 @@
const getAppRoot = require( './app-root' );
-const getAppName = require( './app-name' );
+const { getAppName, getAppBase } = require( './app-name' );
const getTestConfig = require( './test-config' );
module.exports = {
+ getAppBase,
getAppRoot,
getAppName,
getTestConfig,