Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/appium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- master
pull_request:
branches:
- '**'

env:
CI: true
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/dtslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Typings tests

on:
push:
branches:
- master
pull_request:
branches:
- '**'

jobs:
test:
runs-on: ubuntu-18.04
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run def
- run: npm run dtslint
2 changes: 1 addition & 1 deletion docs/webapi/clearField.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ I.clearField('Email');
I.clearField('user[email]');
I.clearField('#email');
```
@param {string|object} editable field located by label|name|CSS|XPath|strict locator.
@param {LocatorOrString} editable field located by label|name|CSS|XPath|strict locator.
5 changes: 5 additions & 0 deletions docs/webapi/closeCurrentTab.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Close current tab.

```js
I.closeCurrentTab();
```
6 changes: 6 additions & 0 deletions docs/webapi/closeOtherTabs.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Close all tabs except for the current one.


```js
I.closeOtherTabs();
```
4 changes: 2 additions & 2 deletions docs/webapi/dragAndDrop.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Drag an item to a destination element.
I.dragAndDrop('#dragHandle', '#container');
```

@param {string|object} srcElement located by CSS|XPath|strict locator.
@param {string|object} destElement located by CSS|XPath|strict locator.
@param {LocatorOrString} srcElement located by CSS|XPath|strict locator.
@param {LocatorOrString} destElement located by CSS|XPath|strict locator.
7 changes: 7 additions & 0 deletions docs/webapi/grabAllWindowHandles.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Get all Window Handles.
Useful for referencing a specific handle when calling `I.switchToWindow(handle)`

```js
const windows = await I.grabAllWindowHandles();
```
@returns {Promise<string[]>}
2 changes: 1 addition & 1 deletion docs/webapi/grabBrowserLogs.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ let logs = await I.grabBrowserLogs();
console.log(JSON.stringify(logs))
```

@returns {Promise<Array<*>>} all browser logs
@returns {Promise<object[]>|undefined} all browser logs
2 changes: 1 addition & 1 deletion docs/webapi/grabCookie.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ assert(cookie.value, '123456');
```

@param {?string} [name=null] cookie name.
@returns {Promise<string>} attribute value
@returns {Promise<string>|Promise<string[]>} attribute value
6 changes: 6 additions & 0 deletions docs/webapi/grabCurrentWindowHandle.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Get the current Window Handle.
Useful for referencing it when calling `I.switchToWindow(handle)`
```js
const window = await I.grabCurrentWindowHandle();
```
@returns {Promise<string>}
6 changes: 3 additions & 3 deletions docs/webapi/grabElementBoundingRect.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ To get only one metric use second parameter:
const width = await I.grabElementBoundingRect('h3', 'width');
// width == 527
```
@param {string|object} locator element located by CSS|XPath|strict locator.
@param {string} elementSize x, y, width or height of the given element.
@returns {object} Element bounding rectangle
@param {LocatorOrString} locator element located by CSS|XPath|strict locator.
@param {string=} elementSize x, y, width or height of the given element.
@returns {Promise<DOMRect>|Promise<number>} Element bounding rectangle
2 changes: 1 addition & 1 deletion docs/webapi/grabNumberOfOpenTabs.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Resumes test execution, so **should be used inside async function with `await`**
let tabs = await I.grabNumberOfOpenTabs();
```

@returns {Promise<number>} number of open tabs
@returns {Promise<number>} number of open tabs
2 changes: 1 addition & 1 deletion docs/webapi/grabPageScrollPosition.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Resumes test execution, so **should be used inside an async function with `await
let { x, y } = await I.grabPageScrollPosition();
```

@returns {Promise<Object<string, *>>} scroll position
@returns {Promise<PageScrollPosition>} scroll position
5 changes: 5 additions & 0 deletions docs/webapi/grabPopupText.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Grab the text within the popup. If no popup is visible then it will return null.
```js
await I.grabPopupText();
```
@returns {Promise<string>}
5 changes: 5 additions & 0 deletions docs/webapi/openNewTab.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Open new tab and switch to it.

```js
I.openNewTab();
```
4 changes: 2 additions & 2 deletions docs/webapi/scrollIntoView.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ I.scrollIntoView('#submit', true);
I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
```

@param {string|object} locator located by CSS|XPath|strict locator.
@param {boolean|object} alignToTop (optional) or scrollIntoViewOptions (optional), see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
@param {LocatorOrString} locator located by CSS|XPath|strict locator.
@param {ScrollIntoViewOptions} scrollIntoViewOptions see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
7 changes: 7 additions & 0 deletions docs/webapi/seeTitleEquals.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Checks that title is equal to provided one.

```js
I.seeTitleEquals('Test title.');
```

@param {string} text value to check.
4 changes: 2 additions & 2 deletions docs/webapi/selectOption.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ Provide an array for the second argument to select multiple options.
```js
I.selectOption('Which OS do you use?', ['Android', 'iOS']);
```
@param {CodeceptJS.LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
@param {string|Array<*>} option visible text or value of option.
@param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
@param {string|Array<*>} option visible text or value of option.
2 changes: 1 addition & 1 deletion docs/webapi/setCookie.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ I.setCookie([
]);
```

@param {object|array} cookie a cookie object or array of cookie objects.
@param {Cookie|Array<Cookie>} cookie a cookie object or array of cookie objects.
2 changes: 1 addition & 1 deletion docs/webapi/setGeoLocation.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ I.setGeoLocation(121.21, 11.56, 10);

@param {number} latitude to set.
@param {number} longitude to set
@param {number} altitude (optional, null by default) to set
@param {number=} altitude (optional, null by default) to set
9 changes: 9 additions & 0 deletions docs/webapi/switchToNextTab.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Switch focus to a particular tab by its number. It waits tabs loading and then switch tab.

```js
I.switchToNextTab();
I.switchToNextTab(2);
```

@param {number} [num] (optional) number of tabs to switch forward, default: 1.
@param {number | null} [sec] (optional) time in seconds to wait.
9 changes: 9 additions & 0 deletions docs/webapi/switchToPreviousTab.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Switch focus to a particular tab by its number. It waits tabs loading and then switch tab.

```js
I.switchToPreviousTab();
I.switchToPreviousTab(2);
```

@param {number} [num] (optional) number of tabs to switch backward, default: 1.
@param {number?} [sec] (optional) time in seconds to wait.
4 changes: 2 additions & 2 deletions docs/webapi/waitForValue.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Waits for the specified value to be in value attribute.
I.waitForValue('//input', "GoodValue");
```

@param {string|object} field input field.
@param {LocatorOrString} field input field.
@param {string }value expected value.
@param {number} [sec=1] (optional, `1` by default) time in seconds to wait
@param {number} [sec=1] (optional, `1` by default) time in seconds to wait
4 changes: 2 additions & 2 deletions lib/command/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ module.exports = function (genPath, options) {
helperPaths[name] = require;
helperNames.push(name);
} else {
helperNames.push(`CodeceptJS.${name}`);
helperNames.push(name);
}
}

const supportObject = new Map();
supportObject.set('I', 'CodeceptJS.I');
supportObject.set('I', 'I');
for (const name in codecept.config.include) {
const includePath = codecept.config.include[name];
if (name === 'I' || name === translations.I) {
Expand Down
Loading