diff --git a/docker-compose.yaml b/docker-compose.yaml index 1d581704dde..3a9f58118e9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -41,9 +41,9 @@ services: user: xfs command: > /bin/sh -c ' - wp core install --url=http://localhost:8084 --title="WooCommerce Core E2E Test Suite" --admin_user=admin --admin_password=password --admin_email=info@example.com --path=/var/www/html --skip-email; + wp core install --url=http://localhost:8084 --title="WooCommerce Core E2E Test Suite" --admin_user=admin --admin_password=password --admin_email=admin@woocommercecoree2etestsuite.com --path=/var/www/html --skip-email; wp plugin activate woocommerce; - wp user create customer customer@e2ewootestsite.com --user_pass=customer_password --role=customer --path=/var/www/html; + wp user create customer customer@woocommercecoree2etestsuite.com --user_pass=password --role=customer --path=/var/www/html; ' volumes: - wordpress:/var/www/html diff --git a/tests/e2e-tests/specs/activate-and-setup/setup-wizard.test.js b/tests/e2e-tests/specs/activate-and-setup/setup-wizard.test.js index 0e87dc447af..6199c39b7b2 100644 --- a/tests/e2e-tests/specs/activate-and-setup/setup-wizard.test.js +++ b/tests/e2e-tests/specs/activate-and-setup/setup-wizard.test.js @@ -2,11 +2,6 @@ * @format */ -/** - * External dependencies - */ -import { visitAdminPage } from '@wordpress/e2e-test-utils'; - /** * Internal dependencies */ @@ -27,7 +22,7 @@ describe( 'Store owner can login and make sure WooCommerce is activated', () => it( 'Can make sure WooCommerce is activated. If not, activate it', async () => { const slug = 'woocommerce'; - await visitAdminPage( 'plugins.php' ); + await StoreOwnerFlow.openPlugins(); const disableLink = await page.$( `tr[data-slug="${ slug }"] .deactivate a` ); if ( disableLink ) { return; diff --git a/tests/e2e-tests/utils/flows.js b/tests/e2e-tests/utils/flows.js index dc30d8ce5c6..f09927fa9f1 100644 --- a/tests/e2e-tests/utils/flows.js +++ b/tests/e2e-tests/utils/flows.js @@ -10,17 +10,18 @@ import { clearAndFillInput } from './index'; const config = require( 'config' ); const baseUrl = config.get( 'url' ); -const WP_ADMIN_LOGIN = baseUrl + '/wp-login.php'; -const WP_ADMIN_DASHBOARD = baseUrl + '/wp-admin/'; -const WP_ADMIN_SETUP_WIZARD = baseUrl + '/wp-admin/admin.php?page=wc-setup'; -const WP_ADMIN_NEW_COUPON = baseUrl + '/wp-admin/post-new.php?post_type=shop_coupon'; -const WP_ADMIN_NEW_ORDER = baseUrl + '/wp-admin/post-new.php?post_type=shop_order'; -const WP_ADMIN_NEW_PRODUCT = baseUrl + '/wp-admin/post-new.php?post_type=product'; -const WP_ADMIN_WC_SETTINGS = baseUrl + '/wp-admin/admin.php?page=wc-settings&tab='; -const WP_ADMIN_PERMALINK_SETTINGS = baseUrl + '/wp-admin/options-permalink.php/'; +const WP_ADMIN_LOGIN = baseUrl + 'wp-login.php'; +const WP_ADMIN_DASHBOARD = baseUrl + 'wp-admin'; +const WP_ADMIN_PLUGINS = baseUrl + 'wp-admin/plugins.php'; +const WP_ADMIN_SETUP_WIZARD = baseUrl + 'wp-admin/admin.php?page=wc-setup'; +const WP_ADMIN_NEW_COUPON = baseUrl + 'wp-admin/post-new.php?post_type=shop_coupon'; +const WP_ADMIN_NEW_ORDER = baseUrl + 'wp-admin/post-new.php?post_type=shop_order'; +const WP_ADMIN_NEW_PRODUCT = baseUrl + 'wp-admin/post-new.php?post_type=product'; +const WP_ADMIN_WC_SETTINGS = baseUrl + 'wp-admin/admin.php?page=wc-settings&tab='; +const WP_ADMIN_PERMALINK_SETTINGS = baseUrl + 'wp-admin/options-permalink.php'; -const SHOP_PRODUCT = baseUrl + '/?p='; -const SHOP_CART_PAGE = baseUrl + '/cart/'; +const SHOP_PRODUCT = baseUrl + '?p='; +const SHOP_CART_PAGE = baseUrl + 'cart/'; const getProductColumnExpression = ( productTitle ) => ( 'td[@class="product-name" and ' + @@ -113,7 +114,7 @@ const StoreOwnerFlow = { }, logout: async () => { - await page.goto(baseUrl + '/wp-login.php?action=logout', { + await page.goto(baseUrl + 'wp-login.php?action=logout', { waitUntil: 'networkidle0', }); @@ -155,6 +156,12 @@ const StoreOwnerFlow = { } ); }, + openPlugins: async () => { + await page.goto( WP_ADMIN_PLUGINS, { + waitUntil: 'networkidle0', + } ); + }, + openSettings: async ( tab, section = null ) => { let settingsUrl = WP_ADMIN_WC_SETTINGS + tab;