Skip to content

Commit 8d81ed4

Browse files
committed
fix(ppt): no context is used for wait* functions
1 parent 7667cad commit 8d81ed4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/helper/Puppeteer.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ class Puppeteer extends Helper {
626626
}
627627

628628
async _evaluateHandeInContext(...args) {
629-
const context = await this.context || await this._getContext()
629+
const context = (await this.context) || (await this._getContext())
630630
return context.evaluateHandle(...args)
631631
}
632632

@@ -2094,7 +2094,7 @@ class Puppeteer extends Helper {
20942094
locator = new Locator(locator, 'css')
20952095
await this.context
20962096
let waiter
2097-
const context = await this.context || await this._getContext()
2097+
const context = (await this.context) || (await this._getContext())
20982098
if (locator.isCSS()) {
20992099
const enabledFn = function (locator) {
21002100
const els = document.querySelectorAll(locator)
@@ -2126,7 +2126,7 @@ class Puppeteer extends Helper {
21262126
const locator = new Locator(field, 'css')
21272127
await this.context
21282128
let waiter
2129-
const context = await this.context || await this._getContext()
2129+
const context = (await this.context) || (await this._getContext())
21302130
if (locator.isCSS()) {
21312131
const valueFn = function (locator, value) {
21322132
const els = document.querySelectorAll(locator)
@@ -2159,7 +2159,7 @@ class Puppeteer extends Helper {
21592159
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout
21602160
locator = new Locator(locator, 'css')
21612161
let waiter
2162-
const context = await this.context || await this._getContext()
2162+
const context = (await this.context) || (await this._getContext())
21632163
if (locator.isCSS()) {
21642164
const visibleFn = function (locator, num) {
21652165
const els = document.querySelectorAll(locator)
@@ -2210,7 +2210,7 @@ class Puppeteer extends Helper {
22102210
locator = new Locator(locator, 'css')
22112211

22122212
let waiter
2213-
const context = await this.context || await this._getContext()
2213+
const context = (await this.context) || (await this._getContext())
22142214
if (locator.isCSS()) {
22152215
waiter = context.waitForSelector(locator.simplify(), { timeout: waitTimeout })
22162216
} else {
@@ -2233,7 +2233,7 @@ class Puppeteer extends Helper {
22332233
locator = new Locator(locator, 'css')
22342234
await this.context
22352235
let waiter
2236-
const context = await this.context || await this._getContext()
2236+
const context = (await this.context) || (await this._getContext())
22372237
if (locator.isCSS()) {
22382238
waiter = context.waitForSelector(locator.simplify(), { timeout: waitTimeout, visible: true })
22392239
} else {
@@ -2254,7 +2254,7 @@ class Puppeteer extends Helper {
22542254
locator = new Locator(locator, 'css')
22552255
await this.context
22562256
let waiter
2257-
const context = await this.context || await this._getContext()
2257+
const context = (await this.context) || (await this._getContext())
22582258
if (locator.isCSS()) {
22592259
waiter = context.waitForSelector(locator.simplify(), { timeout: waitTimeout, hidden: true })
22602260
} else {
@@ -2272,7 +2272,7 @@ class Puppeteer extends Helper {
22722272
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout
22732273
locator = new Locator(locator, 'css')
22742274
let waiter
2275-
const context = await this.context || await this._getContext()
2275+
const context = (await this.context) || (await this._getContext())
22762276
if (locator.isCSS()) {
22772277
waiter = context.waitForSelector(locator.simplify(), { timeout: waitTimeout, hidden: true })
22782278
} else {
@@ -2501,7 +2501,7 @@ class Puppeteer extends Helper {
25012501
}
25022502
}
25032503
const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout
2504-
const context = await this.context || await this._getContext()
2504+
const context = (await this.context) || (await this._getContext())
25052505
return context.waitForFunction(fn, { timeout: waitTimeout }, ...args)
25062506
}
25072507

@@ -2536,7 +2536,7 @@ class Puppeteer extends Helper {
25362536
locator = new Locator(locator, 'css')
25372537

25382538
let waiter
2539-
const context = await this.context || await this._getContext()
2539+
const context = (await this.context) || (await this._getContext())
25402540
if (locator.isCSS()) {
25412541
const visibleFn = function (locator) {
25422542
return document.querySelector(locator) === null

0 commit comments

Comments
 (0)