From ed1efe12f23f0c3ae8077b56c9b7b94a184679a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Tue, 26 Apr 2022 15:22:48 +0200 Subject: [PATCH] Adding an additional E2E test regarding iFrames and scripts --- maps/tests/index.html | 2 +- tests/tests/iframe_script.spec.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/tests/iframe_script.spec.ts diff --git a/maps/tests/index.html b/maps/tests/index.html index 370d99e6..9adba52d 100644 --- a/maps/tests/index.html +++ b/maps/tests/index.html @@ -216,7 +216,7 @@ Success Failure Pending - Test a iframe opened by a script can use Iframe API + Test a iframe opened by a script can use Iframe API (already automated in E2E tests) diff --git a/tests/tests/iframe_script.spec.ts b/tests/tests/iframe_script.spec.ts new file mode 100644 index 00000000..ab4e17ae --- /dev/null +++ b/tests/tests/iframe_script.spec.ts @@ -0,0 +1,16 @@ +import { expect, test } from '@playwright/test'; +import { login } from './utils/roles'; + +test.describe('Iframe API', () => { + test('can be called from an iframe loading a script', async ({ + page, + }) => { + await page.goto( + 'http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/Metadata/cowebsiteAllowApi.json' + ); + + await login(page); + + await expect(page.locator('p.other-text')).toHaveText('The iframe opened by a script works !', {useInnerText: true}); + }); +});