Skip to content

Commit bf26abd

Browse files
Merge branch '4.x' into fix/workers-skip-reload-when-suite-loaded
2 parents dea8427 + 7a1dc9a commit bf26abd

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎lib/helper/Puppeteer.js‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,14 +3216,18 @@ async function proceedSee(assertType, text, context, strict = false) {
32163216
let description
32173217
let allText
32183218
if (!context) {
3219-
let el = await this.context
3219+
if (this.withinLocator) {
3220+
let el = await this.context
32203221

3221-
if (el && !el.getProperty) {
3222-
// Fallback to body
3223-
el = await this.context.$('body')
3224-
}
3222+
if (el && !el.getProperty) {
3223+
el = await this.context.$('body')
3224+
}
32253225

3226-
allText = [await el.evaluate(node => node.innerText)]
3226+
allText = [await el.evaluate(node => node.innerText)]
3227+
} else {
3228+
const ctx = await this._getContext()
3229+
allText = [await ctx.evaluate(() => document.body.innerText)]
3230+
}
32273231
description = 'web application'
32283232
} else {
32293233
const locator = new Locator(context, 'css')

‎test/acceptance/config_test.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ Scenario('change config 6 @WebDriverIO @Puppeteer @Playwright @Obscura', ({ I })
4343

4444
Scenario('simple page test @WebDriverIO @Puppeteer @Playwright @Obscura', ({ I }) => {
4545
I.amOnPage('https://example.com')
46-
I.see('Example Domain')
46+
I.seeInTitle('Example Domain')
4747
})

0 commit comments

Comments
 (0)