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

[dotnet] [bidi] Reveal browsing context module in bidi instance #14684

Merged

Conversation

nvborisenko
Copy link
Member

@nvborisenko nvborisenko commented Oct 30, 2024

User description

Description

This addresses the 2nd point from #14530, I missed it eventually.

Don't mimic BiDi instance as BrowsingContext

Motivation and Context

Open door to API from BrowsingContext module, users will be able to:

await bidi.BrowsingContext.CreateAsync(...);

Currently this API is hidden by mistake.

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.

PR Type

enhancement


Description

  • Exposed the BrowsingContext module in the BiDi class by changing its access modifier from internal to public.
  • This change allows users to directly access the BrowsingContext module, aligning with the intended API design.
  • Addresses the second point from the related ticket, improving the usability of the BiDi instance.

Changes walkthrough 📝

Relevant files
Enhancement
BiDi.cs
Expose BrowsingContext Module in BiDi Class                           

dotnet/src/webdriver/BiDi/BiDi.cs

  • Changed access modifier of BrowsingContext from internal to public.
  • Exposed the BrowsingContext module to be publicly accessible.
  • +1/-1     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis ✅

    14530 - Fully compliant

    Fully compliant requirements:

    • Don't mimic BiDi instance as BrowsingContext
    • Expose modules instead of forwarding to BrowsingContext module
    • Allow users to access BrowsingContext module directly
    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    API Change
    The BrowsingContext property is now public. Ensure this change doesn't unintentionally expose internal functionality or break existing code that relies on its previous internal status.

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Group properties by access modifier for improved organization

    Consider grouping public properties together and internal properties together for
    better code organization and readability.

    dotnet/src/webdriver/BiDi/BiDi.cs [41-46]

    -internal Modules.Session.SessionModule SessionModule => _sessionModule.Value;
     public Modules.BrowsingContext.BrowsingContextModule BrowsingContext => _browsingContextModule.Value;
     public Modules.Browser.BrowserModule Browser => _browserModule.Value;
     public Modules.Network.NetworkModule Network => _networkModule.Value;
    -internal Modules.Input.InputModule InputModule => _inputModule.Value;
     public Modules.Script.ScriptModule Script => _scriptModule.Value;
     
    +internal Modules.Session.SessionModule SessionModule => _sessionModule.Value;
    +internal Modules.Input.InputModule InputModule => _inputModule.Value;
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: This suggestion improves code organization and readability by grouping properties by access modifier. While it does not address a critical issue, it enhances maintainability and clarity.

    5

    💡 Need additional feedback ? start a PR chat

    @nvborisenko nvborisenko merged commit 9c9d99a into SeleniumHQ:trunk Oct 31, 2024
    10 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant