Skip to content

Commit

Permalink
Restore logic for Cancel case
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed May 8, 2024
1 parent d463497 commit fc0c9e0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This is an example environment file for configuring dynamic values.
E2E_BASE_URL=http://localhost:8080/openmrs
E2E_USER_ADMIN_USERNAME=admin
E2E_USER_ADMIN_PASSWORD=Admin123
E2E_LOGIN_DEFAULT_LOCATION_UUID=44c3efb0-2583-4c80-a79e-1f756a03c0a1
# The above location UUID is for the "Outpatient Clinic" location in the reference application
29 changes: 16 additions & 13 deletions e2e/specs/appointments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,25 @@ test('Add, edit and cancel an appointment', async ({ page, api }) => {
await expect(page.getByText(/appointment edited/i)).toBeVisible();
});

// FIXME: Cancelling appointments is failing due to what I suspect to be timezone issues in the test environment
// await test.step('When I click the options kebab menu in the appointment', async () => {
// await page.getByRole('button', { name: 'Options' }).click();
// });
await test.step('When I click the "Today" tab', async () => {
await expect(page.getByRole('tab', { name: /today/i })).toBeVisible();
});

// await test.step('And I choose the "Cancel" option ', async () => {
// await page.getByRole('menuitem', { name: 'Cancel' }).click();
// });
await test.step('Then I click the options kebab menu in the appointment', async () => {
await page.getByRole('button', { name: 'Options' }).click();
});

// await test.step('When I click the "Cancel appointment" button to confirm', async () => {
// await page.getByRole('button', { name: 'danger Cancel appointment' }).click();
// });
await test.step('And I choose the "Cancel" option ', async () => {
await page.getByRole('menuitem', { name: 'Cancel' }).click();
});

// await test.step('Then I should see a success message', async () => {
// await expect(page.getByText(/appointment cancelled successfully/i)).toBeVisible();
// });
await test.step('When I click the "Cancel appointment" button to confirm', async () => {
await page.getByRole('button', { name: 'danger Cancel appointment' }).click();
});

await test.step('Then I should see a success message', async () => {
await expect(page.getByText(/appointment cancelled successfully/i)).toBeVisible();
});
});

test.afterEach(async ({ api }) => {
Expand Down

0 comments on commit fc0c9e0

Please sign in to comment.