@@ -208,11 +208,11 @@ property which do not require Node integration.
208
208
209
209
#### client
210
210
211
- Spectron uses [ WebdriverIO] ( http ://webdriver.io) and exposes the managed
211
+ Spectron uses [ WebdriverIO] ( https ://webdriver.io) and exposes the managed
212
212
` client ` property on the created ` Application ` instances.
213
213
214
214
The ` client ` API is WebdriverIO's ` browser ` object. Documentation can be found
215
- [ here] ( http ://webdriver.io/api.html ) .
215
+ [ here] ( https ://webdriver.io/docs/ api) .
216
216
217
217
Several additional commands are provided specific to Electron.
218
218
@@ -221,8 +221,10 @@ All the commands return a `Promise`.
221
221
So if you wanted to get the text of an element you would do:
222
222
223
223
``` js
224
- app .client .getText (' #error-alert' ).then (function (errorText ) {
225
- console .log (' The #error-alert text content is ' + errorText)
224
+ app .client .$ (' #error-alert' ).then (function (element ) {
225
+ element .getText ().then (function (errorText ) {
226
+ console .log (' The #error-alert text content is ' + errorText)
227
+ })
226
228
})
227
229
```
228
230
@@ -239,9 +241,8 @@ API in your tests you would do:
239
241
240
242
``` js
241
243
app .electron .clipboard .writeText (' pasta' )
242
- .electron .clipboard .readText ().then (function (clipboardText ) {
243
- console .log (' The clipboard text is ' + clipboardText)
244
- })
244
+ const clipboardText = app .electron .clipboard .readText ()
245
+ console .log (' The clipboard text is ' + clipboardText)
245
246
```
246
247
247
248
#### browserWindow
@@ -651,7 +652,7 @@ test.afterEach(t => {
651
652
return t.context.app.stop();
652
653
});
653
654
654
- test(t => {
655
+ test('opens a window', t => {
655
656
return t.context.app.client.waitUntilWindowLoaded()
656
657
.getWindowCount().then(count => {
657
658
t.is(count, 1);
@@ -688,7 +689,7 @@ test.afterEach.always(async t => {
688
689
await t.context.app.stop();
689
690
});
690
691
691
- test(async t => {
692
+ test('example', async t => {
692
693
const app = t.context.app;
693
694
await app.client.waitUntilWindowLoaded();
694
695
0 commit comments