From 62839d8e81c1d68bbc177ff35c4f1dd03cad8496 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Thu, 20 Jun 2019 18:47:36 +0200 Subject: [PATCH] feat(testing): expose waitFor option --- .../puppeteer/puppeteer-declarations.ts | 6 +++--- src/testing/puppeteer/puppeteer-page.ts | 20 +++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/testing/puppeteer/puppeteer-declarations.ts b/src/testing/puppeteer/puppeteer-declarations.ts index c965c1b1776..a436cf1c66a 100644 --- a/src/testing/puppeteer/puppeteer-declarations.ts +++ b/src/testing/puppeteer/puppeteer-declarations.ts @@ -2,7 +2,7 @@ import * as d from '../../declarations'; import * as puppeteer from 'puppeteer'; -export interface NewE2EPageOptions { +export interface NewE2EPageOptions extends puppeteer.NavigationOptions { url?: string; html?: string; } @@ -80,7 +80,7 @@ export interface E2EPage extends PuppeteerPage { * a localhost address. A shortcut to `page.goto(url)` is to set the `url` option * when creating a new page, such as `const page = await newE2EPage({ url })`. */ - goTo(url: string, options?: Partial): Promise; + goTo(url: string, options?: puppeteer.NavigationOptions): Promise; /** * Instead of testing a url directly, html content can be mocked using @@ -88,7 +88,7 @@ export interface E2EPage extends PuppeteerPage { * the `html` option when creating a new page, such as * `const page = await newE2EPage({ html })`. */ - setContent(html: string): Promise; + setContent(html: string, options?: puppeteer.NavigationOptions): Promise; /** * Used to test if an event was, or was not dispatched. This method diff --git a/src/testing/puppeteer/puppeteer-page.ts b/src/testing/puppeteer/puppeteer-page.ts index f8b22596cab..686f084ba46 100644 --- a/src/testing/puppeteer/puppeteer-page.ts +++ b/src/testing/puppeteer/puppeteer-page.ts @@ -58,13 +58,13 @@ export async function newE2EPage(opts: pd.NewE2EPageOptions = {}): Promise