-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(test) O3-3953: Update the e2e test coverage #382
base: main
Are you sure you want to change the base?
(test) O3-3953: Update the e2e test coverage #382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @harshthakkr! Sorry about the late review. This is really great work and much needed, too! Left a few minor suggestions, but other than that all good!
@@ -224,6 +224,123 @@ test('Create a form using the interactive builder', async ({ page, context }) => | |||
const editFormPageURL = page.url(); | |||
formUuid = editFormPageURL.split('/').slice(-1)[0]; | |||
}); | |||
|
|||
await test.step('Then I click the `Edit` button on the form name I need to edit', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll be better if we break this into a separate spec on its own like edit-form-with-interactive-builder
(that starts similar to how you delete a form, as in edits an existing form) so that it can in parallel, and rename this current file into something like create-form-with-interactive-builder.spec
|
||
await test.step('And then I fill in the updated form name', async () => { | ||
await formBuilderPage.editFormNameInput().click(); | ||
await formBuilderPage.editFormNameInput().fill('An edited form'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After each update step (either updating/deleting form name, section or question) we should check whether the JSON schema got updated too.
// }, | ||
// ], | ||
// }); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have commented out this portion for now only. The reason is that JSON schema I get is missing some key-value pairs and that's why I get this error:
SyntaxError: Expected double-quoted property name in JSON at position 935 (line 1 column 936)
The JSON schema I get is:
{ "encounterType": "e22e39fd-7db2-45e7-80f1-60fa0d5a4378", "name": "An edited form", "pages": [ { "label": "An edited page", "sections": [ { "label": "An edited section", "isExpanded": "true", "questions": [ { "label": "An edited question label", "type": "obs", "required": false, "id": "sampleQuestion", "questionOptions": { "rendering": "text", "concept": "a-system-defined-concept-uuid" } }, { "label": "An edited question label", "type": "obs", "required": false, "id": "sampleQuestionDuplicate", "questionOptions": { "rendering": "text", "concept": "a-system-defined-concept-uuid" } } ] } ] } ],
It is missing content at the end. Strangely, this issue occurs only for the duplicate action. I’m unsure why this happens.
@@ -61,7 +61,7 @@ test('Clicking on a form should navigate me to the editor', async ({ page }) => | |||
}); | |||
|
|||
await test.step('And I click the `A sample test form` form', async () => { | |||
await formBuilderPage.page.getByText('A sample test form').click(); | |||
await formBuilderPage.page.getByText('A sample test form').first().click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requirements
Summary
This PR adds e2e tests for the following actions:
Related Issue
O3-3953