Skip to content

Commit

Permalink
Add a locator to table row
Browse files Browse the repository at this point in the history
  • Loading branch information
RandilaP committed Jun 23, 2023
1 parent d1d9269 commit a12cdc6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 18

- name: Install dependencies
run: yarn install --immutable
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 18

- name: Install dependencies
run: yarn install --immutable
Expand Down
1 change: 1 addition & 0 deletions e2e/pages/PatientAllergiesPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Page } from '@playwright/test';
export class PatientAllergiesPage {
constructor(readonly page: Page) {}

readonly tableRow = () => this.page.locator('tr');
async goto(uuid: string) {
await this.page.goto('/openmrs/spa/patient/' + uuid + '/chart/Allergies');
}
Expand Down
8 changes: 4 additions & 4 deletions e2e/specs/record-drug-allergies.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ test('Add drug allergy to patient', async ({ page, api }) => {
});

await test.step('And I see the data of the allergy that I saved', async () => {
await expect(allergiesPage.page.getByText('ACE inhibitors')).toBeVisible();
await expect(allergiesPage.page.getByText('Mental status change')).toBeVisible();
await expect(allergiesPage.page.getByText('LOW')).toBeVisible();
await expect(allergiesPage.page.getByText('Test comment')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('ACE inhibitors')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('Mental status change')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('LOW')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('Test comment')).toBeVisible();
});
});

Expand Down
8 changes: 4 additions & 4 deletions e2e/specs/record-environmental-allergy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ test('Add environmental allergy to patient', async ({ page, api }) => {
});

await test.step('And I see the data of the allergy that I saved', async () => {
await expect(allergiesPage.page.getByText('Dust')).toBeVisible();
await expect(allergiesPage.page.getByText('Mental status change')).toBeVisible();
await expect(allergiesPage.page.getByText('LOW')).toBeVisible();
await expect(allergiesPage.page.getByText('Test comment')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('Dust')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('Mental status change')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('LOW')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('Test comment')).toBeVisible();
});
});

Expand Down
8 changes: 4 additions & 4 deletions e2e/specs/record-food-allergy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ test('Add Food allergy to patient', async ({ page, api }) => {
});

await test.step('And I see the data of the allergy that I saved', async () => {
await expect(allergiesPage.page.getByText('Eggs')).toBeVisible();
await expect(allergiesPage.page.getByText('Mental status change')).toBeVisible();
await expect(allergiesPage.page.getByText('LOW')).toBeVisible();
await expect(allergiesPage.page.getByText('Test comment')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('Eggs')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('Mental status change')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('LOW')).toBeVisible();
await expect(allergiesPage.tableRow().getByText('Test comment')).toBeVisible();
});
});

Expand Down

0 comments on commit a12cdc6

Please sign in to comment.