Update admin and customer user details in docker compose file

This commit is contained in:
Julia Amosova 2019-11-24 13:49:39 +00:00
parent 882315182b
commit 05175254ed
3 changed files with 21 additions and 19 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;