Skip to content

Commit a7af2ea

Browse files
authored
Merge branch 'trunk' into fix2452
2 parents 4f84e6a + f297c06 commit a7af2ea

File tree

9 files changed

+64
-69
lines changed

9 files changed

+64
-69
lines changed

.github/workflows/js-examples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ jobs:
4646
run: Xvfb :99 &
4747
- name: Setup Node Stable
4848
if: matrix.release == 'stable'
49-
uses: actions/setup-node@v5
49+
uses: actions/setup-node@v6
5050
with:
5151
node-version: '22.x'
5252
- name: Setup Node Nightly
5353
if: matrix.release == 'nightly'
54-
uses: actions/setup-node@v5
54+
uses: actions/setup-node@v6
5555
with:
5656
node-version: '22.x'
5757
registry-url: 'https://npm.pkg.github.com'

.github/workflows/link-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
extended: true
3030

3131
- name: Setup Node
32-
uses: actions/setup-node@v5
32+
uses: actions/setup-node@v6
3333
with:
3434
node-version: '22.20.0'
3535
cache: 'npm'

.github/workflows/ruby-examples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Set up Ruby
5252
uses: ruby/setup-ruby@v1
5353
with:
54-
ruby-version: 3.2
54+
ruby-version: 3.4.7
5555
bundler-cache: true
5656
- name: Install Gems Nightly non-Windows
5757
if: matrix.release == 'nightly' && matrix.os != 'windows'
@@ -119,7 +119,7 @@ jobs:
119119
- name: Set up Ruby
120120
uses: ruby/setup-ruby@v1
121121
with:
122-
ruby-version: 3.2
122+
ruby-version: 3.4.7
123123
bundler-cache: true
124124
- name: Install dependencies
125125
working-directory: ./examples/ruby

examples/ruby/Gemfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ GEM
44
ast (2.4.3)
55
base64 (0.3.0)
66
diff-lcs (1.5.1)
7-
json (2.13.2)
7+
json (2.15.2)
88
language_server-protocol (3.17.0.5)
99
lint_roller (1.1.0)
1010
logger (1.7.0)
1111
parallel (1.27.0)
12-
parser (3.3.9.0)
12+
parser (3.3.10.0)
1313
ast (~> 2.4.1)
1414
racc
15-
prism (1.4.0)
15+
prism (1.6.0)
1616
racc (1.8.1)
1717
rainbow (3.1.1)
18-
rake (13.3.0)
19-
regexp_parser (2.11.2)
18+
rake (13.3.1)
19+
regexp_parser (2.11.3)
2020
rexml (3.4.4)
2121
rspec (3.13.2)
2222
rspec-core (~> 3.13.0)
@@ -31,18 +31,18 @@ GEM
3131
diff-lcs (>= 1.2.0, < 2.0)
3232
rspec-support (~> 3.13.0)
3333
rspec-support (3.13.6)
34-
rubocop (1.80.2)
34+
rubocop (1.81.6)
3535
json (~> 2.3)
3636
language_server-protocol (~> 3.17.0.2)
3737
lint_roller (~> 1.1.0)
3838
parallel (~> 1.10)
3939
parser (>= 3.3.0.2)
4040
rainbow (>= 2.2.2, < 4.0)
4141
regexp_parser (>= 2.9.3, < 3.0)
42-
rubocop-ast (>= 1.46.0, < 2.0)
42+
rubocop-ast (>= 1.47.1, < 2.0)
4343
ruby-progressbar (~> 1.7)
4444
unicode-display_width (>= 2.4.0, < 4.0)
45-
rubocop-ast (1.46.0)
45+
rubocop-ast (1.47.1)
4646
parser (>= 3.3.7.2)
4747
prism (~> 1.4)
4848
rubocop-rspec (3.6.0)

website_and_docs/content/documentation/grid/advanced_features/customize_node.zh-cn.md

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,68 @@
11
---
2-
title: "Customizing a Node"
3-
linkTitle: "Customize Node"
2+
title: "自定义Node"
3+
linkTitle: "自定义Node"
44
weight: 4
55
---
66

7-
{{% pageinfo color="warning" %}}
8-
<p class="lead">
9-
<i class="fas fa-language d-4"></i>
10-
Page being translated from
11-
English to Chinese. Do you speak Chinese? Help us to translate
12-
it by sending us pull requests!
13-
</p>
14-
{{% /pageinfo %}}
157

16-
## How to customize a Node
8+
## 如何自定义节点
179

18-
There are times when we would like a Node to be customized to our needs.
10+
有时候我们希望根据自己的需求自定义Node。
1911

20-
For e.g., we may like to do some additional setup before a session begins execution and some clean-up after a session runs to completion.
12+
例如,我们可能希望在会话开始执行前做一些额外的设置,在会话完成后做一些清理工作。
2113

22-
Following steps can be followed for this:
14+
可以按照以下步骤进行:
2315

24-
* Create a class that extends `org.openqa.selenium.grid.node.Node`
25-
* Add a static method (this will be our factory method) to the newly created class whose signature looks like this:
16+
* 创建一个类,继承自 `org.openqa.selenium.grid.node.Node`
17+
* 在新建的类中添加一个静态方法(工厂方法),其签名如下:
2618

27-
`public static Node create(Config config)`. Here:
19+
`public static Node create(Config config)`。其中:
2820

29-
* `Node` is of type `org.openqa.selenium.grid.node.Node`
30-
* `Config` is of type `org.openqa.selenium.grid.config.Config`
31-
* Within this factory method, include logic for creating your new Class.
32-
* To wire in this new customized logic into the hub, start the node and pass in the fully qualified class name of the above class to the argument `--node-implementation`
21+
* `Node` 类型为 `org.openqa.selenium.grid.node.Node`
22+
* `Config` 类型为 `org.openqa.selenium.grid.config.Config`
23+
* 在工厂方法中,包含创建新类的逻辑。
24+
* 要将自定义逻辑接入 hub,启动 node 时通过参数 `--node-implementation` 传入上述类的完整类名。
3325

34-
Let's see an example of all this:
26+
下面我们来看一个完整的示例:
3527

36-
### Custom Node as an uber jar
28+
### 作为 uber jar 的自定义 Node
3729

38-
1. Create a sample project using your favourite build tool (**Maven**|**Gradle**).
39-
2. Add the below dependency to your sample project.
30+
1. 使用你喜欢的构建工具 (**Maven**|**Gradle**) 创建一个示例项目。
31+
2. 在项目中添加如下依赖:
4032
* [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid)
41-
3. Add your customized Node to the project.
42-
4. Build an [uber jar](https://imagej.net/develop/uber-jars) to be able to start the Node using `java -jar` command.
43-
5. Now start the Node using the command:
33+
3. 将你的自定义 Node 添加到项目中。
34+
4. 构建一个 [uber jar](https://imagej.net/develop/uber-jars),以便通过 `java -jar` 命令启动 Node。
35+
5. 现在使用如下命令启动 Node
4436

4537
```bash
4638
java -jar custom_node-server.jar node \
4739
--node-implementation org.seleniumhq.samples.DecoratedLoggingNode
4840
```
4941

50-
**Note:** If you are using Maven as a build tool, please prefer using [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin) instead of [maven-assembly-plugin](https://maven.apache.org/plugins/maven-assembly-plugin) because maven-assembly plugin seems to have issues with being able to merge multiple Service Provider Interface files (`META-INF/services`)
42+
**注意:** 如果你使用 Maven 作为构建工具,
43+
建议使用 [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin)
44+
而不是 [maven-assembly-plugin](https://maven.apache.org/plugins/maven-assembly-plugin)
45+
因为 maven-assembly-plugin 在合并多个 Service Provider Interface 文件 (`META-INF/services`)
46+
时可能存在问题。
5147

52-
### Custom Node as a regular jar
48+
### 作为普通 jar 的自定义 Node
5349

54-
1. Create a sample project using your favourite build tool (**Maven**|**Gradle**).
55-
2. Add the below dependency to your sample project.
50+
1. 使用你喜欢的构建工具 (**Maven**|**Gradle**) 创建一个示例项目。
51+
2. 在项目中添加如下依赖:
5652
* [org.seleniumhq.selenium/selenium-grid](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-grid)
57-
3. Add your customized Node to the project.
58-
4. Build a jar of your project using your build tool.
59-
5. Now start the Node using the command:
53+
3. 将你的自定义 Node 添加到项目中。
54+
4. 使用构建工具构建项目 jar 包。
55+
5. 现在使用如下命令启动 Node
6056

6157
```bash
6258
java -jar selenium-server-4.6.0.jar \
6359
--ext custom_node-1.0-SNAPSHOT.jar node \
6460
--node-implementation org.seleniumhq.samples.DecoratedLoggingNode
6561
```
66-
Below is a sample that just prints some messages on to the console whenever there's an activity of interest (session created, session deleted, a webdriver command executed etc.,) on the Node.
67-
62+
下面是一个示例:当Node有相关活动(会话创建、会话删除、WebDriver 命令执行等)时,仅在控制台打印一些消息。
6863

6964
<details>
70-
<summary>Sample customized node</summary>
65+
<summary>自定义Node示例</summary>
7166

7267
```java
7368
package org.seleniumhq.samples;
@@ -239,21 +234,21 @@ public class DecoratedLoggingNode extends Node {
239234
```
240235
</details>
241236

242-
**_Foot Notes:_**
237+
**_注释:_**
243238

244-
In the above example, the line `Node node = LocalNodeFactory.create(config);` explicitly creates a `LocalNode`.
239+
在上述示例中,`Node node = LocalNodeFactory.create(config);` 这一行显式创建了一个 `LocalNode`
245240

246-
There are basically 2 types of *user facing implementations* of `org.openqa.selenium.grid.node.Node` available.
241+
`org.openqa.selenium.grid.node.Node` 主要有两种*面向用户的实现*
247242

248-
These classes are good starting points to learn how to build a custom Node and also to learn the internals of a Node.
243+
这些类是学习如何构建自定义 Node 以及了解 Node 内部机制的良好起点。
249244

250-
* `org.openqa.selenium.grid.node.local.LocalNode` - Used to represent a long running Node and is the default implementation that gets wired in when you start a `node`.
251-
* It can be created by calling `LocalNodeFactory.create(config);`, where:
252-
* `LocalNodeFactory` belongs to `org.openqa.selenium.grid.node.local`
253-
* `Config` belongs to `org.openqa.selenium.grid.config`
254-
* `org.openqa.selenium.grid.node.k8s.OneShotNode` - This is a special reference implementation wherein the Node gracefully shuts itself down after servicing one test session. This class is currently not available as part of any pre-built maven artifact.
255-
* You can refer to the source code [here](https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/grid/node/k8s/OneShotNode.java) to understand its internals.
256-
* To build it locally refer [here](https://github.com/SeleniumHQ/selenium/blob/trunk/deploys/k8s/README.md).
257-
* It can be created by calling `OneShotNode.create(config)`, where:
258-
* `OneShotNode` belongs to `org.openqa.selenium.grid.node.k8s`
259-
* `Config` belongs to `org.openqa.selenium.grid.config`
245+
* `org.openqa.selenium.grid.node.local.LocalNode` - 用于表示长时间运行的 Node,也是默认实现。启动 `node` 时会自动接入。
246+
* 可通过 `LocalNodeFactory.create(config);` 创建,其中:
247+
* `LocalNodeFactory` 属于 `org.openqa.selenium.grid.node.local`
248+
* `Config` 属于 `org.openqa.selenium.grid.config`
249+
* `org.openqa.selenium.grid.node.k8s.OneShotNode` - 这是一个特殊的参考实现,节点在服务完一个测试会话后会自动关闭。该类目前未包含在任何预构建的 maven 包中。
250+
* 你可以在 [这里](https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/grid/node/k8s/OneShotNode.java) 查看源码。
251+
* 参考 [这里](https://github.com/SeleniumHQ/selenium/blob/trunk/deploys/k8s/README.md) 了解本地构建方法。
252+
* 可通过 `OneShotNode.create(config)` 创建,其中:
253+
* `OneShotNode` 属于 `org.openqa.selenium.grid.node.k8s`
254+
* `Config` 属于 `org.openqa.selenium.grid.config`

website_and_docs/content/documentation/webdriver/elements/file_upload.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "File Upload"
33
linkTitle: "File Upload"
4-
weight: 1
4+
weight: 5
55
aliases: [
66
"/documentation/webdriver/additional_features/fileupload/"
77
]

website_and_docs/content/documentation/webdriver/elements/file_upload.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "File Upload"
33
linkTitle: "File Upload"
4-
weight: 1
4+
weight: 5
55
aliases: [
66
"/ja/documentation/webdriver/additional_features/fileupload/"
77
]

website_and_docs/content/documentation/webdriver/elements/file_upload.pt-br.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "File Upload"
33
linkTitle: "File Upload"
4-
weight: 1
4+
weight: 5
55
aliases: [
66
"/pt-br/documentation/webdriver/additional_features/fileupload/"
77
]

website_and_docs/content/documentation/webdriver/elements/file_upload.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "文件上传"
33
linkTitle: "文件上传"
4-
weight: 1
4+
weight: 5
55
aliases: [
66
"/zh-cn/documentation/webdriver/additional_features/fileupload/"
77
]

0 commit comments

Comments
 (0)