[js][bidi] Fix the event unsubscribe method. Update modules to have close methods. #14192
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.
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
Types of changes
Checklist
PR Type
Bug fix, Enhancement, Tests
Description
close
methods to various modules (BrowsingContextInspector
,LogInspector
,Network
,ScriptManager
) to handle event unsubscription.unsubscribe
method inIndex
to handle event removal more robustly.close
methods inafterEach
.locate_nodes_test.js
.Changes walkthrough 📝
5 files
browsingContextInspector.js
Add close method for event unsubscription in BrowsingContextInspector.
javascript/node/selenium-webdriver/bidi/browsingContextInspector.js
close
method to handle unsubscription of events._browsingContextIds
.index.js
Improve unsubscribe method to handle event removal.
javascript/node/selenium-webdriver/bidi/index.js
unsubscribe
method to handle event removal more robustly.logInspector.js
Add close method for event unsubscription in LogInspector.
javascript/node/selenium-webdriver/bidi/logInspector.js
close
method to handle unsubscription of log events._browsingContextIds
.network.js
Add close method for event unsubscription in Network.
javascript/node/selenium-webdriver/bidi/network.js
close
method to handle unsubscription of network events._browsingContextIds
.scriptManager.js
Add close method for event unsubscription in ScriptManager.
javascript/node/selenium-webdriver/bidi/scriptManager.js
close
method to handle unsubscription of script events._browsingContextIds
.6 files
add_intercept_parameters_test.js
Ensure network cleanup in add intercept parameters tests.
javascript/node/selenium-webdriver/test/bidi/add_intercept_parameters_test.js
network.close()
call inafterEach
to ensure proper cleanup.network
instance creation in each test.bidi_test.js
Ensure inspector cleanup in BiDi tests.
javascript/node/selenium-webdriver/test/bidi/bidi_test.js
inspector.close()
call inafterEach
to ensure proper cleanup.browsingcontext_inspector_test.js
Ensure browsing context inspector cleanup in tests.
javascript/node/selenium-webdriver/test/bidi/browsingcontext_inspector_test.js
browsingcontextInspector.close()
call inafterEach
to ensureproper cleanup.
browsingcontextInspector
instance creation in eachtest.
locate_nodes_test.js
Simplify driver setup in locate nodes tests.
javascript/node/selenium-webdriver/test/bidi/locate_nodes_test.js
beforeEach
.network_test.js
Ensure network cleanup in network tests.
javascript/node/selenium-webdriver/test/bidi/network_test.js
network.close()
call inafterEach
to ensure proper cleanup.network
instance creation in each test.script_test.js
Ensure script manager cleanup in script tests.
javascript/node/selenium-webdriver/test/bidi/script_test.js
manager.close()
call inafterEach
to ensure proper cleanup.manager
instance creation in each test.