@@ -24,7 +24,7 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI
24
24
const { it, fit, xit, dit} = testRunner ;
25
25
const { beforeAll, beforeEach, afterAll, afterEach} = testRunner ;
26
26
27
- describe ( 'BrowserContext' , function ( ) {
27
+ describe ( 'BrowserContext' , function ( ) {
28
28
it ( 'pages() should return all of the pages' , async ( { page, server, context} ) => {
29
29
const second = await page . context ( ) . newPage ( ) ;
30
30
const allPages = await context . pages ( ) ;
@@ -35,7 +35,7 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI
35
35
} ) ;
36
36
it ( 'should report when a new page is created and closed' , async ( { browser, page, server, context} ) => {
37
37
const [ otherPage ] = await Promise . all ( [
38
- new Promise ( r => context . once ( 'pageevent ' , async event => r ( await event . page ( ) ) ) ) ,
38
+ new Promise ( r => context . once ( 'page ' , async event => r ( await event . page ( ) ) ) ) ,
39
39
page . evaluate ( url => window . open ( url ) , server . CROSS_PROCESS_PREFIX + '/empty.html' ) ,
40
40
] ) ;
41
41
expect ( otherPage . url ( ) ) . toContain ( server . CROSS_PROCESS_PREFIX ) ;
@@ -72,12 +72,12 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI
72
72
expect ( serviceWorkerCreated ) . not . toBeTruthy ( ) ;
73
73
} ) ;
74
74
it ( 'should not report uninitialized pages' , async ( { browser, context} ) => {
75
- const pagePromise = new Promise ( fulfill => context . once ( 'pageevent ' , async event => fulfill ( await event . page ( ) ) ) ) ;
75
+ const pagePromise = new Promise ( fulfill => context . once ( 'page ' , async event => fulfill ( await event . page ( ) ) ) ) ;
76
76
context . newPage ( ) ;
77
77
const newPage = await pagePromise ;
78
78
expect ( newPage . url ( ) ) . toBe ( 'about:blank' ) ;
79
79
80
- const popupPromise = new Promise ( fulfill => context . once ( 'pageevent ' , async event => fulfill ( await event . page ( ) ) ) ) ;
80
+ const popupPromise = new Promise ( fulfill => context . once ( 'page ' , async event => fulfill ( await event . page ( ) ) ) ) ;
81
81
const evaluatePromise = newPage . evaluate ( ( ) => window . open ( 'about:blank' ) ) ;
82
82
const popup = await popupPromise ;
83
83
expect ( popup . url ( ) ) . toBe ( 'about:blank' ) ;
@@ -89,7 +89,7 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI
89
89
server . setRoute ( '/one-style.css' , ( req , res ) => serverResponse = res ) ;
90
90
// Open a new page. Use window.open to connect to the page later.
91
91
const [ newPage ] = await Promise . all ( [
92
- new Promise ( fulfill => context . once ( 'pageevent ' , async event => fulfill ( await event . page ( ) ) ) ) ,
92
+ new Promise ( fulfill => context . once ( 'page ' , async event => fulfill ( await event . page ( ) ) ) ) ,
93
93
page . evaluate ( url => window . open ( url ) , server . PREFIX + '/one-style.html' ) ,
94
94
server . waitForRequest ( '/one-style.css' )
95
95
] ) ;
@@ -106,7 +106,7 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI
106
106
it ( 'should have an opener' , async ( { browser, page, server, context} ) => {
107
107
await page . goto ( server . EMPTY_PAGE ) ;
108
108
const [ popup ] = await Promise . all ( [
109
- new Promise ( fulfill => context . once ( 'pageevent ' , async event => fulfill ( await event . page ( ) ) ) ) ,
109
+ new Promise ( fulfill => context . once ( 'page ' , async event => fulfill ( await event . page ( ) ) ) ) ,
110
110
page . goto ( server . PREFIX + '/popup/window-open.html' )
111
111
] ) ;
112
112
await popup . waitForLoadState ( ) ;
@@ -125,7 +125,7 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI
125
125
it ( 'should fire page lifecycle events' , async function ( { browser, server} ) {
126
126
const context = await browser . newContext ( ) ;
127
127
const events = [ ] ;
128
- context . on ( 'pageevent ' , async event => {
128
+ context . on ( 'page ' , async event => {
129
129
const page = await event . page ( ) ;
130
130
events . push ( 'CREATED: ' + page . url ( ) ) ;
131
131
page . on ( 'close' , ( ) => events . push ( 'DESTROYED: ' + page . url ( ) ) )
0 commit comments