change component name to e2e-environment
This commit is contained in:
parent
105cea27c5
commit
0de3718770
|
@ -1,5 +1,5 @@
|
|||
/** @format */
|
||||
const baseConfig = require( '@woocommerce/e2e-env' ).esLintConfig;
|
||||
const baseConfig = require( '@woocommerce/e2e-environment' ).esLintConfig;
|
||||
|
||||
module.exports = {
|
||||
...baseConfig,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const e2eBabelConfig = require( '@woocommerce/e2e-env' ).babelConfig;
|
||||
const e2eBabelConfig = require( '@woocommerce/e2e-environment' ).babelConfig;
|
||||
|
||||
module.exports = function( api ) {
|
||||
api.cache( true );
|
||||
|
|
|
@ -5,7 +5,7 @@ services:
|
|||
wordpress-www:
|
||||
volumes:
|
||||
# This path is relative to the first config file
|
||||
# which is in tests/e2e/env or node_modules/@woocommerce/e2e-env
|
||||
# which is in tests/e2e/env or node_modules/@woocommerce/e2e-environment
|
||||
- "../../../:/var/www/html/wp-content/plugins/woocommerce"
|
||||
|
||||
wordpress-cli:
|
||||
|
|
|
@ -5005,7 +5005,7 @@
|
|||
"@xtuc/long": "4.2.2"
|
||||
}
|
||||
},
|
||||
"@woocommerce/e2e-env": {
|
||||
"@woocommerce/e2e-environment": {
|
||||
"version": "file:tests/e2e/env",
|
||||
"dev": true
|
||||
},
|
||||
|
|
10
package.json
10
package.json
|
@ -13,10 +13,10 @@
|
|||
"build": "grunt && npm run makepot",
|
||||
"build-watch": "grunt watch",
|
||||
"lint:js": "eslint assets/js --ext=js",
|
||||
"docker:up": "npm explore @woocommerce/e2e-env -- npm run docker:up",
|
||||
"docker:down": "npm explore @woocommerce/e2e-env -- npm run docker:down",
|
||||
"test:e2e": "npm explore @woocommerce/e2e-env -- npm run test:e2e",
|
||||
"test:e2e-dev": "npm explore @woocommerce/e2e-env -- npm run test:e2e-dev",
|
||||
"docker:up": "npm explore @woocommerce/e2e-environment -- npm run docker:up",
|
||||
"docker:down": "npm explore @woocommerce/e2e-environment -- npm run docker:down",
|
||||
"test:e2e": "npm explore @woocommerce/e2e-environment -- npm run test:e2e",
|
||||
"test:e2e-dev": "npm explore @woocommerce/e2e-environment -- npm run test:e2e-dev",
|
||||
"makepot": "composer run-script makepot",
|
||||
"packages:fix:textdomain": "node ./bin/package-update-textdomain.js",
|
||||
"git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && node ./node_modules/husky/husky.js install"
|
||||
|
@ -28,7 +28,7 @@
|
|||
"@babel/preset-env": "7.9.0",
|
||||
"@babel/register": "7.9.0",
|
||||
"@jest/test-sequencer": "^25.0.0",
|
||||
"@woocommerce/e2e-env": "file:tests/e2e/env",
|
||||
"@woocommerce/e2e-environment": "file:tests/e2e/env",
|
||||
"@wordpress/e2e-test-utils": "4.3.1",
|
||||
"autoprefixer": "9.7.5",
|
||||
"babel-eslint": "10.1.0",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const path = require( 'path' );
|
||||
const { jestConfig: baseE2Econfig } = require( '@woocommerce/e2e-env' );
|
||||
const { jestConfig: baseE2Econfig } = require( '@woocommerce/e2e-environment' );
|
||||
|
||||
module.exports = {
|
||||
...baseE2Econfig,
|
||||
|
|
|
@ -21,7 +21,7 @@ jobs:
|
|||
- bash bin/before-script-CI.sh
|
||||
- composer require wp-cli/i18n-command
|
||||
- npm run build
|
||||
- npm explore @woocommerce/e2e-env -- npm run docker:up
|
||||
- npm explore @woocommerce/e2e-env -- npm run test:e2e
|
||||
- npm explore @woocommerce/e2e-environment -- npm run docker:up
|
||||
- npm explore @woocommerce/e2e-environment -- npm run test:e2e
|
||||
after_script:
|
||||
- npm explore @woocommerce/e2e-env -- npm run docker:down
|
||||
- npm explore @woocommerce/e2e-environment -- npm run docker:down
|
||||
|
|
|
@ -5,20 +5,20 @@ A reusable and extendable E2E testing environment for WooCommerce extensions.
|
|||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @woocommerce/e2e-env --save
|
||||
npm install @woocommerce/e2e-environment --save
|
||||
npm install jest --global
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
The `@woocommerce/e2e-env` package exports configuration objects that can be consumed in JavaScript config files in your project. Additionally, it contains several files to serve as the base for a Docker container and Travis CI setup.
|
||||
The `@woocommerce/e2e-environment` package exports configuration objects that can be consumed in JavaScript config files in your project. Additionally, it contains several files to serve as the base for a Docker container and Travis CI setup.
|
||||
|
||||
### Babel Config
|
||||
|
||||
Extend your project's Babel config to contain the expected presets for E2E testing.
|
||||
|
||||
```js
|
||||
const { babelConfig: e2eBabelConfig } = require( '@woocommerce/e2e-env' );
|
||||
const { babelConfig: e2eBabelConfig } = require( '@woocommerce/e2e-environment' );
|
||||
|
||||
module.exports = function( api ) {
|
||||
api.cache( true );
|
||||
|
@ -39,7 +39,7 @@ module.exports = function( api ) {
|
|||
The E2E environment uses Puppeteer for headless browser testing, which uses certain globals variables. Avoid ES Lint errors by extending the config.
|
||||
|
||||
```js
|
||||
const { esLintConfig: baseConfig } = require( '@woocommerce/e2e-env' );
|
||||
const { esLintConfig: baseConfig } = require( '@woocommerce/e2e-environment' );
|
||||
|
||||
module.exports = {
|
||||
...baseConfig,
|
||||
|
@ -75,7 +75,7 @@ The E2E environment uses Jest as a test runner. Extending the base config is nee
|
|||
|
||||
```js
|
||||
const path = require( 'path' );
|
||||
const { jestConfig: baseE2Econfig } = require( '@woocommerce/e2e-env' );
|
||||
const { jestConfig: baseE2Econfig } = require( '@woocommerce/e2e-environment' );
|
||||
|
||||
module.exports = {
|
||||
...baseE2Econfig,
|
||||
|
@ -91,7 +91,7 @@ module.exports = {
|
|||
The E2E environment provides a `@woocommerce/e2e-tests` alias for easy use of the WooCommerce E2E test helpers.
|
||||
|
||||
```js
|
||||
const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-env' );
|
||||
const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-environment' );
|
||||
|
||||
module.exports = {
|
||||
....
|
||||
|
@ -147,7 +147,7 @@ The E2E environment includes a base `.travis.yml` file that sets up a WordPress
|
|||
version: ~> 1.0
|
||||
|
||||
import:
|
||||
- source: node_modules/@woocommerce/e2e-env/.travis.yml
|
||||
- source: node_modules/@woocommerce/e2e-environment/.travis.yml
|
||||
mode: deep_merge_prepend # Merge the package config first.
|
||||
|
||||
....
|
||||
|
@ -158,18 +158,18 @@ import:
|
|||
Start Docker
|
||||
|
||||
```bash
|
||||
npm explore @woocommerce/e2e-env -- npm run docker:up
|
||||
npm explore @woocommerce/e2e-environment -- npm run docker:up
|
||||
```
|
||||
|
||||
Run E2E Tests
|
||||
|
||||
```bash
|
||||
npm explore @woocommerce/e2e-env -- npm run test:e2e
|
||||
npm explore @woocommerce/e2e-env -- npm run test:e2e-dev
|
||||
npm explore @woocommerce/e2e-environment -- npm run test:e2e
|
||||
npm explore @woocommerce/e2e-environment -- npm run test:e2e-dev
|
||||
```
|
||||
|
||||
Stop Docker
|
||||
|
||||
```bash
|
||||
npm explore @woocommerce/e2e-env -- npm run docker:down
|
||||
npm explore @woocommerce/e2e-environment -- npm run docker:down
|
||||
```
|
|
@ -10,7 +10,7 @@ fi
|
|||
|
||||
if [[ ! -z "$WP_VERSION" ]] ; then
|
||||
composer install --no-dev
|
||||
npm explore @woocommerce/e2e-env -- npm run install-wp-tests -- wc_e2e_tests root ' ' localhost $WP_VERSION
|
||||
npm explore @woocommerce/e2e-environment -- npm run install-wp-tests -- wc_e2e_tests root ' ' localhost $WP_VERSION
|
||||
composer global require "phpunit/phpunit=4.8.*|5.7.*"
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "@woocommerce/e2e-env",
|
||||
"name": "@woocommerce/e2e-environment",
|
||||
"version": "1.0.0",
|
||||
"description": "WooCommerce End to End Testing Environment Configuration.",
|
||||
"author": "Automattic",
|
||||
|
@ -10,7 +10,7 @@
|
|||
"e2e",
|
||||
"puppeteer"
|
||||
],
|
||||
"homepage": "https://github.com/woocommerce/woocommerce/tree/master/tests/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.git"
|
||||
|
|
|
@ -5,7 +5,7 @@ const getAppRoot = () => {
|
|||
// Typically will be in node_modules/, but WooCommerce
|
||||
// uses a local file path (tests/e2e/env).
|
||||
let appPath = false;
|
||||
const moduleDir = path.dirname( require.resolve( '@woocommerce/e2e-env' ) );
|
||||
const moduleDir = path.dirname( require.resolve( '@woocommerce/e2e-environment' ) );
|
||||
|
||||
if ( -1 < moduleDir.indexOf( 'node_modules' ) ) {
|
||||
appPath = moduleDir.split( 'node_modules' )[ 0 ];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-env' );
|
||||
const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-environment' );
|
||||
|
||||
module.exports = {
|
||||
resolve: {
|
||||
|
|
Loading…
Reference in New Issue