-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devtools package: fix switchToFrame function #5350
devtools package: fix switchToFrame function #5350
Conversation
* add switchToFrame(number) test * add switchToFram(null) test (currently skipping) * fix switchToFrame(number ) to apply appropriate this value
* fix condition checking order to to avoid reference null value * fix val to avoid infinite loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment added
@@ -32,7 +44,7 @@ export default async function switchToFrame ({ id }) { | |||
* `page` has `frames` method while `frame` has `childFrames` method | |||
*/ | |||
let getFrames = page.frames || page.childFrames | |||
const childFrames = await getFrames() | |||
const childFrames = await getFrames.apply(page) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not do getFrames(page)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method doesn't take arguments. @takeya0x86 is correct here we call the method without its scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! 👍
@@ -32,7 +44,7 @@ export default async function switchToFrame ({ id }) { | |||
* `page` has `frames` method while `frame` has `childFrames` method | |||
*/ | |||
let getFrames = page.frames || page.childFrames | |||
const childFrames = await getFrames() | |||
const childFrames = await getFrames.apply(page) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method doesn't take arguments. @takeya0x86 is correct here we call the method without its scope.
Build is currently broken due to #5369 .. let's wait until it gets merged so we can rebase. Thank you @takeya0x86 for providing a fix! |
I will go ahead and merge this so I can include it in the next release. |
Proposed changes
fixes #5345
Add tests
Fix codes
Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers