Skip to content

Commit 800e66d

Browse files
(test): refactor the e2e test with test.step()
1 parent 22bf5af commit 800e66d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

e2e/specs/create-conditional-logic.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ test('create a calculation logic', async ({ page }) => {
267267
await test.step('And I see enter value for `Height` and `Weight` field, then `BSA` calculated automiatically', async () => {
268268
await formBuilderPage.page.getByLabel(/Height/i).fill('40');
269269
await formBuilderPage.page.getByLabel(/Weight/i).fill('40');
270-
await formBuilderPage.page.getByLabel('Preview', { exact: true }).getByText(/BSA/i).click();
271-
await expect(formBuilderPage.page.getByLabel(/BSA/i)).toHaveValue('0.67');
270+
await formBuilderPage.page.getByLabel('Preview', { exact: true }).getByText('BSA').click();
271+
await expect(formBuilderPage.page.getByLabel('BSA')).toHaveValue('0.67');
272272
});
273273
});
274274

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

322322
await test.step('When I select a date in `LMP` field, Then I see the `EDD` has been calculated', async () => {
323-
await formBuilderPage.page.getByRole('button', { name: /Calendar Last Mensuration/i }).click();
324-
await formBuilderPage.page.getByLabel('Thursday, August 1,').click();
323+
await formBuilderPage.page.getByRole('spinbutton', { name: 'month, Last Mensuration' }).fill('08');
324+
await formBuilderPage.page.getByRole('spinbutton', { name: 'day, Last Mensuration' }).fill('01');
325+
await formBuilderPage.page.getByRole('spinbutton', { name: 'year, Last Mensuration' }).fill('2024');
325326
await expect(formBuilderPage.page.getByText('5/8/2025')).toBeVisible();
326327
});
327328
});

e2e/support/validation-custom-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
{
223223
"label": "Last Mensuration Period",
224224
"type": "obs",
225-
"required": true,
225+
"required": false,
226226
"id": "LMP",
227227
"questionOptions": {
228228
"rendering": "date",

0 commit comments

Comments
 (0)