Skip to content

Commit dc0345c

Browse files
Migrate to Playwright (#176)
1 parent b1567a8 commit dc0345c

11 files changed

+142
-891
lines changed

.github/workflows/continuous-integration-workflow.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ jobs:
7474

7575
steps:
7676
- name: Checkout
77-
uses: actions/checkout@v2
77+
uses: actions/checkout@v4
78+
79+
- name: Setup Node.js
80+
uses: actions/setup-node@v4
81+
with:
82+
node-version: lts/*
7883

7984
- name: Build
8085
run: ./build.sh

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ Copy `example/.dockerignore` to your project’s root and edit it appropriately
3636

3737
### Step 4: Build and run
3838

39-
Copy `example/docker-compose.yml` to your project’s root. Then, from the root of your project, run:
39+
Copy `example/compose.yml` to your project’s root. Then, from the root of your project, run:
4040

4141
```bash
42-
docker-compose up
42+
docker compose up
4343
```
4444

4545
This builds an image for your app and starts it, along with a linked container for MongoDB. Go to [http://localhost/](http://localhost/) to see your app running.

example/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
test-app/
2-
test.docker-compose.yml
2+
test.compose.yml
33
test.dockerfile

example/docker-compose.yml example/compose.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3'
2-
31
services:
42
app:
53
build:

test.sh

+11-11
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ for version in "${meteor_versions[@]}"; do
2828
SECONDS=0
2929

3030
rm -f test.dockerfile
31-
rm -f test.docker-compose.yml
31+
rm -f test.compose.yml
3232
rm -rf test-app
3333

3434
dockerfile='default.dockerfile'
@@ -50,16 +50,16 @@ for version in "${meteor_versions[@]}"; do
5050

5151
do_sed "s|/app|/test-app|g" test.dockerfile
5252

53-
cp docker-compose.yml test.docker-compose.yml
54-
do_sed 's|dockerfile: Dockerfile|dockerfile: test.dockerfile|' test.docker-compose.yml
53+
cp compose.yml test.compose.yml
54+
do_sed 's|dockerfile: Dockerfile|dockerfile: test.dockerfile|' test.compose.yml
5555

5656
echo 'Building test app Docker image...'
57-
run_with_suppressed_output 'docker compose --file test.docker-compose.yml build'
57+
run_with_suppressed_output 'docker compose --file test.compose.yml build'
5858

5959
echo 'Launching test app...'
60-
run_with_suppressed_output 'docker compose --file test.docker-compose.yml up --detach'
60+
run_with_suppressed_output 'docker compose --file test.compose.yml up --detach'
6161

62-
# Poll until docker-compose network ready, timing out after 20 seconds
62+
# Poll until docker compose network ready, timing out after 20 seconds
6363
for i in {1..20}; do
6464
(curl --silent --fail http://localhost/ | grep __meteor_runtime_config__) > /dev/null 2>&1 && break || {
6565
if [ "$i" -lt 21 ]; then
@@ -71,12 +71,11 @@ for version in "${meteor_versions[@]}"; do
7171
done
7272

7373
echo 'Running test...'
74+
cd ../test
7475
if [ ! -d ../test/node_modules ]; then
75-
cd ../test
7676
run_with_suppressed_output 'npm ci'
77-
cd ../example
7877
fi
79-
run_with_suppressed_output 'node ../test/test.js' || true # Don’t exit if tests fail
78+
run_with_suppressed_output 'node --run test' || true # Don’t exit if tests fail
8079
elapsed="$((($SECONDS / 60) % 60)) min $(($SECONDS % 60)) sec"
8180
if [ $exit_code -ne 0 ]; then
8281
# For 14.21.4 <= $node_version < 18.0.0, we need to use the Meteor fork of the Node Docker image; else, we use the regular official Node Docker image
@@ -96,11 +95,12 @@ for version in "${meteor_versions[@]}"; do
9695
fi
9796

9897
if [ "${SKIP_CLEANUP:-}" != 1 ]; then
99-
run_with_suppressed_output 'docker compose --file test.docker-compose.yml down'
98+
cd ../example
99+
run_with_suppressed_output 'docker compose --file test.compose.yml down'
100100
run_with_suppressed_output 'docker rmi example-app:latest'
101101

102102
rm -f test.dockerfile
103-
rm -f test.docker-compose.yml
103+
rm -f test.compose.yml
104104
rm -rf test-app
105105
fi
106106
done

test/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
node_modules/
22
screenshot.png
3+
4+
# Playwright
5+
/test-results/
6+
/playwright-report/
7+
/blob-report/
8+
/playwright/.cache/

0 commit comments

Comments
 (0)