Skip to content

Commit

Permalink
(test): refactor the e2e test with test.step()
Browse files Browse the repository at this point in the history
  • Loading branch information
senthil-athiban committed Aug 3, 2024
1 parent 22bf5af commit 800e66d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions e2e/specs/create-conditional-logic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ test('create a calculation logic', async ({ page }) => {
await test.step('And I see enter value for `Height` and `Weight` field, then `BSA` calculated automiatically', async () => {
await formBuilderPage.page.getByLabel(/Height/i).fill('40');
await formBuilderPage.page.getByLabel(/Weight/i).fill('40');
await formBuilderPage.page.getByLabel('Preview', { exact: true }).getByText(/BSA/i).click();
await expect(formBuilderPage.page.getByLabel(/BSA/i)).toHaveValue('0.67');
await formBuilderPage.page.getByLabel('Preview', { exact: true }).getByText('BSA').click();
await expect(formBuilderPage.page.getByLabel('BSA')).toHaveValue('0.67');
});
});

Expand Down Expand Up @@ -320,8 +320,9 @@ test('create calculation logic for `Expected delivery date`', async ({ page }) =
});

await test.step('When I select a date in `LMP` field, Then I see the `EDD` has been calculated', async () => {
await formBuilderPage.page.getByRole('button', { name: /Calendar Last Mensuration/i }).click();
await formBuilderPage.page.getByLabel('Thursday, August 1,').click();
await formBuilderPage.page.getByRole('spinbutton', { name: 'month, Last Mensuration' }).fill('08');
await formBuilderPage.page.getByRole('spinbutton', { name: 'day, Last Mensuration' }).fill('01');
await formBuilderPage.page.getByRole('spinbutton', { name: 'year, Last Mensuration' }).fill('2024');
await expect(formBuilderPage.page.getByText('5/8/2025')).toBeVisible();
});
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/support/validation-custom-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
{
"label": "Last Mensuration Period",
"type": "obs",
"required": true,
"required": false,
"id": "LMP",
"questionOptions": {
"rendering": "date",
Expand Down

0 comments on commit 800e66d

Please sign in to comment.