Skip to content

Commit 857572c

Browse files
chore: add e2e tests info to README.md
1 parent f643f5a commit 857572c

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

README.md

+31-10
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,50 @@
22

33
Local viewer for YDB clusters
44

5-
## How to work with this repo
5+
## Development
66

7-
### Development
8-
9-
1) Run on a machine with Docker installed:
7+
1. Run on a machine with Docker installed:
108
```
119
docker pull cr.yandex/yc/yandex-docker-local-ydb
1210
docker run --hostname localhost -e YDB_ALLOW_ORIGIN="http://localhost:3000" -dp 2135:2135 -dp 8765:8765 cr.yandex/yc/yandex-docker-local-ydb
1311
```
14-
2) Run the frontend app in the development mode, via invoking `npm run dev`
15-
3) Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\
12+
2. Run the frontend app in the development mode, via invoking `npm run dev`
13+
3. Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\
1614
You will also see any lint errors in the console.
1715

1816
For API reference, open Swagger UI on http://localhost:8765/viewer/api/.
1917

20-
### Making a production bundle.
18+
## E2E Tests
19+
20+
For e2e tests we use `@playwright/tests`. Tests configuration is in `playwright.config.ts`. Tests are set up in `tests` dir.
21+
22+
### Commands
23+
24+
Install all Playwright dependencies and chromium to run tests.
25+
26+
```
27+
npm run test:e2e:install
28+
```
29+
30+
Run tests. If `PLAYWRIGHT_BASE_URL` is provided, tests run on this url, otherwise Playwright `webServer` is started with `npm run dev` on `http://localhost:3000` and all tests run there.
31+
32+
```
33+
npm run test:e2e
34+
```
35+
36+
### CI
37+
38+
E2E tests are run in CI in `e2e_tests` job. Tests run on Playwright `webServer` (it is started with `npm run dev`), `webServer` uses docker container `cr.yandex/yc/yandex-docker-local-ydb` as backend.
39+
40+
## Making a production bundle.
2141

2242
Base command `npm run build` builds the app for production to the `build` folder.\
2343
It correctly bundles React in production mode and optimizes the build for the best performance.
2444

2545
The build is minified and the filenames include the hashes.
2646

2747
To test production bundle with latest YDB backend release, do the following:
28-
1) Build a production bundle with a few tweaks for embedded version: `npm run build:embedded`.
29-
2) Invoke `docker run -it --hostname localhost -dp 2135:2135 -p 8765:8765 -v ~/projects/ydb-embedded-ui/build:/ydb_data/node_1/contentmonitoring cr.yandex/yc/yandex-docker-local-ydb:latest`
30-
3) Open [embedded YDB UI](http://localhost:8765/monitoring) to view it in the browser.
48+
49+
1. Build a production bundle with a few tweaks for embedded version: `npm run build:embedded`.
50+
2. Invoke `docker run -it --hostname localhost -dp 2135:2135 -p 8765:8765 -v ~/projects/ydb-embedded-ui/build:/ydb_data/node_1/contentmonitoring cr.yandex/yc/yandex-docker-local-ydb:latest`
51+
3. Open [embedded YDB UI](http://localhost:8765/monitoring) to view it in the browser.

0 commit comments

Comments
 (0)