-
Notifications
You must be signed in to change notification settings - Fork 20
tests: e2e fixes #2467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: e2e fixes #2467
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,8 @@ | ||
| const { useE2EJestPuppeteerConfig } = require( '@woocommerce/e2e-environment' ); | ||
|
|
||
| const puppeteerConfig = useE2EJestPuppeteerConfig( { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just inlined this, no need to have another |
||
| module.exports = useE2EJestPuppeteerConfig( { | ||
| launch: { | ||
| slowMo: 100, | ||
| args: [ '--window-size=1920,1080', '--user-agent=chrome --runInBand --maxWorkers=4' ], | ||
| } | ||
| } ); | ||
|
|
||
| module.exports = puppeteerConfig; | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,22 +8,6 @@ | |||||||||||||||||
| Author URI: http:// | ||||||||||||||||||
| */ | ||||||||||||||||||
|
|
||||||||||||||||||
| define( 'JETPACK_DEV_DEBUG', true ); | ||||||||||||||||||
| define( 'WOOCOMMERCE_SERVICES_LOCAL_TEST_MODE', true ); | ||||||||||||||||||
| define( 'WOOCOMMERCE_CONNECT_FREQUENT_FETCH', true ); | ||||||||||||||||||
| define( 'WOOCOMMERCE_CONNECT_SERVER_URL', 'http://host.docker.internal:5000/' ); | ||||||||||||||||||
| define( 'WOOCOMMERCE_SERVICES_CI_TEST_MODE', true ); | ||||||||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed when woocommerce-services/woocommerce-services.php Lines 52 to 59 in ea71f8f
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this PR, these are also now set in |
||||||||||||||||||
|
|
||||||||||||||||||
| if ( get_option( 'woocommerce_default_country' ) !== 'US:NY' ) { | ||||||||||||||||||
| update_option( 'woocommerce_store_address', '1480 York Ave' ); | ||||||||||||||||||
| update_option( 'woocommerce_store_city', 'New York' ); | ||||||||||||||||||
| update_option( 'woocommerce_store_postcode', '10075' ); | ||||||||||||||||||
| update_option( 'woocommerce_default_country', 'US:NY' ); | ||||||||||||||||||
| update_option( 'woocommerce_currency', 'USD' ); | ||||||||||||||||||
| update_option( 'woocommerce_weight_unit', 'oz' ); | ||||||||||||||||||
| update_option( 'woocommerce_dimension_unit', 'in' ); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| // Mock out Jetpack Options | ||||||||||||||||||
| $jp_options = get_option( 'jetpack_options' ); | ||||||||||||||||||
| $jp_options['master_user'] = 1; | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,40 @@ | ||
| #!/bin/bash | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A space should not be valid here, I don't think |
||
| #!/bin/bash | ||
| echo "Initializing WooCommerce Services E2E" | ||
|
|
||
| WP_CORE_DIR="/var/www/html" | ||
| WCS_DIR="$WP_CORE_DIR/wp-content/plugins/woocommerce-services" | ||
|
|
||
| # install default theme | ||
| wp theme install twentynineteen --activate | ||
| # install woocommerce, jetpack | ||
| wp theme install storefront --activate | ||
|
|
||
| wp plugin install woocommerce --activate | ||
|
|
||
| ## adding basic settings and configuration | ||
| wp option set woocommerce_store_address "60 29th Street" | ||
| wp option set woocommerce_store_address_2 "#343" | ||
| wp option set woocommerce_store_city "San Francisco" | ||
| 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_weight_unit "oz" | ||
| wp option set woocommerce_dimension_unit "in" | ||
| wp option set woocommerce_product_type "both" | ||
| wp option set woocommerce_allow_tracking "no" | ||
| wp option update woocommerce_onboarding_profile '{"skipped": true }' --format=json | ||
|
|
||
| wp plugin install jetpack --activate | ||
| wp config set JETPACK_DEV_DEBUG true --raw | ||
|
|
||
| # create credentials for REST API | ||
| wp eval-file "$WCS_DIR/tests/bin/wc_rest_api_credentials.php" | ||
|
|
||
| # mock for Jetpack | ||
| cp "$WCS_DIR/tests/e2e/config/travis/wc-services-testing-helper.php" "$WP_CORE_DIR/wp-content/plugins/" | ||
|
|
||
| # finally activate WCS | ||
| wp config set WOOCOMMERCE_SERVICES_LOCAL_TEST_MODE true --raw | ||
| wp config set WOOCOMMERCE_CONNECT_FREQUENT_FETCH true --raw | ||
| wp config set WOOCOMMERCE_CONNECT_SERVER_URL http://host.docker.internal:5000/ | ||
| wp plugin activate woocommerce-services | ||
| wp plugin activate wc-services-testing-helper | ||
| wp option update jetpack_tos_agreed 1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this down, after
test:e2e-docker-up, because thetest:e2e-docker-upmight take a while. While that's completing, we can build the package in the meantime.This should save us some time on the duration of the workflow, as well as reduce errors while calling
test:e2e-docker-ping