SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.73k stars 8.02k forks source link

[py] Update Documentation api.rst File List #14172

Closed iampopovich closed 6 days ago

iampopovich commented 1 week ago

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

trying to fix documentation for current and obsolete classes according to issue #13910

Motivation and Context

Types of changes

Checklist


PR Type

Documentation, Bug fix


Description


Changes walkthrough ๐Ÿ“

Relevant files
Documentation
driver_finder.py
Add module-level docstring for DriverFinder                           

py/selenium/webdriver/common/driver_finder.py - Added module-level docstring for `DriverFinder` implementation.
+1/-0     
api.rst
Update and reorder module list in api.rst                               

py/docs/source/api.rst
  • Updated the list of modules in api.rst to include new and reordered
    entries.
  • Ensured alphabetical order for module listings.
  • +36/-14 
    selenium.common.exceptions.rst
    Add NoSuchDriverException to exceptions list                         

    py/docs/source/common/selenium.common.exceptions.rst
  • Added NoSuchDriverException to the exceptions list.
  • Minor formatting adjustments.
  • +15/-15 
    selenium.webdriver.common.driver_finder.rst
    Add documentation for selenium.webdriver.common.driver_finder

    py/docs/source/webdriver/selenium.webdriver.common.driver_finder.rst
  • Added new documentation file for
    selenium.webdriver.common.driver_finder.
  • +29/-0   
    selenium.webdriver.common.options.rst
    Add PageLoadStrategy to options documentation                       

    py/docs/source/webdriver/selenium.webdriver.common.options.rst - Added `PageLoadStrategy` to the autosummary list.
    +1/-0     
    selenium.webdriver.common.selenium_manager.rst
    Add documentation for selenium.webdriver.common.selenium_manager

    py/docs/source/webdriver/selenium.webdriver.common.selenium_manager.rst
  • Added new documentation file for
    selenium.webdriver.common.selenium_manager.
  • +29/-0   
    selenium.webdriver.firefox.extension_connection.rst
    Remove obsolete firefox extension connection documentation

    py/docs/source/webdriver_firefox/selenium.webdriver.firefox.extension_connection.rst
  • Removed obsolete documentation for
    selenium.webdriver.firefox.extension_connection.
  • +0/-35   
    Configuration changes
    tox.ini
    Add requirements.txt to tox dependencies                                 

    py/tox.ini - Added `requirements.txt` to the dependencies list in `tox.ini`.
    +1/-0     

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    codiumai-pr-agent-pro[bot] commented 1 week ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review [1-5] 3
    ๐Ÿงช Relevant tests No
    ๐Ÿ”’ Security concerns No
    โšก Key issues to review Documentation Consistency:
    Ensure that the documentation updates are consistent with the actual API changes and that all new classes and methods are properly documented. The PR should be checked for completeness and accuracy in the documentation.
    Removal of Content:
    The removal of certain files and sections, such as selenium.webdriver.firefox.extension_connection, should be validated to ensure that they are indeed obsolete and that their removal does not affect other parts of the documentation or the actual functionality.
    codiumai-pr-agent-pro[bot] commented 1 week ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Verify the existence and accuracy of requirements.txt to prevent build issues ___ **Ensure that requirements.txt exists and contains the necessary dependencies to avoid
    potential build failures.** [py/tox.ini [9]](https://github.com/SeleniumHQ/selenium/pull/14172/files#diff-27d219400d7f64afbf3d9bceb197e20b299fdd58fb4e84c9b7c2ee7c4e828177R9-R9) ```diff --r requirements.txt +-r requirements.txt # Ensure this file exists and is up-to-date ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 7 Why: The suggestion to ensure the existence and accuracy of `requirements.txt` is practical and helps prevent build failures, which is important for maintaining a reliable build process.
    7
    titusfortner commented 1 week ago

    @iampopovich was this code automatically generated?

    iampopovich commented 1 week ago

    No, I think we should close this pull request and continue figuring out how to fix the document generation globally using Sphinx.

    titusfortner commented 1 week ago

    If this is going to generate the right things for 4.22, though, I'd like to get something updated and then we can figure out the automated way to do this going forward?

    iampopovich commented 1 week ago

    Hm

    After I manually added new classes and removed non-existent ones, new .rst documents were generated automatically.

    When I ran it locally, I got a dialog asking, "Do you want to update the documentation?"

    I declined, but I think even if I had agreed, I wouldn't have had the write permissions to update the documentation in production.

    Is there a way to check the validity of the created documents without updating the existing documentation? I saw that sphinx can generate HTML, but unfortunately, I'm not at my computer right now.

    iampopovich commented 1 week ago

    Some documents that were generated locally were not included in the commits. I deliberately didn't add them because I thought they could be created automatically when the documentation update action runs.

    These are the files with documentation for bidi.

    This can be checked by running ./go py:docs locally.

    titusfortner commented 1 week ago

    You can't break anything. The current code

    1. Deletes relevant /build/docs/api/py directory
    2. Generates new docs to that directory
    3. Checks out gh-pages branch
    4. Deletes current /docs/api/py/ directory
    5. copies from /build/docs/api/py to /docs/api/py
    6. Commit/Push and Github does the build/publish

    So we just need to get tox -c py/tox.ini -e docs (or the equivalent) to generate the right files into buid/docs/api/py directory and compare it to the directory in gh-pages.

    titusfortner commented 1 week ago

    Oh yeah, I just changed what ./go py:docs does. It used to try to do everything for you, now it just generates and makes the commit. Trying to get all the docs stuff done in Github actions now: https://github.com/SeleniumHQ/selenium/blob/trunk/.github/workflows/update-documentation.yml

    iampopovich commented 1 week ago

    @titusfortner you can see in my latest commit that new documents were generated according to the list of files in api.rst In the screenshot, I provided an example of the previously missing class wpewebkit. 4.21.0

    Screenshot 2024-06-22 at 21 48 51

    my local build

    Screenshot 2024-06-22 at 21 46 31

    guess we can use manually updated api.rst for the 4.22.0 documentation

    titusfortner commented 6 days ago

    Closing this in favor of #14173