Skip to content

Commit 76ab4c0

Browse files
wip customizer spec
1 parent 9aa62f6 commit 76ab4c0

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

tests/Customizer.spec.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { test, expect, describe, beforeEach } from '@playwright/test';
2+
3+
describe('Synthea Customizer', async function({ page }) {
4+
5+
beforeEach(async function({ page }) {
6+
page.goto('http://127.0.0.1:3000/spt');
7+
});
8+
9+
test('page has title', async function({ page }) {
10+
await expect(page.locator('h1')).toContainText('Synthea Customizer');
11+
});
12+
13+
describe('guided mode', async function({ page }) {
14+
15+
beforeEach(async function({ page }) {
16+
await page.getByRole('button', { name: 'Use Guided Mode' }).click();
17+
});
18+
19+
/** TODO
20+
- for guided mode tests, assert visibility before and after the "I need" toggle buttons
21+
- for advance mode tests assert data entry
22+
- at the end assert clip board copy and file download
23+
*/
24+
25+
const EXPORT_FORMATS = {
26+
'HL7® FHIR® R4': /.*/,
27+
'FHIR® Bulk Data': /exporter\.fhir\.export\s*=\s*true/,
28+
'C-CDA': /exporter\.fhir\.export\s*=\s*true/,
29+
'CSV': /exporter\.csv\.export\s*=\s*true/,
30+
'JSON': /exporter\.csv\.export\s*=\s*true/,
31+
/* TODO: extended formats */
32+
};
33+
34+
Object.entries(EXPORT_FORMATS).forEach(([format, argument]) => {
35+
test(`${format} export toggle appends the proper command`, async function({ page }) {
36+
await page.getByRole('button', { name: format }).click();
37+
await page.getByRole('button', { name: 'None' }).click();
38+
await page.getByRole('button', { name: 'Basic Setup' }).click();
39+
40+
const command = page.getByRole('code').filter({ hasText: 'java -jar synthea-with-dependencies.jar' });
41+
await expect(command).toContainText(argument);
42+
});
43+
});
44+
45+
const ARG_TOGGLES = {
46+
'patients that meet': '',
47+
'geographic': '',
48+
'population with': '',
49+
're-create': ''
50+
};
51+
52+
}); // close describe guided mode
53+
54+
});

0 commit comments

Comments
 (0)