Adding test to check custom menus

This commit is contained in:
David Négrier
2022-04-26 16:43:59 +02:00
parent ed1efe12f2
commit caf8a74ade
3 changed files with 24 additions and 2 deletions
+22
View File
@@ -13,4 +13,26 @@ test.describe('Iframe API', () => {
await expect(page.locator('p.other-text')).toHaveText('The iframe opened by a script works !', {useInnerText: true});
});
test('can add a custom menu by scripting API', async ({
page,
}) => {
await page.goto(
'http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/Metadata/customMenu.json'
);
await login(page);
await page.click('.menuIcon img:first-child');
await page.click('button:has-text("custom iframe menu")');
const iframeParagraph = page
.frameLocator('.menu-submenu-container iframe')
.locator('p');
await expect(iframeParagraph).toHaveText('This is an iframe in a custom menu.');
await page.click('button:has-text("custom callback menu")');
await expect(page.locator('p.other-text')).toHaveText('Custom menu clicked', {useInnerText: true});
});
});