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 5f04f04
Showing 1 changed file with 16 additions and 13 deletions.
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 5f04f04

Please sign in to comment.