Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(test) O3-3766: Fill a form with a browser slightly ahead of time. #1958

Merged
merged 4 commits into from
Aug 20, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions e2e/specs/clinical-forms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,57 @@ test('Fill a clinical form', async ({ page }) => {
});
});

test('Fill a form with a browser slightly ahead of time', async ({ page }) => {
const chartPage = new ChartPage(page);
const visitsPage = new VisitsPage(page);
await page.clock.fastForward('01:00'); // Advances the time by 1 minute in the testing environment.

await test.step('When I visit the chart summary page', async () => {
await chartPage.goTo(patient.uuid);
});

await test.step('And I click the `Clinical forms` button on the siderail', async () => {
await page.getByLabel(/clinical forms/i, { exact: true }).click();
});

await test.step('Then I should see `Laboratory Test Results` listed in the clinical forms workspace', async () => {
await expect(page.getByRole('cell', { name: /laboratory test results/i, exact: true })).toBeVisible();
});

await test.step('When I click the `Laboratory Test Results` link to launch the form', async () => {
await page.getByText(/laboratory test results/i).click();
});

await test.step('Then I should see the `Laboratory Test Results` form launch in the workspace', async () => {
await expect(page.getByText(/laboratory test results/i)).toBeVisible();
});

await test.step('And when I fill the `White Blood Cells (WBC)` result as `5000', async () => {
jayasanka-sack marked this conversation as resolved.
Show resolved Hide resolved
await page.locator('#ManualInputWhiteBloodCells').fill('5500');
});

await test.step('And I fill the `Neutrophils` result as `35`', async () => {
await page.locator('#ManualEntryNeutrophilsMicroscopic').fill('35');
});

await test.step('And I fill the `Hematocrit` result as `18`', async () => {
await page.locator('#ManualEntryHematocrit').fill('18');
});

await test.step('And I click on the `Save` button', async () => {
await page.getByRole('button', { name: /save/i }).click();
});

await test.step('Then I should see a success notification', async () => {
await expect(page.getByText(/record created/i)).toBeVisible();
await expect(page.getByText(/a new encounter was created/i)).toBeVisible();
});

await test.step('And I should not see any error messages', async () => {
await expect(page.getByText('error')).not.toBeVisible();
});
});

test('Form state is retained when moving between forms in the workspace', async ({ page }) => {
const chartPage = new ChartPage(page);

Expand Down
Loading