move e2e-env to tests/e2e-env

This commit is contained in:
Ron Rennick 2020-04-07 05:43:11 -03:00 committed by Jeff Stieler
parent ccbb26bbbb
commit 393240a0f3
35 changed files with 28 additions and 32 deletions

2
.gitignore vendored
View File

@ -45,7 +45,7 @@ tests/cli/vendor
/tests/e2e-tests/config/local-*.json
/tests/e2e-tests/config/local.json
/tests/e2e-tests/docker
/assets/components/e2e-env/docker/wp-cli/initialize.sh
/tests/e2e-env/docker/wp-cli/initialize.sh
# Logs
/logs

View File

@ -2,7 +2,7 @@ version: ~> 1.0
import:
# This path will differ for projects using the published package.
- source: assets/components/e2e-env/.travis.yml
- source: tests/e2e-env/.travis.yml
# Merge the package config first.
mode: deep_merge_prepend
@ -45,13 +45,6 @@ matrix:
env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1
- name: "E2E tests"
php: 7.4
script:
- composer require wp-cli/i18n-command
- npm run build
- npm explore @woocommerce/e2e-env -- npm run docker:up
- bash tests/bin/run-e2e-CI.sh
after_script:
- npm explore @woocommerce/e2e-env -- npm run docker:down
- name: "Unit tests code coverage"
php: 7.4
env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1

View File

@ -5,10 +5,10 @@ services:
wordpress-www:
volumes:
# This path is relative to the first config file
# which is in assets/components/e2e-env or node_modules/@woocommerce/e2e-env
- "../../../:/var/www/html/wp-content/plugins/woocommerce"
# which is in tests/e2e-env or node_modules/@woocommerce/e2e-env
- "../../:/var/www/html/wp-content/plugins/woocommerce"
wordpress-cli:
volumes:
- "../../../:/var/www/html/wp-content/plugins/woocommerce"
- "../../:/var/www/html/wp-content/plugins/woocommerce"

2
package-lock.json generated
View File

@ -4830,7 +4830,7 @@
}
},
"@woocommerce/e2e-env": {
"version": "file:assets/components/e2e-env",
"version": "file:tests/e2e-env",
"dev": true
},
"@wordpress/e2e-test-utils": {

View File

@ -26,7 +26,7 @@
"@babel/preset-env": "7.9.0",
"@babel/register": "7.9.0",
"@jest/test-sequencer": "^25.0.0",
"@woocommerce/e2e-env": "file:assets/components/e2e-env",
"@woocommerce/e2e-env": "file:tests/e2e-env",
"@wordpress/e2e-test-utils": "4.3.1",
"autoprefixer": "9.7.5",
"babel-eslint": "10.1.0",

View File

@ -10,13 +10,13 @@
"e2e",
"puppeteer"
],
"homepage": "https://github.com/woocommerce/woocommerce-admin/tree/master/packages/e2e-env/README.md",
"homepage": "https://github.com/woocommerce/woocommerce/tree/master/tests/e2e-env/README.md",
"repository": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-admin.git"
"url": "https://github.com/woocommerce/woocommerce.git"
},
"bugs": {
"url": "https://github.com/woocommerce/woocommerce-admin/issues"
"url": "https://github.com/woocommerce/woocommerce/issues"
},
"main": "index.js",
"devDependencies": {

View File

@ -9,8 +9,8 @@ const getAppRoot = () => {
if ( -1 < moduleDir.indexOf( 'node_modules' ) ) {
appPath = moduleDir.split( 'node_modules' )[ 0 ];
} else if ( -1 < moduleDir.indexOf( 'assets/components/e2e-env' ) ) {
appPath = moduleDir.split( 'assets/components/e2e-env' )[ 0 ];
} else if ( -1 < moduleDir.indexOf( 'tests/e2e-env' ) ) {
appPath = moduleDir.split( 'tests/e2e-env' )[ 0 ];
}
return appPath;

View File

@ -1,14 +1,8 @@
/**
* External dependencies
*/
const { jestConfig } = require( 'puppeteer-utils' );
const modifiedConfig = jestConfig;
const afterEnvSetup = modifiedConfig.setupFilesAfterEnv;
const path = require( 'path' );
const { jestConfig: baseE2Econfig } = require( '@woocommerce/e2e-env' );
afterEnvSetup.push( '<rootDir>/tests/e2e-tests/config/jest.setup.js');
modifiedConfig.setupFilesAfterEnv = afterEnvSetup;
// Sort test path alphabetically. This is needed so that `activate-and-setup` tests run first
modifiedConfig.testSequencer = '<rootDir>/tests/e2e-tests/config/jest-custom-sequencer.js';
module.exports = modifiedConfig;
module.exports = {
...baseE2Econfig,
// Specify the path of your project's E2E tests here.
roots: [ path.resolve( __dirname, '../specs' ) ],
};

9
webpack.config.js Normal file
View File

@ -0,0 +1,9 @@
const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-env' );
module.exports = {
resolve: {
alias: {
...coreE2EAlias,
},
},
};