Skip to content

Commit d076242

Browse files
smoke test
1 parent 29a2337 commit d076242

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/smoke-test.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Smoke test (UI)
2+
3+
on:
4+
# Triggers the workflow on push to any branch
5+
push:
6+
schedule:
7+
- cron: "0 * * * *"
8+
workflow_dispatch: {}
9+
10+
jobs:
11+
smoke:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 15
14+
15+
steps:
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 24
19+
cache: npm
20+
21+
- name: Install Playwright
22+
run: |
23+
npm install --no-save playwright
24+
npx playwright install --with-deps chromium
25+
26+
- name: Run smoke check
27+
env:
28+
APP_URL: https://flamingtempura.github.io/bibtex-tidy/
29+
EXPECTED: |
30+
Click Tidy to clean up the entries below
31+
@book{sweig42,
32+
title = {The impossible book},
33+
author = {Stefa{n} Sweig},
34+
year = 1942,
35+
month = mar,
36+
publisher = {Dead Poet Society}
37+
}
38+
@article{steward03,
39+
title = {Cooking behind bars},
40+
author = {Martha Steward},
41+
year = 2003,
42+
publisher = {Culinary Expert Series}
43+
}
44+
@book{impossible,
45+
title = {The impossible book},
46+
author = {Stefan Sweig},
47+
year = 1942,
48+
month = mar,
49+
publisher = {Dead Poet Society}
50+
}
51+
run: |
52+
node - <<'NODE'
53+
import { strict as assert } from 'node:assert';
54+
import { chromium } from 'playwright';
55+
56+
const browser = await chromium.launch();
57+
const page = await browser.newPage();
58+
await page.goto(process.env.APP_URL, { waitUntil: 'networkidle' });
59+
60+
const textbox = page.getByRole('textbox', { name: 'BibTeX' });
61+
await page.getByRole('button', { name: 'Tidy' }).click();
62+
63+
const output = await textbox.inputValue();
64+
assert.equal(output, process.env.EXPECTED);
65+
66+
await browser.close();
67+
NODE

0 commit comments

Comments
 (0)