Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaud committed Aug 21, 2024
1 parent 503dff4 commit 1027034
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
24 changes: 6 additions & 18 deletions e2e/tests/diagnosis.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,25 @@ test('Create, revise and discontinue diagnosis.', async ({ page }) => {
await page.getByText('Candidiasis (B37.9)').click();
await page.locator('#order-0').getByRole('button', { name: /primary/i }).click();
await page.locator('#certainty-0').getByRole('button', { name: /confirmed/i }).click();

await page.locator('#name-1').fill('Diphtheria (A36.9)');
await page.getByText('Diphtheria (A36.9)').click();
await page.locator('#order-1').getByRole('button', { name: /secondary/i }).click();
await page.locator('#certainty-1').getByRole('button', { name: /presumed/i }).click();
await bahmni.saveOrder();

// verify creation
await page.locator('#dashboard-link span.patient-name').click();
const primaryDiagnosisSelector = await page.locator('#diagnosisName').nth(0);
const secondaryDiagnosisSelector = await page.locator('#diagnosisName').nth(1);
const primaryDiagnosisCertaintySelector = await page.locator('#certainty').nth(0);
const seconadryDiagnosisCertaintySelector = await page.locator('#certainty').nth(1);
const diagnosisSelector = await page.locator('#diagnosisName');
const diagnosisCertaintySelector = await page.locator('#certainty');

await expect(primaryDiagnosisSelector).toContainText('Candidiasis');
await expect(secondaryDiagnosisSelector).toContainText('Diphtheria');
await expect(primaryDiagnosisCertaintySelector).toContainText(/confirmed/i);
await expect(seconadryDiagnosisCertaintySelector).toContainText(/presumed/i);
await expect(diagnosisSelector).toContainText('Candidiasis');
await expect(diagnosisCertaintySelector).toContainText(/confirmed/i);

// verify revision
await page.locator('#view-content :nth-child(1).btn--success').click();
await page.locator('#opd-tabs').getByText('Diagnosis').click();
await page.locator('i.fa.fa-edit').first().click();
await page.getByRole('button', { name: /presumed/i }).nth(1).click();
await bahmni.saveOrder();
await page.locator('i.fa.fa-edit').nth(1).click();
await page.getByRole('button', { name: /confirmed/i }).nth(1).click();
await bahmni.saveOrder();
await page.locator('#dashboard-link span.patient-name').click();
await expect(primaryDiagnosisCertaintySelector).toContainText(/presumed/i);
await expect(seconadryDiagnosisCertaintySelector).toContainText(/confirmed/i);
await expect(diagnosisSelector).toContainText('Candidiasis');
await expect(diagnosisCertaintySelector).toContainText(/presumed/i);

// verify revision
});
Expand Down
6 changes: 4 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ const config: PlaywrightTestConfig = {
use: {
...devices['Desktop Chromium'],
launchOptions: {
slowMo: 500
}
slowMo: 500,
},
screenshot: 'only-on-failure',
video: 'retain-on-failure'
},

},
Expand Down

0 comments on commit 1027034

Please sign in to comment.