Skip to content

Commit

Permalink
move e2e-env to tests/e2e-env
Browse files Browse the repository at this point in the history
  • Loading branch information
rrennick authored and jeffstieler committed Apr 14, 2020
1 parent ccbb26b commit 393240a
Show file tree
Hide file tree
Showing 35 changed files with 28 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
File renamed without changes.
File renamed without changes.
20 changes: 7 additions & 13 deletions tests/e2e-tests/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-env' );

module.exports = {
resolve: {
alias: {
...coreE2EAlias,
},
},
};

0 comments on commit 393240a

Please sign in to comment.