@@ -208,11 +208,11 @@ property which do not require Node integration.
208208
209209#### client
210210
211- Spectron uses [ WebdriverIO] ( http ://webdriver.io) and exposes the managed
211+ Spectron uses [ WebdriverIO] ( https ://webdriver.io) and exposes the managed
212212` client ` property on the created ` Application ` instances.
213213
214214The ` 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) .
216216
217217Several additional commands are provided specific to Electron.
218218
@@ -221,8 +221,10 @@ All the commands return a `Promise`.
221221So if you wanted to get the text of an element you would do:
222222
223223``` 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+ })
226228})
227229```
228230
@@ -239,9 +241,8 @@ API in your tests you would do:
239241
240242``` js
241243app .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)
245246```
246247
247248#### browserWindow
@@ -651,7 +652,7 @@ test.afterEach(t => {
651652 return t.context.app.stop();
652653});
653654
654- test(t => {
655+ test('opens a window', t => {
655656 return t.context.app.client.waitUntilWindowLoaded()
656657 .getWindowCount().then(count => {
657658 t.is(count, 1);
@@ -688,7 +689,7 @@ test.afterEach.always(async t => {
688689 await t.context.app.stop();
689690});
690691
691- test(async t => {
692+ test('example', async t => {
692693 const app = t.context.app;
693694 await app.client.waitUntilWindowLoaded();
694695
0 commit comments