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

[py] add remaining code for virtual authenticator #2096

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

Delta456
Copy link
Contributor

@Delta456 Delta456 commented Dec 9, 2024

User description

Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.

Description

Added and linked code examples to respective documentation

Motivation and Context

The example was missing but the code was already written was not linked. This PR links that.

Types of changes

  • Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example added (and I also added the example to all translated languages)
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

PR Type

enhancement, documentation


Description

  • Renamed the test function test_create_authenticator to test_add_authenticator in the Python test suite to better reflect its purpose.
  • Corrected a typo in a comment within the Python test file.
  • Updated Python code block references in the English, Japanese, and Portuguese documentation to ensure they point to the correct lines in the test file.

Changes walkthrough 📝

Relevant files
Enhancement
test_virtual_authenticator.py
Update test function names and comments in Python tests   

examples/python/tests/interactions/test_virtual_authenticator.py

  • Renamed test_create_authenticator to test_add_authenticator.
  • Corrected a typo in a comment.
  • +2/-2     
    Documentation
    virtual_authenticator.en.md
    Update Python code block references in English documentation

    website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.en.md

    • Updated code block references for Python examples.
    +7/-7     
    virtual_authenticator.ja.md
    Update Python code block references in Japanese documentation

    website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.ja.md

    • Updated code block references for Python examples.
    +7/-7     
    virtual_authenticator.pt-br.md
    Update Python code block references in Portuguese documentation

    website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.pt-br.md

    • Updated code block references for Python examples.
    +7/-7     

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

    Copy link

    netlify bot commented Dec 9, 2024

    Deploy Preview for selenium-dev ready!

    Name Link
    🔨 Latest commit 300cc51
    🔍 Latest deploy log https://app.netlify.com/sites/selenium-dev/deploys/67574c3029d6b300089cf10e
    😎 Deploy Preview https://deploy-preview-2096--selenium-dev.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify site configuration.

    Copy link
    Contributor

    qodo-merge-pro bot commented Dec 9, 2024

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Code Consistency
    The test function was renamed from test_create_authenticator to test_add_authenticator, but the function still creates an authenticator. Consider if the new name accurately reflects the function's purpose.

    Copy link
    Contributor

    qodo-merge-pro bot commented Dec 9, 2024

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Replace set syntax with list syntax for bytearray initialization to ensure consistent ordering of bytes

    Initialize the credential_id bytearray with a list instead of a set. Using set
    syntax ({1, 2, 3, 4}) creates an unordered set, which may lead to inconsistent
    credential IDs. Use list syntax ([1, 2, 3, 4]) instead.

    examples/python/tests/interactions/test_virtual_authenticator.py [90]

    -credential_id = bytearray({1, 2, 3, 4})
    +credential_id = bytearray([1, 2, 3, 4])
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Using set syntax for bytearray initialization can lead to non-deterministic byte ordering, potentially causing inconsistent credential IDs. This is a significant issue for authentication functionality.

    8
    Use list syntax instead of set syntax for bytearray initialization to maintain byte order

    Initialize the user_handle bytearray with a list instead of a set for consistent
    byte ordering.

    examples/python/tests/interactions/test_virtual_authenticator.py [92]

    -user_handle = bytearray({1})
    +user_handle = bytearray([1])
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Similar to the first suggestion, using set syntax for user_handle bytearray can cause non-deterministic byte ordering, which could affect authentication reliability and consistency.

    8

    💡 Need additional feedback ? start a PR chat

    Copy link
    Member

    @harsha509 harsha509 left a comment

    Choose a reason for hiding this comment

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

    Thank you @Delta456 !

    @harsha509
    Copy link
    Member

    Test failures are expected (underlying issue with selenium manager + edge)

    @harsha509 harsha509 merged commit 723e2c9 into SeleniumHQ:trunk Dec 10, 2024
    10 of 12 checks passed
    selenium-ci added a commit that referenced this pull request Dec 10, 2024
    * [py] add remaining code for virtual authenticator
    
    * add 723e2c9
    @Delta456 Delta456 deleted the virtual_auth branch December 10, 2024 16:01
    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.

    2 participants