Skip to content

Commit

Permalink
update selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Vijaykv5 committed Jul 30, 2024
1 parent 41d9cdc commit 4eec6c9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions e2e/specs/onboarding-test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('Basic Walkthrough', async ({ page }) => {
});

await test.step('Then I should see the tutorial modal', async () => {
await expect(page.getByText(/tutorials/i)).toBeVisible();
await expect(page.getByRole('heading', { name: 'Tutorials' })).toBeVisible();
await expect(
page.getByText(/find walkthroughs and video tutorials on some of the core features of openMRS./i),
).toBeVisible();
Expand All @@ -29,45 +29,39 @@ test('Basic Walkthrough', async ({ page }) => {
});

await test.step('Then I should see the first Joyride tooltip', async () => {
await page.waitForSelector('#react-joyride-step-0 div', { state: 'visible' });
await expect(
page.locator('#react-joyride-step-0 div').filter({ hasText: 'Welcome to OpenMRS!' }).first(),
).toBeVisible();
await page.locator('[data-test-id="button-primary"]').click();
});

await test.step('And I should see the search icon Joyride tooltip', async () => {
await page.waitForSelector('#react-joyride-step-1 div', { state: 'visible' });
await expect(
page.locator('#react-joyride-step-1 div').filter({ hasText: 'This is the search icon' }).first(),
).toBeVisible();
await page.locator('[data-test-id="button-primary"]').click();
});

await test.step('Then I should see the add patient icon Joyride tooltip', async () => {
await page.waitForSelector('#react-joyride-step-2 div', { state: 'visible' });
await expect(
page.locator('#react-joyride-step-2 div').filter({ hasText: 'This is the add patient icon' }).first(),
).toBeVisible();
await page.locator('[data-test-id="button-primary"]').click();
});

await test.step('And I should see the user icon Joyride tooltip', async () => {
await page.waitForSelector('#react-joyride-step-3 div', { state: 'visible' });
await expect(page.locator('#react-joyride-step-3 div').filter({ hasText: 'The user icon' }).first()).toBeVisible();
await page.locator('[data-test-id="button-primary"]').click();
});

await test.step('Then I should see the active visits Joyride tooltip', async () => {
await page.waitForSelector('#react-joyride-step-4 div', { state: 'visible' });
await expect(
page.locator('#react-joyride-step-4 div').filter({ hasText: 'This table displays active visits' }).first(),
).toBeVisible();
await page.locator('[data-test-id="button-primary"]').click();
});

await test.step('And I should see the appointments table Joyride tooltip', async () => {
await page.waitForSelector('#react-joyride-step-5 div', { state: 'visible' });
await expect(
page.locator('#react-joyride-step-5 div').filter({ hasText: 'This table shows appointments' }).first(),
).toBeVisible();
Expand Down

0 comments on commit 4eec6c9

Please sign in to comment.