Skip to content
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

[ruby][BiDi] Browsing context commands #11446

Merged
merged 3 commits into from Dec 21, 2022

Conversation

TamsilAmani
Copy link
Contributor

Description

Add BrowsingContext module commands based on the spec.
Refer to BiDi spec doc for details.

Motivation and Context

Support BrowsingContext commands based on the W3C BiDi spec. Currently, the commands supported by browsers are made public. Refer https://wpt.fyi/results/webdriver/tests/bidi/browsing_context?label=experimental&label=master&aligned&view=subtest. As browsers implement the rest of the commands, we can make them public (adding methods will not be a breaking change).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@pujagani pujagani added this to the 4.8 milestone Dec 20, 2022
@pujagani pujagani requested a review from p0deje December 20, 2022 08:27
@TamsilAmani TamsilAmani changed the title Browsing context bidi [JS][BiDi] Browsing context bidi Dec 20, 2022
@TamsilAmani TamsilAmani changed the title [JS][BiDi] Browsing context bidi [ruby][BiDi] Browsing context commands Dec 20, 2022
Copy link
Member

@p0deje p0deje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

May I suggest to re-organize the code a little bit? It would be nice to follow the naming structure where a folder corresponds to a namespace (class/module) and a file name corresponds to a class name. So in your PR it would be:

file path full class name
rb/lib/selenium/webdriver/bidi/browsing_context/browsing_context.rb Selenium::WebDriver::BiDi::BrowsingContext::BrowsingContext
rb/lib/selenium/webdriver/bidi/browsing_context/browsing_context_info.rb Selenium::WebDriver::BiDi::BrowsingContext::BrowsingContextInfo
rb/lib/selenium/webdriver/bidi/browsing_context/navigate_result.rb Selenium::WebDriver::BiDi::BrowsingContext::NavigateResult

It looks too verbose though, so I suggest the following structure:

file path full class name
rb/lib/selenium/webdriver/bidi/browsing_context.rb Selenium::WebDriver::BiDi::BrowsingContext
rb/lib/selenium/webdriver/bidi/browsing_context_info.rb Selenium::WebDriver::BiDi::BrowsingContextInfo
rb/lib/selenium/webdriver/bidi/navigate_result.rb Selenium::WebDriver::BiDi::NavigateResult

It would make the classes more aligned with the file paths they live in.

@TamsilAmani
Copy link
Contributor Author

All changes have been incorporated. Thank you @p0deje :)

@pujagani pujagani merged commit 10a9e52 into SeleniumHQ:trunk Dec 21, 2022
@pujagani
Copy link
Contributor

Thank you @TamsilAmani!

@titusfortner
Copy link
Member

@TamsilAmani this test is failing on all Chrome runs currently —

it 'can navigate and listen to errors' do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants