Skip to content

Commit

Permalink
change component name to e2e-environment
Browse files Browse the repository at this point in the history
  • Loading branch information
rrennick committed Apr 30, 2020
1 parent 105cea2 commit 0de3718
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @format */
const baseConfig = require( '@woocommerce/e2e-env' ).esLintConfig;
const baseConfig = require( '@woocommerce/e2e-environment' ).esLintConfig;

module.exports = {
...baseConfig,
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
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.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/env/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 12 additions & 12 deletions tests/e2e/env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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 = {
....
Expand Down Expand Up @@ -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.
....
Expand All @@ -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
```
2 changes: 1 addition & 1 deletion tests/e2e/env/bin/before-script-CI.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/env/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/env/utils/app-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-env' );
const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-environment' );

module.exports = {
resolve: {
Expand Down

0 comments on commit 0de3718

Please sign in to comment.