diff --git a/core/src/utils/test/playwright/page/utils/goto.ts b/core/src/utils/test/playwright/page/utils/goto.ts index 3cc9aa2423..41d52b9793 100644 --- a/core/src/utils/test/playwright/page/utils/goto.ts +++ b/core/src/utils/test/playwright/page/utils/goto.ts @@ -40,7 +40,7 @@ configs().forEach(({ config, title }) => { theme = options.theme; } - if (theme !== 'light') { + if (theme !== 'light' && options?.inline === undefined) { throw new Error( 'The "themes" config option is only supported when using "page.setContent". Remove the theme from the config and manually set the theme in the test template.' ); diff --git a/core/src/utils/test/playwright/page/utils/set-content.ts b/core/src/utils/test/playwright/page/utils/set-content.ts index 1f0e6b2a4a..26583d056a 100644 --- a/core/src/utils/test/playwright/page/utils/set-content.ts +++ b/core/src/utils/test/playwright/page/utils/set-content.ts @@ -82,6 +82,6 @@ export const setContent = async (page: Page, html: string, testInfo: TestInfo, o } }); - await page.goto(`${baseUrl}#`, options); + await page.goto(`${baseUrl}#`, { ...options, inline: true } as E2EPageOptions); } }; diff --git a/core/src/utils/test/playwright/playwright-declarations.ts b/core/src/utils/test/playwright/playwright-declarations.ts index d900f37abe..003d65376a 100644 --- a/core/src/utils/test/playwright/playwright-declarations.ts +++ b/core/src/utils/test/playwright/playwright-declarations.ts @@ -4,7 +4,13 @@ import type { TestConfig } from './generator'; import type { EventSpy } from './page/event-spy'; import type { LocatorOptions, E2ELocator } from './page/utils/locator'; -export interface E2EPageOptions extends PageOptions, TestConfig {} +export interface E2EPageOptions extends PageOptions, TestConfig { + /** + * Indicates if the page content is set inline with `.setContent`. This setting can + * only be true or not set. + */ + inline?: true; +} interface PageOptions { /**