-
Notifications
You must be signed in to change notification settings - Fork 20
test: fix e2e tests #2462
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
test: fix e2e tests #2462
Changes from all commits
bdbeb04
bbddd55
7502bbf
5a54969
fdab620
678006a
1c4190b
6430aa2
2190b98
90e3211
18b9741
e8b2812
135e25c
3aa97f0
19c6ae7
778c650
4504a07
a80f9bc
4632f32
0375eca
efc2787
eb6b699
bc9faf0
ece01c5
f223b61
4cef629
f8b9351
b000d4d
e2c1a12
b0220a7
8775dd2
a71fade
d7878a4
da81be6
510e4e6
1a2d7bf
a48e811
49e7546
906bcf7
e57bc29
dcc161b
cd54164
205767a
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 |
||
|
|
||
| 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 |
||
| #!/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