Skip to content

Commit 283b789

Browse files
authored
Update dusk.md
1 parent 730d12f commit 283b789

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

dusk.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<a name="introduction"></a>
3030
## 简介
3131

32-
Laravel Dusk 为浏览器提供了丰富而简单易用的自动化测试 API。Dusk 并不要求你在你的机器中安装 JDK 或者 Selenium。Dusk 而是使用 [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/home)。不过,依然可以按照你自己的需要安装其他 Selenium 兼容的驱动引擎。
32+
Laravel Dusk 提供了富有表现力、简单易用的浏览器自动化以及相应的测试 API。Dusk 使用 [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/home),不再需要在你的机器中安装 JDK 或者 Selenium。不过,依然可以按照你自己的需要安装其他 Selenium 兼容的驱动引擎。
3333

3434
<a name="installation"></a>
3535
## 安装
@@ -43,7 +43,7 @@ Laravel Dusk 为浏览器提供了丰富而简单易用的自动化测试 API。
4343
use Laravel\Dusk\DuskServiceProvider;
4444

4545
/**
46-
* Register any application services.
46+
    * 在这里可用注册任何应用服务
4747
*
4848
* @return void
4949
*/
@@ -72,7 +72,7 @@ Dusk 默认使用 Google Chrome 和 [ChromeDriver](https://sites.google.com/a/ch
7272
打开你的 `tests/DuskTestCase.php` 文件,这个文件是你应用中最基础的 Dusk 测试用例。你可以在这个文件中移除 `startChromeDriver` 方法。这样 Dusk 就不会自动运行 ChromeDriver:
7373

7474
/**
75-
* Prepare for Dusk test execution.
75+
* Dusk 的测试做准备
7676
*
7777
* @beforeClass
7878
* @return void
@@ -85,7 +85,7 @@ Dusk 默认使用 Google Chrome 和 [ChromeDriver](https://sites.google.com/a/ch
8585
然后,你可以通过简单地修改 `driver` 方法来连接到你指定的 URL 和 端口。同时,你要修改传递给 WebDriver 的「desired capabilities」:
8686

8787
/**
88-
* Create the RemoteWebDriver instance.
88+
* 创建 `RemoteWebDriver` 实例
8989
*
9090
* @return \Facebook\WebDriver\Remote\RemoteWebDriver
9191
*/
@@ -122,7 +122,7 @@ Dusk 默认使用 Google Chrome 和 [ChromeDriver](https://sites.google.com/a/ch
122122
Dusk 默认会尝试自动运行 ChromeDriver。如果在你特定的系统中不能正常运行,你可以在运行 `dusk` 命令之前通过手动的方式来运行 ChromeDriver。如果你选择手动运行 ChromeDriver,你需要在你的 `tests/DuskTestCase.php` 文件中注释掉下面这行:
123123

124124
/**
125-
* Prepare for Dusk test execution.
125+
* Dusk 的测试做准备
126126
*
127127
* @beforeClass
128128
* @return void
@@ -135,7 +135,7 @@ Dusk 默认会尝试自动运行 ChromeDriver。如果在你特定的系统中
135135
另外,如果你是在非 9515 端口运行 ChromeDriver ,你需要在 `tests/DuskTestCase.php` 修改 `driver` 方法:
136136

137137
/**
138-
* Create the RemoteWebDriver instance.
138+
* 创建 `RemoteWebDriver` 实例
139139
*
140140
* @return \Facebook\WebDriver\Remote\RemoteWebDriver
141141
*/
@@ -172,7 +172,7 @@ Dusk 默认会尝试自动运行 ChromeDriver。如果在你特定的系统中
172172
use DatabaseMigrations;
173173

174174
/**
175-
* A basic browser test example.
175+
* 一个基本的浏览器测试示例
176176
*
177177
* @return void
178178
*/
@@ -231,7 +231,7 @@ Dusk 默认会尝试自动运行 ChromeDriver。如果在你特定的系统中
231231
<a name="clicking-links"></a>
232232
### 点击链接
233233

234-
你可以在你的浏览器实例中使用 `clickLink` 方法来模拟点击一个链接。`clickLink` 方法会点击传入的显示文本:
234+
你可以在你的浏览器实例中使用 `clickLink` 方法来模拟点击一个链接。`clickLink` 方法会点击传入的显示文本
235235

236236
$browser->clickLink($linkText);
237237

@@ -242,7 +242,7 @@ Dusk 默认会尝试自动运行 ChromeDriver。如果在你特定的系统中
242242

243243
#### 获取和设置值
244244

245-
Dusk 提供了几种方法让你和当前页面元素中的显示文本值和属性进行交互。举例来说,想获得某个指定选择器对应元素的 「值」,你可以使用 `value` 方法:
245+
Dusk 提供了几种方法让你和当前页面元素中的显示文本值和属性进行交互。举例来说,想获得某个指定选择器对应元素的 「值」,你可以使用 `value` 方法:
246246

247247
// 获取值...
248248
$value = $browser->value('selector');
@@ -448,7 +448,7 @@ Assertion | Description
448448
<a name="pages"></a>
449449
## 页面
450450

451-
有时候,测试有一些复杂的动作需要顺序执行。 这很容易让你的测试代码变得难读,并且难以理解。页面雨荨你定义语义化的动作行为,然后你可以在给定页面中使用单个方法。页面也允许你为你的应用或者单个页面定义简写的公共选择器。
451+
有时候,测试有一些复杂的动作需要顺序执行。 这很容易让你的测试代码变得难读,并且难以理解。页面允许你定义语义化的动作行为,然后你可以在给定页面中使用单个方法。页面也允许你为你的应用或者单个页面定义简写的公共选择器。
452452

453453
<a name="generating-pages"></a>
454454
### 创建页面
@@ -464,7 +464,7 @@ Assertion | Description
464464

465465
#### `url` 方法
466466

467-
`url` 方法应该返回表示页面 URL 的路径。 Dusk 将会在浏览器中使用这个 URL 来导航到具体页面
467+
`url` 方法应该返回表示页面 URL 的路径。 Dusk 将会在浏览器中使用这个 URL 来导航到具体页面
468468

469469
/**
470470
* 获得当前页面 URL
@@ -558,8 +558,8 @@ Assertion | Description
558558

559559
class Dashboard extends Page
560560
{
561-
// Other page methods...
562-
561+
       // 其他方法...
562+
563563
/**
564564
* 创建一个新的播放列表。
565565
*

0 commit comments

Comments
 (0)