Skip to content

Commit

Permalink
Improved the form creation e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rOluochKe committed Nov 20, 2023
1 parent 14b7f32 commit 2fc4dd8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions e2e/specs/create-form-using-custom-schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ test('Create a form using a custom JSON schema', async ({ page }) => {

await test.step('Then I click the `Save Form` button', async () => {
await formBuilderPage.saveForm();

// Add assertions to check whether the form details are saved
await formBuilderPage.formNameInput().fill('A sample test form');
await formBuilderPage.formVersionInput().fill('1.0');
await formBuilderPage.formDescriptionInput().fill('This is a test form');
await formBuilderPage.formEncounterType().selectOption('Admission');
});

await test.step('And I should get a success message and be redirected to the edit page for the new form', async () => {
Expand Down
6 changes: 6 additions & 0 deletions e2e/specs/create-form-using-dummy-schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ test('Create a form using the `Input Dummy Schema` feature', async ({ page }) =>

await test.step('Then I click the `Save Form` button', async () => {
await formBuilderPage.saveForm();

// Add assertions to check whether the form details are saved
await formBuilderPage.formNameInput().fill('A sample test form');
await formBuilderPage.formVersionInput().fill('1.0');
await formBuilderPage.formDescriptionInput().fill('This is a test form');
await formBuilderPage.formEncounterType().selectOption('Admission');
});

await test.step('Then should get a success message and be redirected to the edit page for the new form', async () => {
Expand Down

0 comments on commit 2fc4dd8

Please sign in to comment.