diff --git a/.travis.yml b/.travis.yml index d962768a..fd550f26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,8 @@ matrix: include: - name: "Coding standard check" - name: "E2E tests" + php: 7.4 + env: WP_VERSION=latest WP_MULTISITE=0 RUN_E2E=1 script: - composer require wp-cli/i18n-command - npm install jest --global diff --git a/tests/e2e/docker/initialize.sh b/tests/e2e/docker/initialize.sh index 47773f03..f913e02a 100644 --- a/tests/e2e/docker/initialize.sh +++ b/tests/e2e/docker/initialize.sh @@ -1,12 +1,15 @@ #!/bin/bash +# 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 +wp post delete $(wp post list --post_type='page' --format=ids) + echo "Updating permalink structure" wp rewrite structure '/%postname%/' echo "Initializing WooCommerce E2E" wp plugin install woocommerce --activate wp theme install storefront --activate -wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=password --role=customer --path=/var/www/html +wp plugin activate woocommerce-gateway-paypal-express-checkout echo "Adding basic WooCommerce settings..." wp option set woocommerce_store_address "60 29th Street" @@ -19,4 +22,14 @@ 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 \ No newline at end of file +wp wc --user=admin tool run install_pages + +echo "Installing and activating the WordPress Importer plugin" +wp plugin install wordpress-importer --activate +echo "Importing the WooCommerce sample data..." +wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=skip + +wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=password --role=customer +# Create the page which is used to determine if the test environment has been setup +wp post create --post_type=page --post_status=publish --post_title='Ready' --post_content='E2E-tests.' +echo "Success! E2E test environment has been setup" diff --git a/tests/e2e/setup/jest-setup.js b/tests/e2e/setup/jest-setup.js index 10f1a308..f3623da0 100644 --- a/tests/e2e/setup/jest-setup.js +++ b/tests/e2e/setup/jest-setup.js @@ -242,8 +242,8 @@ beforeAll( async () => { capturePageEventsForTearDown(); enablePageDialogAccept(); observeConsoleLogging(); - await trashExistingPosts(); - await importSampleProducts(); + // await trashExistingPosts(); + // await importSampleProducts(); await setupBrowser(); } ); @@ -253,4 +253,4 @@ afterEach( async () => { afterAll( () => { removePageEvents(); -} ); \ No newline at end of file +} );