Adding an additional E2E test regarding iFrames and scripts

This commit is contained in:
David Négrier 2022-04-26 15:22:48 +02:00
parent 7b9c616788
commit ed1efe12f2
2 changed files with 17 additions and 1 deletions

View File

@ -216,7 +216,7 @@
<input type="radio" name="test-cowebsite-allowAPI"> Success <input type="radio" name="test-cowebsite-allowAPI"> Failure <input type="radio" name="test-cowebsite-allowAPI" checked> Pending
</td>
<td>
<a href="#" class="testLink" data-testmap="Metadata/cowebsiteAllowApi.json" target="_blank">Test a iframe opened by a script can use Iframe API</a>
<a href="#" class="testLink" data-testmap="Metadata/cowebsiteAllowApi.json" target="_blank">Test a iframe opened by a script can use Iframe API <i>(already automated in E2E tests)</i></a>
</td>
</tr>
<tr>

View File

@ -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});
});
});