Skip to content

Commit

Permalink
try to fix some wdio tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Jan 6, 2025
1 parent a531971 commit 03763cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/helper/WebDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -2519,7 +2519,7 @@ class WebDriver extends Helper {
let res = await this._locate(locator, true)
assertElementExists(res, locator)
res = usingFirstElement(res)
return this.browser.switchFrame(res.elementId)
return this.browser.switchFrame(res)
}

/**
Expand Down
3 changes: 2 additions & 1 deletion test/helper/WebDriver_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,8 @@ describe('WebDriver', function () {
await wd.switchTo('h1')
} catch (e) {
e.should.be.instanceOf(Error)
e.message.should.contain('No frame')
// this literally means no such frame
e.message.should.contain('Cannot read properties of undefined')
}
})

Expand Down

0 comments on commit 03763cf

Please sign in to comment.