Skip to content

Commit

Permalink
Update the Jetpack Boost documentation related to JavaScript e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlonjon committed Aug 27, 2021
1 parent 892c7a1 commit 6621dd5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
5 changes: 2 additions & 3 deletions projects/plugins/boost/docs/DEVELOPEMENT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ Or you might also choose to run them inside Docker if you are using it as your d
jetpack docker exec -- sh -c "composer -d wp-content/plugins/boost test-php"
```

## JavaScript unit tests and e2e tests

For the time being there are no usable JavaScript tests and there is a [Github issue](https://github.com/Automattic/jetpack/issues/20615) opened to resolve this.
## JavaScript e2e tests

Please refer to the Jetpack Boost e2e tests specific [documentation](../tests/e2e/README.md).

## Linting Jetpack Boost PHP code

Expand Down
34 changes: 34 additions & 0 deletions projects/plugins/boost/tests/e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Jetpack Boost End-to-End tests

Automated end-to-end acceptance tests for the Jetpack Boost plugin.

**IMPORTANT** As there is not yet one single infrastructure and core package across plugins on the Jetpack Monorepo, the Jetpack Boost e2e framework and setup relies heavily on the Jetpack plugin e2e package and setup. So please familiarise yourself with the Jeptack e2e [documentation](../../../jetpack/tests/e2e/README.md).

## Boost specific information

- [Pre-requisites](#pre-requisites)
- [Getting started](#getting-started)

## Pre-requisites

* This readme assumes that `node`, `pnpm` and `docker` are already installed on your machine.
* Make sure you built Jetpack Boost first. `pnpm install && pnpx jetpack build plugin/boost` in the monorepo root directory should walk you through it. You can also refer to the Jetpack Boost [documentation](../../docs/DEVELOPEMENT_GUIDE.md) in how to build Jetpack Boost.
* Run ``pnpm install` from the Jetpack Boost 2e2 tests directory.

Jetpack Boost E2E tests relies on encrypted configuration file, which is included in the Jetpack plugin e2e tests config folder repo as [`encrypted.enc`](../../../jetpack/tests/e2e/config/encrypted.enc). To be able to run tests - that file should be decrypted first.

To decrypt the config file (a8c only):

- Find a decryption key. Search secret store for "E2E Jetpack CONFIG_KEY"
- From the Jetpack Boost 2e2 tests directory, run `CONFIG_KEY=YOUR_KEY pnpm test-decrypt-config`. This command should create a new file [`local-test.js`](./config/local-test.js)

## Getting Started

Typically, the workflow is the same as the one desribed in the Jeptack e2e [documentation](../../../jetpack/tests/e2e/README.md). You can follow the same workflow but running the commands inside the Jetpack Boosts e2e tests folder.

However, Boost has some shortcuts to get the environment started and run all the tests by running the following commands from the root of the Jetpack Boost repository:

- `pnpm test-e2e:start` - This will command will start the e2e testing environment and the tunnel.
- `pnpm test-e2e:run` - This command will run the e2e tests.
- `pnpm test-e2e:stop` - This command stop the e2e testing environment.

0 comments on commit 6621dd5

Please sign in to comment.