SeleniumHQ / seleniumhq.github.io

Official Selenium website and documentation
https://selenium.dev
Apache License 2.0
1.1k stars 1.29k forks source link

update feature/service #1790

Closed alaahong closed 3 months ago

alaahong commented 3 months ago

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.

update feature/service

Description

Motivation and Context

Types of changes

Checklist


PR Type

Documentation


Description


Changes walkthrough 📝

Relevant files
Documentation
service.zh-cn.md
Translate Driver Service Documentation to Chinese               

website_and_docs/content/documentation/webdriver/drivers/service.zh-cn.md
  • Translated the title and content from English to Chinese.
  • Updated terminology and explanations to be consistent with the Chinese
    language.
  • Ensured technical terms and code examples remain accurate.
  • +20/-16 

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

    netlify[bot] commented 3 months ago

    Deploy request for selenium-dev pending review.

    Visit the deploys page to approve it

    Name Link
    Latest commit 686ba7efbc495c73676229728a0d8e8ac7783e40
    codiumai-pr-agent-pro[bot] commented 3 months ago

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review [1-5] 2
    🧪 Relevant tests No
    🔒 Security concerns No
    ⚡ Key issues to review None
    codiumai-pr-agent-pro[bot] commented 3 months ago

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    ✅ Add an example to clarify how to specify the driver port ___
    Suggestion Impact:The suggestion led to a modification in the documentation to clarify how to specify the driver port, although the exact example code was not included. code diff: ```diff 如果希望驱动程序在特定端口上运行, -可以按如下方式指定: +您可以在启动时指定端口号, 如下所示: ```
    ___ **Consider adding a brief explanation or example of how to specify the driver port, similar
    to the original English version. This will help users understand the implementation
    details more clearly.** [website_and_docs/content/documentation/webdriver/drivers/service.zh-cn.md [74-75]](https://github.com/SeleniumHQ/seleniumhq.github.io/pull/1790/files#diff-bfb2159924bb1f31b87fa2f70b6fb848042c904b259824136d912a4785657fdeR74-R75) ```diff -如果希望驱动程序在特定端口上运行, -可以按如下方式指定: +如果希望驱动程序在特定端口上运行, 您可以在启动时指定端口号, 如下所示: +```java +WebDriver driver = new ChromeDriver(new ChromeOptions().setPort(4567)); +``` ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 9 Why: The suggestion provides a clear example of how to specify the driver port, which enhances the user's understanding and mirrors the detail provided in the original English version.
    9
    Add an example to clarify how to set up logging ___ **Add a brief explanation or example for setting up logging, similar to the original English
    version, to enhance clarity for users.** [website_and_docs/content/documentation/webdriver/drivers/service.zh-cn.md [103-105]](https://github.com/SeleniumHQ/seleniumhq.github.io/pull/1790/files#diff-bfb2159924bb1f31b87fa2f70b6fb848042c904b259824136d912a4785657fdeR103-R105) ```diff -日志记录功能因浏览器而异. -大多数浏览器都允许您指定日志的位置和级别. +日志记录功能因浏览器而异. 例如, 在 Chrome 中, 您可以通过以下方式设置日志级别和位置: +```java +ChromeOptions options = new ChromeOptions(); +options.setCapability("goog:loggingPrefs", new HashMap() {{ + put("browser", "ALL"); +}}); +WebDriver driver = new ChromeDriver(options); +``` 请查看相应的浏览器页面: ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 9 Why: The suggestion includes a practical example for setting up logging, which improves clarity and usability for users, similar to the original English documentation.
    9
    Maintainability
    Add the English term for "Default Service instance" in the section header for consistency ___ **Ensure consistency in the translation of section headers by adding the translated term for
    "Default Service instance" to maintain uniformity with other headers.** [website_and_docs/content/documentation/webdriver/drivers/service.zh-cn.md [15]](https://github.com/SeleniumHQ/seleniumhq.github.io/pull/1790/files#diff-bfb2159924bb1f31b87fa2f70b6fb848042c904b259824136d912a4785657fdeR15-R15) ```diff -## 默认服务实例 +## 默认服务实例 (Default Service instance) ``` - [ ] **Apply this suggestion**
    Suggestion importance[1-10]: 7 Why: Adding the English term for "Default Service instance" improves consistency and helps bilingual users, though it is a minor enhancement.
    7