1
1
import type { EventInitDict , EventSpy , ScreenshotDiff , ScreenshotOptions } from '@stencil/core/internal' ;
2
- import type * as puppeteer from 'puppeteer' ;
3
-
4
- export interface NewE2EPageOptions extends puppeteer . NavigationOptions {
2
+ import type {
3
+ ClickOptions ,
4
+ NavigationOptions ,
5
+ Page ,
6
+ PageCloseOptions ,
7
+ ScreenshotOptions as PuppeteerScreenshotOptions ,
8
+ Response ,
9
+ } from 'puppeteer' ;
10
+
11
+ export interface NewE2EPageOptions extends NavigationOptions {
5
12
url ?: string ;
6
13
html ?: string ;
7
14
failOnConsoleError ?: boolean ;
@@ -10,7 +17,7 @@ export interface NewE2EPageOptions extends puppeteer.NavigationOptions {
10
17
11
18
type Omit < T , K > = Pick < T , Exclude < keyof T , K > > ;
12
19
type PuppeteerPage = Omit <
13
- puppeteer . Page ,
20
+ Page ,
14
21
| 'bringToFront'
15
22
| 'browser'
16
23
| 'screenshot'
@@ -120,15 +127,15 @@ export interface E2EPage extends PuppeteerPage {
120
127
* a localhost address. A shortcut to `page.goto(url)` is to set the `url` option
121
128
* when creating a new page, such as `const page = await newE2EPage({ url })`.
122
129
*/
123
- goTo ( url : string , options ?: puppeteer . NavigationOptions ) : Promise < puppeteer . Response | null > ;
130
+ goTo ( url : string , options ?: NavigationOptions ) : Promise < Response | null > ;
124
131
125
132
/**
126
133
* Instead of testing a url directly, html content can be mocked using
127
134
* `page.setContent(html)`. A shortcut to `page.setContent(html)` is to set
128
135
* the `html` option when creating a new page, such as
129
136
* `const page = await newE2EPage({ html })`.
130
137
*/
131
- setContent ( html : string , options ?: puppeteer . NavigationOptions ) : Promise < void > ;
138
+ setContent ( html : string , options ?: NavigationOptions ) : Promise < void > ;
132
139
133
140
/**
134
141
* Used to test if an event was, or was not dispatched. This method
@@ -162,9 +169,9 @@ export interface E2EPageInternal extends E2EPage {
162
169
_e2eElements : E2EElementInternal [ ] ;
163
170
_e2eEvents : Map < number , WaitForEvent > ;
164
171
_e2eEventIds : number ;
165
- _e2eGoto ( url : string , options ?: Partial < puppeteer . NavigationOptions > ) : Promise < puppeteer . Response | null > ;
166
- _e2eClose ( options ?: puppeteer . PageCloseOptions ) : Promise < void > ;
167
- screenshot ( options ?: puppeteer . ScreenshotOptions ) : Promise < Buffer > ;
172
+ _e2eGoto ( url : string , options ?: Partial < NavigationOptions > ) : Promise < Response | null > ;
173
+ _e2eClose ( options ?: PageCloseOptions ) : Promise < void > ;
174
+ screenshot ( options ?: PuppeteerScreenshotOptions ) : Promise < Buffer > ;
168
175
}
169
176
170
177
export interface E2EElement {
@@ -215,7 +222,7 @@ export interface E2EElement {
215
222
* then uses `page.mouse` to click in the center of the element.
216
223
* Please see the puppeteer docs for more information.
217
224
*/
218
- click ( options ?: puppeteer . ClickOptions ) : Promise < void > ;
225
+ click ( options ?: ClickOptions ) : Promise < void > ;
219
226
220
227
/**
221
228
* Find a child element that matches the selector, which is the same as
0 commit comments