mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore: detect setContent within goto
This commit is contained in:
@@ -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.'
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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 {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user