| 1 |
import { expect, test } from '../fixtures'; |
| 2 |
|
| 3 |
test.beforeEach(async ({ requestUtils }) => { |
| 4 |
await requestUtils.login(); |
| 5 |
}); |
| 6 |
|
| 7 |
test('Tours section lists available tours', async ({ admin, page }) => { |
| 8 |
await admin.visitAdminPage('index.php'); |
| 9 |
|
| 10 |
await page.getByTestId('help-center-adminbar-button').click(); |
| 11 |
|
| 12 |
const toursSection = page.getByTestId('help-center-tours-section'); |
| 13 |
await expect(toursSection).toBeAttached(); |
| 14 |
await expect(toursSection).toContainText( |
| 15 |
'Learn more about your WordPress admin', |
| 16 |
); |
| 17 |
|
| 18 |
await page.getByTestId('help-center-tours-open-button').click(); |
| 19 |
|
| 20 |
const items = page.getByTestId('help-center-tours-items-list').locator('li'); |
| 21 |
expect(await items.count()).toBeGreaterThan(1); |
| 22 |
}); |
| 23 |
|
| 24 |
test('Completing a tour shows the restart icon', async ({ admin, page }) => { |
| 25 |
await admin.visitAdminPage('index.php'); |
| 26 |
|
| 27 |
await page.getByTestId('help-center-adminbar-button').click(); |
| 28 |
await page.getByTestId('help-center-tours-open-button').click(); |
| 29 |
|
| 30 |
await page |
| 31 |
.getByTestId('help-center-tours-items-list') |
| 32 |
.locator('li') |
| 33 |
.first() |
| 34 |
.locator('button') |
| 35 |
.click(); |
| 36 |
|
| 37 |
await page |
| 38 |
.locator('#extendify-tour-navigation nav[aria-label="Tour Steps"] button') |
| 39 |
.last() |
| 40 |
.click(); |
| 41 |
|
| 42 |
await page.locator('#help-center-tour-next-button').click(); |
| 43 |
|
| 44 |
await page.getByTestId('help-center-toggle-minimize-button').click(); |
| 45 |
|
| 46 |
await expect(page.getByTestId('restart-tour-icon')).toHaveCount(1); |
| 47 |
}); |
| 48 |
|