Skip to content

Commit

Permalink
i18n(zh-cn): Update testing.mdx (#8229)
Browse files Browse the repository at this point in the history
Co-authored-by: liruifengv <liruifeng1024@gmail.com>
  • Loading branch information
huyikai and liruifengv committed May 9, 2024
1 parent 135d273 commit 7f4025e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/content/docs/zh-cn/guides/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -225,23 +225,24 @@ Nightwatch.js 是一个测试自动化框架,它配备了一套强大的工具

你可以使用 [NightwatchJS VSCode Extension](https://marketplace.visualstudio.com/items?itemName=browserstackcom.nightwatch) 或以下的 CLI 步骤来运行测试:

<Steps>
1. 要运行所有测试,在终端中输入以下命令。你也可以选择包含文件名来只运行单个测试:

```sh
npx nightwatch test/index.js
```

2. 要查看完整的 HTML 测试报告,使用以下命令打开它:
此外,你可以使用 `--environment``-e` CLI 参数针对特定浏览器运行测试。如果你没有安装相关浏览器,Nightwatch 将尝试使用 [Selenium Manager](https://www.selenium.dev/blog/2022/introducing-selenium-manager/) 为你配置:

```sh
npx nightwatch test/index.ts --open
npx nightwatch test/index.ts -e firefox
```

3. 要对特定的浏览器运行测试,使用 `--environment``-e` CLI 参数。如果你没有安装相关的浏览器,Nightwatch 将尝试使用 [Selenium Manager](https://www.selenium.dev/blog/2022/introducing-selenium-manager/) 为你设置。
2. 要查看完整的 HTML 测试报告,使用以下命令打开它:

```sh
npx nightwatch test/index.ts -e firefox
npx nightwatch test/index.ts --open
```
</Steps>

:::tip
在你的生产代码上运行测试,以更接近你的实际、已部署的网站。
Expand Down Expand Up @@ -319,6 +320,7 @@ Playwright 是一个针对现代网络应用的端到端测试框架。使用 Ja

你可以同时运行单个测试或多个测试,测试一个或多个浏览器。默认情况下,你的测试结果将显示在终端中。或者,你可以打开 HTML Test Reporter 以显示完整的报告和筛选测试结果。

<Steps>
1. 若要使用命令行运行上面的测试示例,请使用 `test` 命令。可以选择,包含只运行单个测试的文件名:

```sh
Expand All @@ -330,6 +332,7 @@ Playwright 是一个针对现代网络应用的端到端测试框架。使用 Ja
```sh
npx playwright show-report
```
</Steps>

:::tip
针对生产代码运行测试,以更接近于实时部署的站点。
Expand Down

0 comments on commit 7f4025e

Please sign in to comment.