merge master

This commit is contained in:
Ron Rennick 2021-01-19 17:00:10 -04:00
commit baa4bb5da1
10 changed files with 53 additions and 17 deletions

View File

@ -476,6 +476,7 @@ return array(
),
'FI' => array(),
'FR' => array(),
'GF' => array(),
'GH' => array( // Ghanaian Regions.
'AF' => __( 'Ahafo', 'woocommerce' ),
'AH' => __( 'Ashanti', 'woocommerce' ),
@ -511,7 +512,30 @@ return array(
'L' => __( 'South Aegean', 'woocommerce' ),
'M' => __( 'Crete', 'woocommerce' ),
),
'GF' => array(),
'GT' => array( // Guatemalan states.
'AV' => __( 'Alta Verapaz', 'woocommerce' ),
'BV' => __( 'Baja Verapaz', 'woocommerce' ),
'CM' => __( 'Chimaltenango', 'woocommerce' ),
'CQ' => __( 'Chiquimula', 'woocommerce' ),
'PR' => __( 'El Progreso', 'woocommerce' ),
'ES' => __( 'Escuintla', 'woocommerce' ),
'GU' => __( 'Guatemala', 'woocommerce' ),
'HU' => __( 'Huehuetenango', 'woocommerce' ),
'IZ' => __( 'Izabal', 'woocommerce' ),
'JA' => __( 'Jalapa', 'woocommerce' ),
'JU' => __( 'Jutiapa', 'woocommerce' ),
'PE' => __( 'Petén', 'woocommerce' ),
'QZ' => __( 'Quetzaltenango', 'woocommerce' ),
'QC' => __( 'Quiché', 'woocommerce' ),
'RE' => __( 'Retalhuleu', 'woocommerce' ),
'SA' => __( 'Sacatepéquez', 'woocommerce' ),
'SM' => __( 'San Marcos', 'woocommerce' ),
'SR' => __( 'Santa Rosa', 'woocommerce' ),
'SO' => __( 'Sololá', 'woocommerce' ),
'SU' => __( 'Suchitepéquez', 'woocommerce' ),
'TO' => __( 'Totonicapán', 'woocommerce' ),
'ZA' => __( 'Zacapa', 'woocommerce' )
),
'HK' => array( // Hong Kong states.
'HONG KONG' => __( 'Hong Kong Island', 'woocommerce' ),
'KOWLOON' => __( 'Kowloon', 'woocommerce' ),

View File

@ -1,6 +1,5 @@
import { SimpleProduct } from '@woocommerce/api';
import {
switchUserToAdmin,
visitAdminPage,
switchUserToTest,
clearLocalStorage,
@ -8,13 +7,15 @@ import {
factories,
} from '@woocommerce/e2e-utils';
const { merchant } = require( '@woocommerce/e2e-utils' );
/**
* Navigates to the post listing screen and bulk-trashes any posts which exist.
*
* @return {Promise} Promise resolving once posts have been trashed.
*/
async function trashExistingPosts() {
await switchUserToAdmin();
await merchant.login();
// Visit `/wp-admin/edit.php` so we can see a list of posts and delete them.
await visitAdminPage( 'edit.php' );

3
tests/e2e/env/.env vendored
View File

@ -9,6 +9,3 @@ WORDPRESS_DEBUG=1
# WordPress CLI environment
WORDPRESS_HOST=wordpress-www:80
WORDPRESS_TITLE=WooCommerce Core E2E Test Suite
WORDPRESS_LOGIN=admin
WORDPRESS_PASSWORD=password
WORDPRESS_EMAIL=admin@woocommercecoree2etestsuite.com

View File

@ -9,6 +9,7 @@
## Fixed
- Remove redundant `puppeteer` dependency
- Support for admin user configuration from default.json
# 0.1.6

View File

@ -4,7 +4,7 @@ const { spawnSync } = require( 'child_process' );
const program = require( 'commander' );
const path = require( 'path' );
const fs = require( 'fs' );
const { getAppBase, getAppRoot, getAppName, getTestConfig } = require( '../utils' );
const { getAdminConfig, getAppBase, getAppRoot, getAppName, getTestConfig } = require( '../utils' );
const dockerArgs = [];
let command = '';
@ -29,7 +29,7 @@ program
.parse( process.argv );
const appPath = getAppRoot();
const envVars = {};
const envVars = getAdminConfig();
if ( appPath ) {
if ( 'up' === command ) {

View File

@ -48,11 +48,6 @@ The built in container initialization needs to know the particulars of your test
"username": "admin",
"password": "password",
"email": "admin@woocommercecoree2etestsuite.com"
},
"customer": {
"username": "customer",
"password": "password",
"email": "customer@woocommercecoree2etestsuite.com"
}
}
}

View File

@ -5,7 +5,7 @@ const path = require( 'path' );
/**
* Internal dependencies
*/
const getTestConfig = require( './test-config' );
const { getTestConfig } = require( './test-config' );
const getAppRoot = require( './app-root' );
const getAppName = () => {

View File

@ -1,7 +1,7 @@
/**
* Provide the base test URL to bash scripts.
*/
const getTestConfig = require( './test-config' );
const { getTestConfig } = require( './test-config' );
const testConfig = getTestConfig();
console.log( testConfig.baseUrl );

View File

@ -1,10 +1,11 @@
const getAppRoot = require( './app-root' );
const { getAppName, getAppBase } = require( './app-name' );
const getTestConfig = require( './test-config' );
const { getTestConfig, getAdminConfig } = require( './test-config' );
module.exports = {
getAppBase,
getAppRoot,
getAppName,
getTestConfig,
getAdminConfig,
};

View File

@ -27,4 +27,21 @@ const getTestConfig = () => {
return testConfig;
};
module.exports = getTestConfig;
/**
* Get user account settings for Docker configuration.
*/
const getAdminConfig = () => {
const testConfig = getTestConfig();
const adminConfig = {
'WORDPRESS_LOGIN': testConfig.users.admin.username ? testConfig.users.admin.username : 'admin',
'WORDPRESS_PASSWORD': testConfig.users.admin.password ? testConfig.users.admin.password : 'password',
'WORDPRESS_EMAIL': testConfig.users.admin.email ? testConfig.users.admin.email : 'admin@woocommercecoree2etestsuite.com',
};
return adminConfig;
};
module.exports = {
getTestConfig,
getAdminConfig,
};