Skip to content

[ruby][BiDi] Browsing context commands#11446

Merged
pujagani merged 3 commits intoSeleniumHQ:trunkfrom
TamsilAmani:browsing-context-bidi
Dec 21, 2022
Merged

[ruby][BiDi] Browsing context commands#11446
pujagani merged 3 commits intoSeleniumHQ:trunkfrom
TamsilAmani:browsing-context-bidi

Conversation

@TamsilAmani
Copy link
Copy Markdown
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
Copy Markdown
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 TamsilAmani force-pushed the browsing-context-bidi branch from 9c365e6 to fcd59a9 Compare December 20, 2022 15:55
@TamsilAmani
Copy link
Copy Markdown
Contributor Author

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

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

Thank you @TamsilAmani!

@titusfortner
Copy link
Copy Markdown
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.

4 participants