Compare commits
4 Commits
main
...
sebbie/tes
| Author | SHA1 | Date |
|---|---|---|
|
|
397e5ef1b6 | |
|
|
3638769e49 | |
|
|
b3db2b0695 | |
|
|
92e668940a |
|
|
@ -49,9 +49,9 @@ commands:
|
|||
- run:
|
||||
name: Install dependencies
|
||||
command: |
|
||||
yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
|
||||
yarn install --verbose --frozen-lockfile --cache-folder ~/.cache/yarn
|
||||
if [ $? -ne 0 ]; then
|
||||
yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
|
||||
yarn install --verbose --frozen-lockfile --cache-folder ~/.cache/yarn
|
||||
fi
|
||||
- save_cache:
|
||||
name: Save yarn cache
|
||||
|
|
@ -215,18 +215,15 @@ jobs:
|
|||
path: ./build/devtools.tgz
|
||||
|
||||
run_devtools_e2e_tests:
|
||||
docker: *docker
|
||||
docker:
|
||||
# Make sure used Dockerfiles in this repository reference the same version
|
||||
- image: mcr.microsoft.com/playwright:v1.16.0-focal
|
||||
environment: *environment
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- setup_node_modules
|
||||
- run:
|
||||
name: Playwright install deps
|
||||
command: |
|
||||
npx playwright install
|
||||
sudo npx playwright install-deps
|
||||
- run:
|
||||
environment:
|
||||
RELEASE_CHANNEL: experimental
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
node_modules/
|
||||
build/
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
FROM mcr.microsoft.com/playwright:v1.16.0-focal
|
||||
RUN mkdir -p /tmp/react
|
||||
COPY . /tmp/react
|
||||
WORKDIR /tmp/react
|
||||
RUN yarn
|
||||
WORKDIR /tmp/react/packages/react-devtools-inline
|
||||
|
|
@ -363,3 +363,38 @@ yarn start
|
|||
```
|
||||
|
||||
To test package changes, refer to the [`react-devtools-shell` README](https://github.com/facebook/react/blob/main/packages/react-devtools-shell/README.md).
|
||||
|
||||
## Running e2e tests
|
||||
|
||||
### Prerequisites
|
||||
|
||||
1. Chrome installed locally (run `npx playwright install chrome --with-deps`)
|
||||
1. Running build (`yarn start`)
|
||||
|
||||
### Running
|
||||
|
||||
|
||||
```sh
|
||||
`yarn test:e2e`
|
||||
```
|
||||
|
||||
This will use your local installation of Chrome.
|
||||
To use the same version as CI, you need to [have Docker installed](https://docs.docker.com/get-docker/).
|
||||
|
||||
```sh
|
||||
$ docker compose -f packages/react-devtools-inline/docker-compose.yml up --detach
|
||||
$ docker exec react-devtools-e2e-test-runner yarn test:e2e
|
||||
```
|
||||
|
||||
WARNING: If you change the test code after you created the Docker container, you need to either copy the tests to the running container (fast but dangerous):
|
||||
|
||||
```sh
|
||||
# assuming you're in the repository root
|
||||
$ docker cp packages/react-devtools-inline/__tests__ react-devtools-e2e-test-runner:/tmp/react/packages/react-devtools-inline/
|
||||
```
|
||||
|
||||
or rebuild the container entirely (slow but safe):
|
||||
|
||||
```sh
|
||||
docker compose -f packages/react-devtools-inline/docker-compose.yml up --build --detach
|
||||
```
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
version: '3.3'
|
||||
services:
|
||||
test-runner:
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: ./packages/react-devtools-inline/Dockerfile
|
||||
container_name: "react-devtools-e2e-test-runner"
|
||||
network_mode: "host"
|
||||
tty: true
|
||||
Loading…
Reference in New Issue