Skip to content

Commit 4d9acf0

Browse files
authored
feat(ts): Add better tests for typescript (#2445)
* feat(ts): Add better tests for typescript * fix * fix * f * add more tests * add tests for helper * f * add tests * added methods * improve ts * improve typings * improve typings * remove appium jobs from PR * draft * fix * fix tests * add tests for all wdio methods * fix * fix tests * fix
1 parent 6d996b7 commit 4d9acf0

38 files changed

+772
-240
lines changed

.github/workflows/appium.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request:
8-
branches:
9-
- '**'
107

118
env:
129
CI: true

.github/workflows/dtslint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Typings tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-18.04
14+
strategy:
15+
matrix:
16+
node-version: [12.x]
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- run: npm install
24+
- run: npm run def
25+
- run: npm run dtslint

docs/webapi/clearField.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ I.clearField('Email');
55
I.clearField('user[email]');
66
I.clearField('#email');
77
```
8-
@param {string|object} editable field located by label|name|CSS|XPath|strict locator.
8+
@param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.

docs/webapi/closeCurrentTab.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Close current tab.
2+
3+
```js
4+
I.closeCurrentTab();
5+
```

docs/webapi/closeOtherTabs.mustache

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Close all tabs except for the current one.
2+
3+
4+
```js
5+
I.closeOtherTabs();
6+
```

docs/webapi/dragAndDrop.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Drag an item to a destination element.
44
I.dragAndDrop('#dragHandle', '#container');
55
```
66

7-
@param {string|object} srcElement located by CSS|XPath|strict locator.
8-
@param {string|object} destElement located by CSS|XPath|strict locator.
7+
@param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
8+
@param {LocatorOrString} destElement located by CSS|XPath|strict locator.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Get all Window Handles.
2+
Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
3+
4+
```js
5+
const windows = await I.grabAllWindowHandles();
6+
```
7+
@returns {Promise<string[]>}

docs/webapi/grabBrowserLogs.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ let logs = await I.grabBrowserLogs();
66
console.log(JSON.stringify(logs))
77
```
88

9-
@returns {Promise<Array<*>>} all browser logs
9+
@returns {Promise<object[]>|undefined} all browser logs

docs/webapi/grabCookie.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ assert(cookie.value, '123456');
88
```
99

1010
@param {?string} [name=null] cookie name.
11-
@returns {Promise<string>} attribute value
11+
@returns {Promise<string>|Promise<string[]>} attribute value
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Get the current Window Handle.
2+
Useful for referencing it when calling `I.switchToWindow(handle)`
3+
```js
4+
const window = await I.grabCurrentWindowHandle();
5+
```
6+
@returns {Promise<string>}

0 commit comments

Comments
 (0)