devtools commands for multiremote#11059
Merged
christian-bromann merged 1 commit intowebdriverio:mainfrom Oct 2, 2023
Merged
Conversation
a338c26 to
7ab406f
Compare
Contributor
Author
|
Hi @christian-bromann, how has this been going? |
Member
|
@ccharnkij it seems like the coverage has dropped given all the changes, you think we can add some more unit tests to stay above treshold? |
8858777 to
7c88ac7
Compare
Contributor
Author
|
@christian-bromann this one failed due to some ECONNRESET error. Is there any way I can rerun it w/o additional commit? I already added some tests and rebased it. |
7c88ac7 to
a5151c4
Compare
Contributor
Author
|
@christian-bromann nvm, looks like it goes well now. |
christian-bromann
approved these changes
Oct 2, 2023
Member
christian-bromann
left a comment
There was a problem hiding this comment.
Great change set , nice work 👌
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Continuation from #5505, this feature allows devtools commands to be used for multiremote. The commands can be used with
browserobject itself, which produces array result for all instances, or with an individual instance.Types of changes
Checklist
Further comments
This change is pretty much done by moving the code from devtools/index.ts to devtools/commands.ts and having a separate command object for each browser instance. All commands can be used by an individual instance. However, because I try to do this while wanting to make as little changes as possible, not all commands can be used by
browserand those command are:getNodeId,getNodeIds,startTracing,endTracing,getTraceLogs, andgetPageWeight(the commands that originally exist in commands.ts file). If needed, I can make more change to allow those commands to be used bybrowser.Also, performance testing with lighthouse is a little bit tricky to use. Because of the way
beforeCommandwork, I don't have a way to determine which instance the command is coming from, and this can cause the code to hang becauseonLoadEventFiredandonFrameNavigatedare not triggered.So for performance testing, a user will have to do one instance at a time while having
enablePerformanceAuditsanddisablePerformanceAuditsbefore and after it.Nothing change if a user is using normal mode.
Reviewers: @webdriverio/project-committers