-
Notifications
You must be signed in to change notification settings - Fork 225
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
(chore) O3-3574 : Refactor E2E test for appointments #1287
base: main
Are you sure you want to change the base?
Conversation
test('Add an appointment', async ({ page, api }) => { | ||
const appointmentsPage = new AppointmentsPage(page); | ||
test.describe.serial('Running appointment tests sequentially', () => { | ||
test('Add an appointment', async ({ page }) => { |
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.
@jayasanka-sack @kdaud I would like to seek your views concerning the use of test.describe
in scenario of sequential operations e.g. create, edit and delete
like this one.
This is to improve some of our e2e tests going forward and prepare towards writing more advanced test cases.
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.
@chimanwadike the refactor should involve decoupling the test scenarios for adding, editing, and canceling an appointment.
@kdaud this is noted. |
@kdaud I've been away for a while now. Following your last comment, it appears we would have to create separate appointments to test edit and cancel if these test cases must be decoupled that far. In order to decouple the tests the way you've explained and how I understand it, we could run into overheads of more API calls and could lead to slower tests in the grand scheme which is neither what we need. I'm thinking there maybe no need for this PR, what do you think? |
@kdaud What do you think of what @chimanwadike wrote? Should we close this PR? |
@brandones Thanks for revisiting this PR.
So, to rephrase the question, should we accept the little improvement or close the PR? Thanks |
Ok, @kdaud ? |
Yes, this should be possible via the API. See an example here.
It makes sense to refactor the PR by creating appointment via the API, then using it in edit and delete scenarios. |
Requirements
Summary
This PR refactors existing e2e tests for appointments by writing separate tests for adding, updating, and canceling.
This is to increase test clarity and visibility.
Related Issue
https://issues.openmrs.org/browse/O3-3574