Skip to content

Commit 52d3977

Browse files
authored
Mainpage e2e test (#820)
* add more test objects to mainpage e2e test * fix: correct featured wiki id * update: update @vue/cli-plugin-e2e-webdriverio * update: update browser list * test: add more test specs * fix: add App.open() to check for different elements * make app opened before a test * correct url link * fix: shorten url test * moved rendering test to a same class * feat: Run e2e test in a container * fix: add wait time for App to open * fix: add waiting time for buttons to be rendered * fix: make App opened before each test correctly * feat: Set default browser size * fix: remove container post-install * fix: remove redundant exit tag * fix: moved selector to page objects class * fix: use data-test-id instead of id for element selector * fix: add longer timeout * make browser test run on ubuntu 24.04 instead of latest * fix: add back id
1 parent 3529716 commit 52d3977

File tree

14 files changed

+243
-122
lines changed

14 files changed

+243
-122
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Browser tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
browser-tests:
10+
runs-on: ubuntu-24.04
11+
timeout-minutes: 10
12+
steps:
13+
- uses: actions/checkout@v4.1.6
14+
- run: cp .env.development.prod .env
15+
- run: sudo chown -R 1000:1000 ${GITHUB_WORKSPACE}
16+
- run: docker compose run --rm ui npm install
17+
- run: docker compose --profile browser-tests up -d --wait
18+
- run: docker compose exec -it ui npm run test:e2e

.github/workflows/node.js.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ jobs:
2828
- run: npm run build --if-present
2929
- run: npm run lint -- --no-fix
3030
- run: npm run test:unit
31-
- run: npm run test:e2e

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,14 @@ Backend api mocks live in `/src/backend/mocks/default_handlers.js`.
7171
**Note**
7272
Firefox blocks service workers as long as we use `localhost` for local development. The only solution is to use
7373
chrom(ium) for now.
74+
75+
76+
### Running browser tests
77+
78+
```sh
79+
rm -r node_modules
80+
docker compose run ui npm install
81+
docker compose --profile browser-tests up -d
82+
docker compose exec -it ui npm run test:e2e
83+
docker compose --profile browser-tests down
84+
```

docker-compose.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ services:
88
working_dir: /home/node/app
99
volumes:
1010
- ./:/home/node/app
11-
command: npm run serve -- --port 8081
11+
command: npm run serve -- --port 8081 --host ui
1212
ports:
1313
- 8081:8081
14+
healthcheck:
15+
test: curl --fail http://ui:8081
16+
interval: 5s
17+
start_period: 0s
18+
19+
selenium-firefox:
20+
profiles: [ browser-tests ]
21+
image: selenium/standalone-firefox:4.21.0
22+
shm_size: 2gb
23+
ports:
24+
- 4444:4444
25+
- 7900:7900
26+
healthcheck:
27+
test: curl --fail http://selenium-firefox:4444
28+
interval: 5s
29+
start_period: 0s

0 commit comments

Comments
 (0)