Adding test to check custom menus
This commit is contained in:
@@ -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});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user