Skip to content

Commit

Permalink
Move env setup out of docker init and in before running e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattallan committed Jul 8, 2020
1 parent 23589ee commit a5ea52e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
"wp_org_slug": "woocommerce-gateway-paypal-express-checkout"
},
"scripts": {
"test:e2e": "npm explore @woocommerce/e2e-environment -- npm run test:e2e",
"test:e2e-dev": "npm explore @woocommerce/e2e-environment -- npm run test:e2e-dev",
"test:e2e": "npm run test:env-setup && npm explore @woocommerce/e2e-environment -- npm run test:e2e",
"test:e2e-dev": "npm run test:env-setup && npm explore @woocommerce/e2e-environment -- npm run test:e2e-dev",
"test:env-setup": "./tests/e2e/env/setup.sh",
"docker:up": "npm explore @woocommerce/e2e-environment -- npm run docker:up",
"docker:down": "npm explore @woocommerce/e2e-environment -- npm run docker:down"
},
Expand Down
10 changes: 8 additions & 2 deletions tests/e2e/docker/initialize.sh → tests/e2e/env/setup.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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 user create customer [email protected] --user_pass=password --role=customer

echo "Adding basic WooCommerce settings..."
wp option set woocommerce_store_address "60 29th Street"
Expand All @@ -19,4 +19,10 @@ 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 some sample data..."
wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=skip
1 change: 0 additions & 1 deletion tests/e2e/setup/jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ beforeAll( async () => {
enablePageDialogAccept();
observeConsoleLogging();
await trashExistingPosts();
await importSampleProducts();
await setupBrowser();
} );

Expand Down

0 comments on commit a5ea52e

Please sign in to comment.