|
1 |
| -import type { E2EProcessEnv, EmulateConfig, HostElement, JestEnvironmentGlobal } from '@stencil/core/internal'; |
2 |
| -import type { ConsoleMessage, ConsoleMessageLocation, ElementHandle, JSHandle, Page, WaitForOptions } from 'puppeteer'; |
| 1 | +import type { E2EProcessEnv, HostElement, JestEnvironmentGlobal } from '@stencil/core/internal'; |
| 2 | +import type { ConsoleMessage, ConsoleMessageLocation, ElementHandle, JSHandle, WaitForOptions } from 'puppeteer'; |
3 | 3 |
|
4 | 4 | import type {
|
5 | 5 | E2EPage,
|
@@ -30,7 +30,6 @@ export async function newE2EPage(opts: NewE2EPageOptions = {}): Promise<E2EPage>
|
30 | 30 | page._e2eGoto = page.goto;
|
31 | 31 | page._e2eClose = page.close;
|
32 | 32 |
|
33 |
| - await setPageEmulate(page as any); |
34 | 33 | await page.setCacheEnabled(false);
|
35 | 34 | await initPageEvents(page);
|
36 | 35 |
|
@@ -276,26 +275,6 @@ async function waitForStencil(page: E2EPage, options: WaitForOptions) {
|
276 | 275 | }
|
277 | 276 | }
|
278 | 277 |
|
279 |
| -async function setPageEmulate(page: Page) { |
280 |
| - if (page.isClosed()) { |
281 |
| - return; |
282 |
| - } |
283 |
| - |
284 |
| - const emulateJsonContent = env.__STENCIL_EMULATE__; |
285 |
| - if (!emulateJsonContent) { |
286 |
| - return; |
287 |
| - } |
288 |
| - |
289 |
| - const screenshotEmulate = JSON.parse(emulateJsonContent) as EmulateConfig; |
290 |
| - |
291 |
| - const emulateOptions = { |
292 |
| - viewport: screenshotEmulate.viewport, |
293 |
| - userAgent: screenshotEmulate.userAgent, |
294 |
| - }; |
295 |
| - |
296 |
| - await (page as Page).emulate(emulateOptions); |
297 |
| -} |
298 |
| - |
299 | 278 | async function waitForChanges(page: E2EPageInternal) {
|
300 | 279 | try {
|
301 | 280 | if (page.isClosed()) {
|
|
0 commit comments