File tree 1 file changed +4
-4
lines changed 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
# 端对端测试
2
2
3
- electron-vue 使用 [ Spectron] ( http://electron.atom.io/spectron/ ) 和 [ Mocha] ( https://mochajs.org/ ) \( 与 [ Chai] ( http://chaijs.com/ ) \) 作为测试框架,进行端到端测试 。包括 ` expect ` 、` should ` 以及 ` assert ` 在内的 Mocha 和 Chai 的 API 在全局范围内可用。
3
+ electron-vue 使用 [ Spectron] ( http://electron.atom.io/spectron/ ) 和 [ Mocha] ( https://mochajs.org/ ) \( 与 [ Chai] ( http://chaijs.com/ ) \) 作为端到端测试的框架 。包括 ` expect ` 、` should ` 以及 ` assert ` 在内的 Mocha 和 Chai 的 API 在全局范围内可用。
4
4
5
5
### 运行测试
6
6
@@ -24,15 +24,15 @@ my-project
24
24
└─ └─ └─ utils.js
25
25
```
26
26
27
- ** 在大多数情况下,你可以忽略** ` index.js ` ** ,并专注于编写 ** ` specs/ ` ** 。**
27
+ ** 在大多数情况下,你可以忽略** ` index.js ` ** ,只专注于编写 ** ` specs/ ` ** 。**
28
28
29
29
#### ` specs/ `
30
30
31
31
这个目录里面是编写实际测试代码的地方。由于 ` babel-register ` 的强大功能,你可以完全依照 ES2015 进行编写。
32
32
33
33
#### ` index.js `
34
34
35
- 这是 Mocha 入口文件,并收集编写在 ` specs/ ` 内的所有测试代码用于测试。
35
+ 这是 Mocha 入口文件,并收集在 ` specs/ ` 内的所有测试代码用于测试。
36
36
37
37
#### ` utils.js `
38
38
@@ -44,4 +44,4 @@ Spectron 是使用 [ChromeDriver](https://sites.google.com/a/chromium.org/chrome
44
44
45
45
#### WebDriverIO 的使用
46
46
47
- 如 Spectron 的 [ 文档] ( https://github.com/electron/spectron#client ) 中所述,可以通过访问 ` this.app.client ` 来访问 [ WebDriverIO APIs] ( http://webdriver.io/api.html ) 。 由于 electron-vue 使用了 Mocha,` this ` 在 ` afterEach ` 、` beforeEach ` 和 ` it ` 之间共享。 因此,重要的是要注意 ,ES2015 的箭头函数不能在某些情况下使用,因为 ` this ` 的语境将被覆盖 \( [ 更多信息] ( https://mochajs.org/#arrow-functions ) \) 。
47
+ 如 Spectron 的 [ 文档] ( https://github.com/electron/spectron#client ) 中所述,可以通过访问 ` this.app.client ` 来访问 [ WebDriverIO APIs] ( http://webdriver.io/api.html ) 。 由于 electron-vue 使用了 Mocha,` this ` 在 ` afterEach ` 、` beforeEach ` 和 ` it ` 之间共享。 因此,值得注意的是 ,ES2015 的箭头函数不能在某些情况下使用,因为 ` this ` 的语境将被覆盖 \( [ 更多信息] ( https://mochajs.org/#arrow-functions ) \) 。
You can’t perform that action at this time.
0 commit comments