2021-11-12 17:27:10 +01:00
|
|
|
describe('Homepage', () => {
|
|
|
|
beforeAll(async () => {
|
2021-12-12 01:07:30 +01:00
|
|
|
await page.goto(`${TEST_ORIGIN}/admin/`, {
|
2021-11-12 17:27:10 +01:00
|
|
|
waitUntil: 'domcontentloaded',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('has the right heading', async () => {
|
|
|
|
const pageHeader = await page.$('h1');
|
|
|
|
const pageHeaderValue = await pageHeader.evaluate((el) => el.textContent);
|
|
|
|
expect(pageHeaderValue).toContain('Welcome to the Test Site Wagtail CMS');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('axe', async () => {
|
|
|
|
await expect(page).toPassAxeTests({
|
|
|
|
exclude: '.stats, .skiplink, #wagtail-sidebar, .sidebar__collapse-toggle',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('axe page explorer', async () => {
|
2022-03-15 15:53:40 +01:00
|
|
|
const trigger = await page.$(
|
2022-04-29 15:38:53 +02:00
|
|
|
'.sidebar-page-explorer-item [aria-haspopup="dialog"]',
|
2022-03-15 15:53:40 +01:00
|
|
|
);
|
2021-11-12 17:27:10 +01:00
|
|
|
await trigger.click();
|
|
|
|
await expect(page).toPassAxeTests({
|
|
|
|
include: '.sidebar-main-menu',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('axe sidebar sub-menu', async () => {
|
2022-03-15 15:53:40 +01:00
|
|
|
const trigger = await page.$(
|
2022-04-29 15:43:45 +02:00
|
|
|
'.sidebar-sub-menu-item [aria-haspopup="menu"]',
|
2022-03-15 15:53:40 +01:00
|
|
|
);
|
2021-11-12 17:27:10 +01:00
|
|
|
await trigger.click();
|
|
|
|
await expect(page).toPassAxeTests({
|
|
|
|
include: '.sidebar-main-menu',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('axe sidebar footer', async () => {
|
|
|
|
const trigger = await page.$('[aria-label="Edit your account"]');
|
|
|
|
await trigger.click();
|
|
|
|
await expect(page).toPassAxeTests({
|
|
|
|
include: '.sidebar-footer',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|