webdriverio 7.16.16 → 7.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/build/commands/browser/$$.d.ts +0 -50
- package/build/commands/browser/$$.d.ts.map +0 -1
- package/build/commands/browser/$$.js +0 -57
- package/build/commands/browser/$.d.ts +0 -77
- package/build/commands/browser/$.d.ts.map +0 -1
- package/build/commands/browser/$.js +0 -91
- package/build/commands/browser/addCommand.d.ts +0 -37
- package/build/commands/browser/addCommand.d.ts.map +0 -1
- package/build/commands/browser/addCommand.js +0 -37
- package/build/commands/browser/call.d.ts +0 -42
- package/build/commands/browser/call.d.ts.map +0 -1
- package/build/commands/browser/call.js +0 -49
- package/build/commands/browser/custom$$.d.ts +0 -26
- package/build/commands/browser/custom$$.d.ts.map +0 -1
- package/build/commands/browser/custom$$.js +0 -47
- package/build/commands/browser/custom$.d.ts +0 -25
- package/build/commands/browser/custom$.d.ts.map +0 -1
- package/build/commands/browser/custom$.js +0 -47
- package/build/commands/browser/debug.d.ts +0 -32
- package/build/commands/browser/debug.d.ts.map +0 -1
- package/build/commands/browser/debug.js +0 -108
- package/build/commands/browser/deleteCookies.d.ts +0 -45
- package/build/commands/browser/deleteCookies.d.ts.map +0 -1
- package/build/commands/browser/deleteCookies.js +0 -56
- package/build/commands/browser/execute.d.ts +0 -37
- package/build/commands/browser/execute.d.ts.map +0 -1
- package/build/commands/browser/execute.js +0 -55
- package/build/commands/browser/executeAsync.d.ts +0 -45
- package/build/commands/browser/executeAsync.d.ts.map +0 -1
- package/build/commands/browser/executeAsync.js +0 -63
- package/build/commands/browser/getCookies.d.ts +0 -34
- package/build/commands/browser/getCookies.d.ts.map +0 -1
- package/build/commands/browser/getCookies.js +0 -46
- package/build/commands/browser/getPuppeteer.d.ts +0 -38
- package/build/commands/browser/getPuppeteer.d.ts.map +0 -1
- package/build/commands/browser/getPuppeteer.js +0 -119
- package/build/commands/browser/getWindowSize.d.ts +0 -25
- package/build/commands/browser/getWindowSize.d.ts.map +0 -1
- package/build/commands/browser/getWindowSize.js +0 -30
- package/build/commands/browser/keys.d.ts +0 -28
- package/build/commands/browser/keys.d.ts.map +0 -1
- package/build/commands/browser/keys.js +0 -64
- package/build/commands/browser/mock.d.ts +0 -111
- package/build/commands/browser/mock.d.ts.map +0 -1
- package/build/commands/browser/mock.js +0 -164
- package/build/commands/browser/mockClearAll.d.ts +0 -28
- package/build/commands/browser/mockClearAll.d.ts.map +0 -1
- package/build/commands/browser/mockClearAll.js +0 -43
- package/build/commands/browser/mockRestoreAll.d.ts +0 -26
- package/build/commands/browser/mockRestoreAll.d.ts.map +0 -1
- package/build/commands/browser/mockRestoreAll.js +0 -41
- package/build/commands/browser/newWindow.d.ts +0 -41
- package/build/commands/browser/newWindow.d.ts.map +0 -1
- package/build/commands/browser/newWindow.js +0 -83
- package/build/commands/browser/overwriteCommand.d.ts +0 -32
- package/build/commands/browser/overwriteCommand.d.ts.map +0 -1
- package/build/commands/browser/overwriteCommand.js +0 -32
- package/build/commands/browser/pause.d.ts +0 -23
- package/build/commands/browser/pause.d.ts.map +0 -1
- package/build/commands/browser/pause.js +0 -27
- package/build/commands/browser/react$$.d.ts +0 -36
- package/build/commands/browser/react$$.d.ts.map +0 -1
- package/build/commands/browser/react$$.js +0 -51
- package/build/commands/browser/react$.d.ts +0 -46
- package/build/commands/browser/react$.d.ts.map +0 -1
- package/build/commands/browser/react$.js +0 -59
- package/build/commands/browser/reloadSession.d.ts +0 -23
- package/build/commands/browser/reloadSession.d.ts.map +0 -1
- package/build/commands/browser/reloadSession.js +0 -58
- package/build/commands/browser/savePDF.d.ts +0 -46
- package/build/commands/browser/savePDF.d.ts.map +0 -1
- package/build/commands/browser/savePDF.js +0 -51
- package/build/commands/browser/saveRecordingScreen.d.ts +0 -28
- package/build/commands/browser/saveRecordingScreen.d.ts.map +0 -1
- package/build/commands/browser/saveRecordingScreen.js +0 -47
- package/build/commands/browser/saveScreenshot.d.ts +0 -22
- package/build/commands/browser/saveScreenshot.d.ts.map +0 -1
- package/build/commands/browser/saveScreenshot.js +0 -41
- package/build/commands/browser/setCookies.d.ts +0 -57
- package/build/commands/browser/setCookies.d.ts.map +0 -1
- package/build/commands/browser/setCookies.js +0 -66
- package/build/commands/browser/setTimeout.d.ts +0 -31
- package/build/commands/browser/setTimeout.d.ts.map +0 -1
- package/build/commands/browser/setTimeout.js +0 -61
- package/build/commands/browser/setWindowSize.d.ts +0 -20
- package/build/commands/browser/setWindowSize.d.ts.map +0 -1
- package/build/commands/browser/setWindowSize.js +0 -43
- package/build/commands/browser/switchWindow.d.ts +0 -30
- package/build/commands/browser/switchWindow.d.ts.map +0 -1
- package/build/commands/browser/switchWindow.js +0 -73
- package/build/commands/browser/throttle.d.ts +0 -3
- package/build/commands/browser/throttle.d.ts.map +0 -1
- package/build/commands/browser/throttle.js +0 -144
- package/build/commands/browser/touchAction.d.ts +0 -61
- package/build/commands/browser/touchAction.d.ts.map +0 -1
- package/build/commands/browser/touchAction.js +0 -65
- package/build/commands/browser/uploadFile.d.ts +0 -32
- package/build/commands/browser/uploadFile.d.ts.map +0 -1
- package/build/commands/browser/uploadFile.js +0 -63
- package/build/commands/browser/url.d.ts +0 -38
- package/build/commands/browser/url.d.ts.map +0 -1
- package/build/commands/browser/url.js +0 -49
- package/build/commands/browser/waitUntil.d.ts +0 -44
- package/build/commands/browser/waitUntil.d.ts.map +0 -1
- package/build/commands/browser/waitUntil.js +0 -73
- package/build/commands/browser.d.ts +0 -70
- package/build/commands/browser.d.ts.map +0 -1
- package/build/commands/browser.js +0 -44
- package/build/commands/constant.d.ts +0 -19
- package/build/commands/constant.d.ts.map +0 -1
- package/build/commands/constant.js +0 -91
- package/build/commands/element/$$.d.ts +0 -46
- package/build/commands/element/$$.d.ts.map +0 -1
- package/build/commands/element/$$.js +0 -50
- package/build/commands/element/$.d.ts +0 -72
- package/build/commands/element/$.d.ts.map +0 -1
- package/build/commands/element/$.js +0 -76
- package/build/commands/element/addValue.d.ts +0 -33
- package/build/commands/element/addValue.d.ts.map +0 -1
- package/build/commands/element/addValue.js +0 -48
- package/build/commands/element/clearValue.d.ts +0 -28
- package/build/commands/element/clearValue.d.ts.map +0 -1
- package/build/commands/element/clearValue.js +0 -32
- package/build/commands/element/click.d.ts +0 -73
- package/build/commands/element/click.d.ts.map +0 -1
- package/build/commands/element/click.js +0 -134
- package/build/commands/element/custom$$.d.ts +0 -28
- package/build/commands/element/custom$$.d.ts.map +0 -1
- package/build/commands/element/custom$$.js +0 -57
- package/build/commands/element/custom$.d.ts +0 -27
- package/build/commands/element/custom$.d.ts.map +0 -1
- package/build/commands/element/custom$.js +0 -57
- package/build/commands/element/doubleClick.d.ts +0 -25
- package/build/commands/element/doubleClick.d.ts.map +0 -1
- package/build/commands/element/doubleClick.js +0 -51
- package/build/commands/element/dragAndDrop.d.ts +0 -41
- package/build/commands/element/dragAndDrop.d.ts.map +0 -1
- package/build/commands/element/dragAndDrop.js +0 -98
- package/build/commands/element/getAttribute.d.ts +0 -28
- package/build/commands/element/getAttribute.d.ts.map +0 -1
- package/build/commands/element/getAttribute.js +0 -32
- package/build/commands/element/getCSSProperty.d.ts +0 -71
- package/build/commands/element/getCSSProperty.d.ts.map +0 -1
- package/build/commands/element/getCSSProperty.js +0 -108
- package/build/commands/element/getComputedLabel.d.ts +0 -20
- package/build/commands/element/getComputedLabel.d.ts.map +0 -1
- package/build/commands/element/getComputedLabel.js +0 -24
- package/build/commands/element/getComputedRole.d.ts +0 -20
- package/build/commands/element/getComputedRole.d.ts.map +0 -1
- package/build/commands/element/getComputedRole.js +0 -24
- package/build/commands/element/getHTML.d.ts +0 -32
- package/build/commands/element/getHTML.d.ts.map +0 -1
- package/build/commands/element/getHTML.js +0 -46
- package/build/commands/element/getLocation.d.ts +0 -6
- package/build/commands/element/getLocation.d.ts.map +0 -1
- package/build/commands/element/getLocation.js +0 -46
- package/build/commands/element/getProperty.d.ts +0 -53
- package/build/commands/element/getProperty.d.ts.map +0 -1
- package/build/commands/element/getProperty.js +0 -31
- package/build/commands/element/getSize.d.ts +0 -6
- package/build/commands/element/getSize.d.ts.map +0 -1
- package/build/commands/element/getSize.js +0 -47
- package/build/commands/element/getTagName.d.ts +0 -25
- package/build/commands/element/getTagName.d.ts.map +0 -1
- package/build/commands/element/getTagName.js +0 -29
- package/build/commands/element/getText.d.ts +0 -42
- package/build/commands/element/getText.d.ts.map +0 -1
- package/build/commands/element/getText.js +0 -46
- package/build/commands/element/getValue.d.ts +0 -25
- package/build/commands/element/getValue.d.ts.map +0 -1
- package/build/commands/element/getValue.js +0 -33
- package/build/commands/element/isClickable.d.ts +0 -40
- package/build/commands/element/isClickable.d.ts.map +0 -1
- package/build/commands/element/isClickable.js +0 -57
- package/build/commands/element/isDisplayed.d.ts +0 -50
- package/build/commands/element/isDisplayed.d.ts.map +0 -1
- package/build/commands/element/isDisplayed.js +0 -85
- package/build/commands/element/isDisplayedInViewport.d.ts +0 -38
- package/build/commands/element/isDisplayedInViewport.d.ts.map +0 -1
- package/build/commands/element/isDisplayedInViewport.js +0 -55
- package/build/commands/element/isEnabled.d.ts +0 -34
- package/build/commands/element/isEnabled.d.ts.map +0 -1
- package/build/commands/element/isEnabled.js +0 -38
- package/build/commands/element/isEqual.d.ts +0 -24
- package/build/commands/element/isEqual.d.ts.map +0 -1
- package/build/commands/element/isEqual.js +0 -52
- package/build/commands/element/isExisting.d.ts +0 -49
- package/build/commands/element/isExisting.d.ts.map +0 -1
- package/build/commands/element/isExisting.js +0 -65
- package/build/commands/element/isFocused.d.ts +0 -28
- package/build/commands/element/isFocused.d.ts.map +0 -1
- package/build/commands/element/isFocused.js +0 -42
- package/build/commands/element/isSelected.d.ts +0 -31
- package/build/commands/element/isSelected.d.ts.map +0 -1
- package/build/commands/element/isSelected.js +0 -35
- package/build/commands/element/moveTo.d.ts +0 -21
- package/build/commands/element/moveTo.d.ts.map +0 -1
- package/build/commands/element/moveTo.js +0 -39
- package/build/commands/element/nextElement.d.ts +0 -25
- package/build/commands/element/nextElement.d.ts.map +0 -1
- package/build/commands/element/nextElement.js +0 -31
- package/build/commands/element/parentElement.d.ts +0 -25
- package/build/commands/element/parentElement.d.ts.map +0 -1
- package/build/commands/element/parentElement.js +0 -31
- package/build/commands/element/previousElement.d.ts +0 -25
- package/build/commands/element/previousElement.d.ts.map +0 -1
- package/build/commands/element/previousElement.js +0 -31
- package/build/commands/element/react$$.d.ts +0 -36
- package/build/commands/element/react$$.d.ts.map +0 -1
- package/build/commands/element/react$$.js +0 -51
- package/build/commands/element/react$.d.ts +0 -46
- package/build/commands/element/react$.d.ts.map +0 -1
- package/build/commands/element/react$.js +0 -59
- package/build/commands/element/saveScreenshot.d.ts +0 -21
- package/build/commands/element/saveScreenshot.d.ts.map +0 -1
- package/build/commands/element/saveScreenshot.js +0 -40
- package/build/commands/element/scrollIntoView.d.ts +0 -21
- package/build/commands/element/scrollIntoView.d.ts.map +0 -1
- package/build/commands/element/scrollIntoView.js +0 -31
- package/build/commands/element/selectByAttribute.d.ts +0 -37
- package/build/commands/element/selectByAttribute.d.ts.map +0 -1
- package/build/commands/element/selectByAttribute.js +0 -59
- package/build/commands/element/selectByIndex.d.ts +0 -31
- package/build/commands/element/selectByIndex.d.ts.map +0 -1
- package/build/commands/element/selectByIndex.js +0 -55
- package/build/commands/element/selectByVisibleText.d.ts +0 -31
- package/build/commands/element/selectByVisibleText.d.ts.map +0 -1
- package/build/commands/element/selectByVisibleText.js +0 -66
- package/build/commands/element/setValue.d.ts +0 -29
- package/build/commands/element/setValue.d.ts.map +0 -1
- package/build/commands/element/setValue.js +0 -33
- package/build/commands/element/shadow$$.d.ts +0 -22
- package/build/commands/element/shadow$$.d.ts.map +0 -1
- package/build/commands/element/shadow$$.js +0 -27
- package/build/commands/element/shadow$.d.ts +0 -22
- package/build/commands/element/shadow$.d.ts.map +0 -1
- package/build/commands/element/shadow$.js +0 -27
- package/build/commands/element/touchAction.d.ts +0 -54
- package/build/commands/element/touchAction.d.ts.map +0 -1
- package/build/commands/element/touchAction.js +0 -58
- package/build/commands/element/waitForClickable.d.ts +0 -34
- package/build/commands/element/waitForClickable.d.ts.map +0 -1
- package/build/commands/element/waitForClickable.js +0 -37
- package/build/commands/element/waitForDisplayed.d.ts +0 -44
- package/build/commands/element/waitForDisplayed.d.ts.map +0 -1
- package/build/commands/element/waitForDisplayed.js +0 -47
- package/build/commands/element/waitForEnabled.d.ts +0 -46
- package/build/commands/element/waitForEnabled.d.ts.map +0 -1
- package/build/commands/element/waitForEnabled.js +0 -55
- package/build/commands/element/waitForExist.d.ts +0 -46
- package/build/commands/element/waitForExist.d.ts.map +0 -1
- package/build/commands/element/waitForExist.js +0 -49
- package/build/commands/element/waitUntil.d.ts +0 -49
- package/build/commands/element/waitUntil.d.ts.map +0 -1
- package/build/commands/element/waitUntil.js +0 -53
- package/build/commands/element.d.ts +0 -100
- package/build/commands/element.d.ts.map +0 -1
- package/build/commands/element.js +0 -63
- package/build/commands/mock/abort.d.ts +0 -19
- package/build/commands/mock/abort.d.ts.map +0 -1
- package/build/commands/mock/abort.js +0 -20
- package/build/commands/mock/abortOnce.d.ts +0 -27
- package/build/commands/mock/abortOnce.d.ts.map +0 -1
- package/build/commands/mock/abortOnce.js +0 -28
- package/build/commands/mock/clear.d.ts +0 -18
- package/build/commands/mock/clear.d.ts.map +0 -1
- package/build/commands/mock/clear.js +0 -19
- package/build/commands/mock/respond.d.ts +0 -54
- package/build/commands/mock/respond.d.ts.map +0 -1
- package/build/commands/mock/respond.js +0 -55
- package/build/commands/mock/respondOnce.d.ts +0 -55
- package/build/commands/mock/respondOnce.d.ts.map +0 -1
- package/build/commands/mock/respondOnce.js +0 -56
- package/build/commands/mock/restore.d.ts +0 -18
- package/build/commands/mock/restore.d.ts.map +0 -1
- package/build/commands/mock/restore.js +0 -19
- package/build/constants.d.ts +0 -14
- package/build/constants.d.ts.map +0 -1
- package/build/constants.js +0 -286
- package/build/index.d.ts +0 -45
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -171
- package/build/middlewares.d.ts +0 -12
- package/build/middlewares.d.ts.map +0 -1
- package/build/middlewares.js +0 -65
- package/build/multiremote.d.ts +0 -71
- package/build/multiremote.d.ts.map +0 -1
- package/build/multiremote.js +0 -160
- package/build/protocol-stub.d.ts +0 -16
- package/build/protocol-stub.d.ts.map +0 -1
- package/build/protocol-stub.js +0 -77
- package/build/scripts/getHTML.d.ts +0 -9
- package/build/scripts/getHTML.d.ts.map +0 -1
- package/build/scripts/getHTML.js +0 -13
- package/build/scripts/getProperty.d.ts +0 -43
- package/build/scripts/getProperty.d.ts.map +0 -1
- package/build/scripts/getProperty.js +0 -12
- package/build/scripts/isElementClickable.d.ts +0 -7
- package/build/scripts/isElementClickable.d.ts.map +0 -1
- package/build/scripts/isElementClickable.js +0 -121
- package/build/scripts/isElementDisplayed.d.ts +0 -7
- package/build/scripts/isElementDisplayed.d.ts.map +0 -1
- package/build/scripts/isElementDisplayed.js +0 -216
- package/build/scripts/isElementInViewport.d.ts +0 -10
- package/build/scripts/isElementInViewport.d.ts.map +0 -1
- package/build/scripts/isElementInViewport.js +0 -22
- package/build/scripts/isFocused.d.ts +0 -7
- package/build/scripts/isFocused.d.ts.map +0 -1
- package/build/scripts/isFocused.js +0 -11
- package/build/scripts/newWindow.d.ts +0 -10
- package/build/scripts/newWindow.d.ts.map +0 -1
- package/build/scripts/newWindow.js +0 -14
- package/build/scripts/resq.d.ts +0 -6
- package/build/scripts/resq.d.ts.map +0 -1
- package/build/scripts/resq.js +0 -58
- package/build/scripts/shadowFnFactory.d.ts +0 -2
- package/build/scripts/shadowFnFactory.d.ts.map +0 -1
- package/build/scripts/shadowFnFactory.js +0 -17
- package/build/types.d.ts +0 -402
- package/build/types.d.ts.map +0 -1
- package/build/types.js +0 -2
- package/build/utils/SevereServiceError.d.ts +0 -7
- package/build/utils/SevereServiceError.d.ts.map +0 -1
- package/build/utils/SevereServiceError.js +0 -12
- package/build/utils/Timer.d.ts +0 -33
- package/build/utils/Timer.d.ts.map +0 -1
- package/build/utils/Timer.js +0 -126
- package/build/utils/detectBackend.d.ts +0 -23
- package/build/utils/detectBackend.d.ts.map +0 -1
- package/build/utils/detectBackend.js +0 -119
- package/build/utils/findStrategy.d.ts +0 -10
- package/build/utils/findStrategy.d.ts.map +0 -1
- package/build/utils/findStrategy.js +0 -267
- package/build/utils/getElementObject.d.ts +0 -17
- package/build/utils/getElementObject.d.ts.map +0 -1
- package/build/utils/getElementObject.js +0 -107
- package/build/utils/implicitWait.d.ts +0 -7
- package/build/utils/implicitWait.d.ts.map +0 -1
- package/build/utils/implicitWait.js +0 -39
- package/build/utils/index.d.ts +0 -102
- package/build/utils/index.d.ts.map +0 -1
- package/build/utils/index.js +0 -543
- package/build/utils/interception/devtools.d.ts +0 -61
- package/build/utils/interception/devtools.d.ts.map +0 -1
- package/build/utils/interception/devtools.js +0 -247
- package/build/utils/interception/index.d.ts +0 -26
- package/build/utils/interception/index.d.ts.map +0 -1
- package/build/utils/interception/index.js +0 -49
- package/build/utils/interception/types.d.ts +0 -94
- package/build/utils/interception/types.d.ts.map +0 -1
- package/build/utils/interception/types.js +0 -2
- package/build/utils/interception/webdriver.d.ts +0 -48
- package/build/utils/interception/webdriver.d.ts.map +0 -1
- package/build/utils/interception/webdriver.js +0 -75
- package/build/utils/refetchElement.d.ts +0 -6
- package/build/utils/refetchElement.d.ts.map +0 -1
- package/build/utils/refetchElement.js +0 -32
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Get a css property from a DOM-element selected by given selector. The return value
|
|
4
|
-
* is formatted to be testable. Colors gets parsed via [rgb2hex](https://www.npmjs.org/package/rgb2hex)
|
|
5
|
-
* and all other properties get parsed via [css-value](https://www.npmjs.org/package/css-value).
|
|
6
|
-
*
|
|
7
|
-
* :::info
|
|
8
|
-
*
|
|
9
|
-
* Note that shorthand CSS properties (e.g. `background`, `font`, `border`, `margin`,
|
|
10
|
-
* `padding`, `list-style`, `outline`, `pause`, `cue`) will be expanded to fetch all longhand
|
|
11
|
-
* properties resulting in multiple WebDriver calls. If you are interested in a specific
|
|
12
|
-
* longhand property it is recommended to query for that instead.
|
|
13
|
-
*
|
|
14
|
-
* :::
|
|
15
|
-
*
|
|
16
|
-
* <example>
|
|
17
|
-
:example.html
|
|
18
|
-
<label id="myLabel" for="input" style="color: #0088cc; font-family: helvetica, arial, freesans, clean, sans-serif, width: 100px">Some Label</label>
|
|
19
|
-
:getCSSProperty.js
|
|
20
|
-
it('should demonstrate the getCSSProperty command', async () => {
|
|
21
|
-
const elem = await $('#myLabel')
|
|
22
|
-
const color = await elem.getCSSProperty('color')
|
|
23
|
-
console.log(color)
|
|
24
|
-
// outputs the following:
|
|
25
|
-
// {
|
|
26
|
-
// property: 'color',
|
|
27
|
-
// value: 'rgba(0, 136, 204, 1)',
|
|
28
|
-
// parsed: {
|
|
29
|
-
// hex: '#0088cc',
|
|
30
|
-
// alpha: 1,
|
|
31
|
-
// type: 'color',
|
|
32
|
-
// rgba: 'rgba(0, 136, 204, 1)'
|
|
33
|
-
// }
|
|
34
|
-
// }
|
|
35
|
-
|
|
36
|
-
const font = await elem.getCSSProperty('font-family')
|
|
37
|
-
console.log(font)
|
|
38
|
-
// outputs the following:
|
|
39
|
-
// {
|
|
40
|
-
// property: 'font-family',
|
|
41
|
-
// value: 'helvetica',
|
|
42
|
-
// parsed: {
|
|
43
|
-
// value: [ 'helvetica', 'arial', 'freesans', 'clean', 'sans-serif' ],
|
|
44
|
-
// type: 'font',
|
|
45
|
-
// string: 'helvetica, arial, freesans, clean, sans-serif'
|
|
46
|
-
// }
|
|
47
|
-
// }
|
|
48
|
-
|
|
49
|
-
var width = await elem.getCSSProperty('width')
|
|
50
|
-
console.log(width)
|
|
51
|
-
// outputs the following:
|
|
52
|
-
// {
|
|
53
|
-
// property: 'width',
|
|
54
|
-
// value: '100px',
|
|
55
|
-
// parsed: {
|
|
56
|
-
// type: 'number',
|
|
57
|
-
// string: '100px',
|
|
58
|
-
// unit: 'px',
|
|
59
|
-
// value: 100
|
|
60
|
-
// }
|
|
61
|
-
// }
|
|
62
|
-
})
|
|
63
|
-
* </example>
|
|
64
|
-
*
|
|
65
|
-
* @alias element.getCSSProperty
|
|
66
|
-
* @param {String} cssProperty css property name
|
|
67
|
-
* @return {CSSProperty} The specified css of the element
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
export default function getCSSProperty(this: WebdriverIO.Element, cssProperty: string): Promise<import("../..").ParsedCSSValue>;
|
|
71
|
-
//# sourceMappingURL=getCSSProperty.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCSSProperty.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getCSSProperty.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,wBAA8B,cAAc,CACxC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,WAAW,EAAE,MAAM,2CAsCtB"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const css_shorthand_properties_1 = __importDefault(require("css-shorthand-properties"));
|
|
7
|
-
const utils_1 = require("../../utils");
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* Get a css property from a DOM-element selected by given selector. The return value
|
|
11
|
-
* is formatted to be testable. Colors gets parsed via [rgb2hex](https://www.npmjs.org/package/rgb2hex)
|
|
12
|
-
* and all other properties get parsed via [css-value](https://www.npmjs.org/package/css-value).
|
|
13
|
-
*
|
|
14
|
-
* :::info
|
|
15
|
-
*
|
|
16
|
-
* Note that shorthand CSS properties (e.g. `background`, `font`, `border`, `margin`,
|
|
17
|
-
* `padding`, `list-style`, `outline`, `pause`, `cue`) will be expanded to fetch all longhand
|
|
18
|
-
* properties resulting in multiple WebDriver calls. If you are interested in a specific
|
|
19
|
-
* longhand property it is recommended to query for that instead.
|
|
20
|
-
*
|
|
21
|
-
* :::
|
|
22
|
-
*
|
|
23
|
-
* <example>
|
|
24
|
-
:example.html
|
|
25
|
-
<label id="myLabel" for="input" style="color: #0088cc; font-family: helvetica, arial, freesans, clean, sans-serif, width: 100px">Some Label</label>
|
|
26
|
-
:getCSSProperty.js
|
|
27
|
-
it('should demonstrate the getCSSProperty command', async () => {
|
|
28
|
-
const elem = await $('#myLabel')
|
|
29
|
-
const color = await elem.getCSSProperty('color')
|
|
30
|
-
console.log(color)
|
|
31
|
-
// outputs the following:
|
|
32
|
-
// {
|
|
33
|
-
// property: 'color',
|
|
34
|
-
// value: 'rgba(0, 136, 204, 1)',
|
|
35
|
-
// parsed: {
|
|
36
|
-
// hex: '#0088cc',
|
|
37
|
-
// alpha: 1,
|
|
38
|
-
// type: 'color',
|
|
39
|
-
// rgba: 'rgba(0, 136, 204, 1)'
|
|
40
|
-
// }
|
|
41
|
-
// }
|
|
42
|
-
|
|
43
|
-
const font = await elem.getCSSProperty('font-family')
|
|
44
|
-
console.log(font)
|
|
45
|
-
// outputs the following:
|
|
46
|
-
// {
|
|
47
|
-
// property: 'font-family',
|
|
48
|
-
// value: 'helvetica',
|
|
49
|
-
// parsed: {
|
|
50
|
-
// value: [ 'helvetica', 'arial', 'freesans', 'clean', 'sans-serif' ],
|
|
51
|
-
// type: 'font',
|
|
52
|
-
// string: 'helvetica, arial, freesans, clean, sans-serif'
|
|
53
|
-
// }
|
|
54
|
-
// }
|
|
55
|
-
|
|
56
|
-
var width = await elem.getCSSProperty('width')
|
|
57
|
-
console.log(width)
|
|
58
|
-
// outputs the following:
|
|
59
|
-
// {
|
|
60
|
-
// property: 'width',
|
|
61
|
-
// value: '100px',
|
|
62
|
-
// parsed: {
|
|
63
|
-
// type: 'number',
|
|
64
|
-
// string: '100px',
|
|
65
|
-
// unit: 'px',
|
|
66
|
-
// value: 100
|
|
67
|
-
// }
|
|
68
|
-
// }
|
|
69
|
-
})
|
|
70
|
-
* </example>
|
|
71
|
-
*
|
|
72
|
-
* @alias element.getCSSProperty
|
|
73
|
-
* @param {String} cssProperty css property name
|
|
74
|
-
* @return {CSSProperty} The specified css of the element
|
|
75
|
-
*
|
|
76
|
-
*/
|
|
77
|
-
async function getCSSProperty(cssProperty) {
|
|
78
|
-
/**
|
|
79
|
-
* Getting the css value of a shorthand property results in different results
|
|
80
|
-
* given that the behavior of `getComputedStyle` is not defined in this case.
|
|
81
|
-
* Therefore if we don't deal with a shorthand property run `getElementCSSValue`
|
|
82
|
-
* otherwise expand it and run the command for each longhand property.
|
|
83
|
-
*/
|
|
84
|
-
if (!css_shorthand_properties_1.default.isShorthand(cssProperty)) {
|
|
85
|
-
const cssValue = await this.getElementCSSValue(this.elementId, cssProperty);
|
|
86
|
-
return (0, utils_1.parseCSS)(cssValue, cssProperty);
|
|
87
|
-
}
|
|
88
|
-
const properties = css_shorthand_properties_1.default.expand(cssProperty);
|
|
89
|
-
let cssValues = await Promise.all(properties.map((prop) => this.getElementCSSValue(this.elementId, prop)));
|
|
90
|
-
/**
|
|
91
|
-
* merge equal symmetrical values
|
|
92
|
-
* - e.g. `36px 10px 36px 10px` to `36px 10px`
|
|
93
|
-
* - or `0px 0px 0px 0px` to `0px`
|
|
94
|
-
*/
|
|
95
|
-
while ((cssValues.length % 2) === 0) {
|
|
96
|
-
const mergedValues = [
|
|
97
|
-
cssValues.slice(0, cssValues.length / 2).join(' '),
|
|
98
|
-
cssValues.slice(cssValues.length / 2).join(' ')
|
|
99
|
-
];
|
|
100
|
-
const hasEqualProperties = mergedValues.every((v) => v === mergedValues[0]);
|
|
101
|
-
if (!hasEqualProperties) {
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
cssValues = cssValues.slice(0, cssValues.length / 2);
|
|
105
|
-
}
|
|
106
|
-
return (0, utils_1.parseCSS)(cssValues.join(' '), cssProperty);
|
|
107
|
-
}
|
|
108
|
-
exports.default = getCSSProperty;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Get the computed WAI-ARIA label of an element.
|
|
4
|
-
*
|
|
5
|
-
* <example>
|
|
6
|
-
:getComputedLabel.js
|
|
7
|
-
it('should demonstrate the getComputedLabel command', async () => {
|
|
8
|
-
await browser.url('https://www.google.com/ncr')
|
|
9
|
-
const elem = await $('*[name="q"]');
|
|
10
|
-
console.log(await elem.getComputedLabel()); // outputs: "Search"
|
|
11
|
-
})
|
|
12
|
-
* </example>
|
|
13
|
-
*
|
|
14
|
-
* @alias element.getComputedLabel
|
|
15
|
-
* @return {String} the computed WAI-ARIA label
|
|
16
|
-
* @type property
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
export default function getComputedLabel(this: WebdriverIO.Element): Promise<string>;
|
|
20
|
-
//# sourceMappingURL=getComputedLabel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getComputedLabel.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getComputedLabel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,mBAElE"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* Get the computed WAI-ARIA label of an element.
|
|
6
|
-
*
|
|
7
|
-
* <example>
|
|
8
|
-
:getComputedLabel.js
|
|
9
|
-
it('should demonstrate the getComputedLabel command', async () => {
|
|
10
|
-
await browser.url('https://www.google.com/ncr')
|
|
11
|
-
const elem = await $('*[name="q"]');
|
|
12
|
-
console.log(await elem.getComputedLabel()); // outputs: "Search"
|
|
13
|
-
})
|
|
14
|
-
* </example>
|
|
15
|
-
*
|
|
16
|
-
* @alias element.getComputedLabel
|
|
17
|
-
* @return {String} the computed WAI-ARIA label
|
|
18
|
-
* @type property
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
function getComputedLabel() {
|
|
22
|
-
return this.getElementComputedLabel(this.elementId);
|
|
23
|
-
}
|
|
24
|
-
exports.default = getComputedLabel;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Get the computed WAI-ARIA label of an element.
|
|
4
|
-
*
|
|
5
|
-
* <example>
|
|
6
|
-
:getComputedRole.js
|
|
7
|
-
it('should demonstrate the getComputedRole command', async () => {
|
|
8
|
-
await browser.url('https://www.google.com/ncr')
|
|
9
|
-
const elem = await $('*[name="q"]');
|
|
10
|
-
console.log(await elem.getComputedRole()); // outputs: "combobox"
|
|
11
|
-
})
|
|
12
|
-
* </example>
|
|
13
|
-
*
|
|
14
|
-
* @alias element.getComputedRole
|
|
15
|
-
* @return {String} the computed WAI-ARIA label
|
|
16
|
-
* @type property
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
export default function getComputedRole(this: WebdriverIO.Element): Promise<string>;
|
|
20
|
-
//# sourceMappingURL=getComputedRole.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getComputedRole.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getComputedRole.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,mBAEjE"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* Get the computed WAI-ARIA label of an element.
|
|
6
|
-
*
|
|
7
|
-
* <example>
|
|
8
|
-
:getComputedRole.js
|
|
9
|
-
it('should demonstrate the getComputedRole command', async () => {
|
|
10
|
-
await browser.url('https://www.google.com/ncr')
|
|
11
|
-
const elem = await $('*[name="q"]');
|
|
12
|
-
console.log(await elem.getComputedRole()); // outputs: "combobox"
|
|
13
|
-
})
|
|
14
|
-
* </example>
|
|
15
|
-
*
|
|
16
|
-
* @alias element.getComputedRole
|
|
17
|
-
* @return {String} the computed WAI-ARIA label
|
|
18
|
-
* @type property
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
function getComputedRole() {
|
|
22
|
-
return this.getElementComputedRole(this.elementId);
|
|
23
|
-
}
|
|
24
|
-
exports.default = getComputedRole;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Get source code of specified DOM element by selector.
|
|
4
|
-
*
|
|
5
|
-
* <example>
|
|
6
|
-
:index.html
|
|
7
|
-
<div id="test">
|
|
8
|
-
<span>Lorem ipsum dolor amet</span>
|
|
9
|
-
</div>
|
|
10
|
-
:getHTML.js
|
|
11
|
-
it('should get html for certain elements', async () => {
|
|
12
|
-
var outerHTML = await $('#test').getHTML();
|
|
13
|
-
console.log(outerHTML);
|
|
14
|
-
// outputs:
|
|
15
|
-
// "<div id="test"><span>Lorem ipsum dolor amet</span></div>"
|
|
16
|
-
|
|
17
|
-
var innerHTML = await $('#test').getHTML(false);
|
|
18
|
-
console.log(innerHTML);
|
|
19
|
-
// outputs:
|
|
20
|
-
// "<span>Lorem ipsum dolor amet</span>"
|
|
21
|
-
});
|
|
22
|
-
* </example>
|
|
23
|
-
*
|
|
24
|
-
* @alias element.getHTML
|
|
25
|
-
* @param {Boolean=} includeSelectorTag if true it includes the selector element tag (default: true)
|
|
26
|
-
* @return {String} the HTML of the specified element
|
|
27
|
-
* @uses action/selectorExecute
|
|
28
|
-
* @type property
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
export default function getHTML(this: WebdriverIO.Element, includeSelectorTag?: boolean): Promise<string>;
|
|
32
|
-
//# sourceMappingURL=getHTML.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getHTML.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getHTML.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAC3B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,kBAAkB,UAAO,mBAO5B"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const constants_1 = require("../../constants");
|
|
7
|
-
const utils_1 = require("../../utils");
|
|
8
|
-
const getHTML_1 = __importDefault(require("../../scripts/getHTML"));
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* Get source code of specified DOM element by selector.
|
|
12
|
-
*
|
|
13
|
-
* <example>
|
|
14
|
-
:index.html
|
|
15
|
-
<div id="test">
|
|
16
|
-
<span>Lorem ipsum dolor amet</span>
|
|
17
|
-
</div>
|
|
18
|
-
:getHTML.js
|
|
19
|
-
it('should get html for certain elements', async () => {
|
|
20
|
-
var outerHTML = await $('#test').getHTML();
|
|
21
|
-
console.log(outerHTML);
|
|
22
|
-
// outputs:
|
|
23
|
-
// "<div id="test"><span>Lorem ipsum dolor amet</span></div>"
|
|
24
|
-
|
|
25
|
-
var innerHTML = await $('#test').getHTML(false);
|
|
26
|
-
console.log(innerHTML);
|
|
27
|
-
// outputs:
|
|
28
|
-
// "<span>Lorem ipsum dolor amet</span>"
|
|
29
|
-
});
|
|
30
|
-
* </example>
|
|
31
|
-
*
|
|
32
|
-
* @alias element.getHTML
|
|
33
|
-
* @param {Boolean=} includeSelectorTag if true it includes the selector element tag (default: true)
|
|
34
|
-
* @return {String} the HTML of the specified element
|
|
35
|
-
* @uses action/selectorExecute
|
|
36
|
-
* @type property
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
function getHTML(includeSelectorTag = true) {
|
|
40
|
-
const browser = (0, utils_1.getBrowserObject)(this);
|
|
41
|
-
return browser.execute(getHTML_1.default, {
|
|
42
|
-
[constants_1.ELEMENT_KEY]: this.elementId,
|
|
43
|
-
ELEMENT: this.elementId // jsonwp compatible
|
|
44
|
-
}, includeSelectorTag);
|
|
45
|
-
}
|
|
46
|
-
exports.default = getHTML;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { RectReturn } from '@wdio/protocols';
|
|
2
|
-
export declare type Location = Pick<RectReturn, 'x' | 'y'>;
|
|
3
|
-
declare function getLocation(this: WebdriverIO.Element): Promise<Location>;
|
|
4
|
-
declare function getLocation(this: WebdriverIO.Element, prop: keyof Location): Promise<number>;
|
|
5
|
-
export default getLocation;
|
|
6
|
-
//# sourceMappingURL=getLocation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLocation.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getLocation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAGjD,oBAAY,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC;AAEnD,iBAAS,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEnE,iBAAS,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAkDvF,eAAe,WAAW,CAAA"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const utils_1 = require("../../utils");
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* Determine an element’s location on the page. The point (0, 0) refers to
|
|
7
|
-
* the upper-left corner of the page.
|
|
8
|
-
*
|
|
9
|
-
* <example>
|
|
10
|
-
:getLocation.js
|
|
11
|
-
it('should demonstrate the getLocation function', async () => {
|
|
12
|
-
await browser.url('http://github.com');
|
|
13
|
-
const logo = await $('.octicon-mark-github')
|
|
14
|
-
const location = await logo.getLocation();
|
|
15
|
-
console.log(location); // outputs: { x: 150, y: 20 }
|
|
16
|
-
|
|
17
|
-
const xLocation = await logo.getLocation('x')
|
|
18
|
-
console.log(xLocation); // outputs: 150
|
|
19
|
-
|
|
20
|
-
const yLocation = await logo.getLocation('y')
|
|
21
|
-
console.log(yLocation); // outputs: 20
|
|
22
|
-
});
|
|
23
|
-
* </example>
|
|
24
|
-
*
|
|
25
|
-
* @alias element.getLocation
|
|
26
|
-
* @param {String} prop can be "x" or "y" to get a result value directly for easier assertions
|
|
27
|
-
* @return {Object|Number} The X and Y coordinates for the element on the page (`{x:number, y:number}`)
|
|
28
|
-
* @uses protocol/elementIdLocation
|
|
29
|
-
* @type property
|
|
30
|
-
*/
|
|
31
|
-
async function getLocation(prop) {
|
|
32
|
-
let location = {};
|
|
33
|
-
if (this.isW3C) {
|
|
34
|
-
location = await (0, utils_1.getElementRect)(this);
|
|
35
|
-
delete location.width;
|
|
36
|
-
delete location.height;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
location = await this.getElementLocation(this.elementId);
|
|
40
|
-
}
|
|
41
|
-
if (prop === 'x' || prop === 'y') {
|
|
42
|
-
return location[prop];
|
|
43
|
-
}
|
|
44
|
-
return location;
|
|
45
|
-
}
|
|
46
|
-
exports.default = getLocation;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Get Element Property command will return the result of getting a property of an element.
|
|
3
|
-
*
|
|
4
|
-
* <example>
|
|
5
|
-
:getProperty.js
|
|
6
|
-
it('should demonstrate the getProperty command', async () => {
|
|
7
|
-
var elem = await $('body')
|
|
8
|
-
var tag = await elem.getProperty('tagName')
|
|
9
|
-
console.log(tag) // outputs: "BODY"
|
|
10
|
-
})
|
|
11
|
-
* </example>
|
|
12
|
-
*
|
|
13
|
-
* @alias element.getProperty
|
|
14
|
-
* @param {String} property name of the element property
|
|
15
|
-
* @return {Object|String|Boolean|Number|null} the value of the property of the selected element
|
|
16
|
-
*/
|
|
17
|
-
export default function getProperty(this: WebdriverIO.Element, property: string): Promise<string | number | boolean | HTMLElement | Element | ChildNode | ParentNode | (() => DOMRect) | Document | ((event: Event) => boolean) | ((this: GlobalEventHandlers, ev: UIEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: FocusEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | OnErrorEventHandler | ((this: GlobalEventHandlers, ev: FocusEvent) => any) | ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: UIEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: WheelEvent) => any) | (() => ElementInternals) | (() => void) | {
|
|
18
|
-
<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
19
|
-
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
20
|
-
} | {
|
|
21
|
-
<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
|
|
22
|
-
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
23
|
-
} | NamedNodeMap | DOMTokenList | ((this: Element, ev: Event) => any) | ((this: Element, ev: Event) => any) | ShadowRoot | ((init: ShadowRootInit) => ShadowRoot) | {
|
|
24
|
-
<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
|
|
25
|
-
<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
|
|
26
|
-
<E extends Element = Element>(selectors: string): E | null;
|
|
27
|
-
} | ((qualifiedName: string) => string | null) | ((namespace: string | null, localName: string) => string | null) | (() => string[]) | ((qualifiedName: string) => Attr | null) | ((namespace: string | null, localName: string) => Attr | null) | (() => DOMRectList) | ((classNames: string) => HTMLCollectionOf<Element>) | {
|
|
28
|
-
<K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
|
|
29
|
-
<K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
|
|
30
|
-
(qualifiedName: string): HTMLCollectionOf<Element>;
|
|
31
|
-
} | {
|
|
32
|
-
(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
|
|
33
|
-
(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
|
|
34
|
-
(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
|
|
35
|
-
} | ((qualifiedName: string) => boolean) | ((namespace: string | null, localName: string) => boolean) | (() => boolean) | ((pointerId: number) => boolean) | ((where: InsertPosition, element: Element) => Element | null) | ((position: InsertPosition, text: string) => void) | ((where: InsertPosition, data: string) => void) | ((selectors: string) => boolean) | ((pointerId: number) => void) | ((qualifiedName: string) => void) | ((namespace: string | null, localName: string) => void) | ((attr: Attr) => Attr) | ((options?: FullscreenOptions | undefined) => Promise<void>) | (() => void) | {
|
|
36
|
-
(options?: ScrollToOptions | undefined): void;
|
|
37
|
-
(x: number, y: number): void;
|
|
38
|
-
} | {
|
|
39
|
-
(options?: ScrollToOptions | undefined): void;
|
|
40
|
-
(x: number, y: number): void;
|
|
41
|
-
} | ((arg?: boolean | ScrollIntoViewOptions | undefined) => void) | {
|
|
42
|
-
(options?: ScrollToOptions | undefined): void;
|
|
43
|
-
(x: number, y: number): void;
|
|
44
|
-
} | ((qualifiedName: string, value: string) => void) | ((namespace: string | null, qualifiedName: string, value: string) => void) | ((attr: Attr) => Attr | null) | ((attr: Attr) => Attr | null) | ((pointerId: number) => void) | ((qualifiedName: string, force?: boolean | undefined) => boolean) | ((selectors: string) => boolean) | NodeListOf<ChildNode> | (<T extends Node>(node: T) => T) | ((deep?: boolean | undefined) => Node) | ((other: Node) => number) | ((other: Node | null) => boolean) | ((options?: GetRootNodeOptions | undefined) => Node) | (() => boolean) | (<T_1 extends Node>(node: T_1, child: Node | null) => T_1) | ((namespace: string | null) => boolean) | ((otherNode: Node | null) => boolean) | ((otherNode: Node | null) => boolean) | ((prefix: string | null) => string | null) | ((namespace: string | null) => string | null) | (() => void) | (<T_2 extends Node>(child: T_2) => T_2) | (<T_3 extends Node>(node: Node, child: T_3) => T_3) | ((keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions | undefined) => Animation) | ((options?: GetAnimationsOptions | undefined) => Animation[]) | ((...nodes: (string | Node)[]) => void) | ((...nodes: (string | Node)[]) => void) | (() => void) | ((...nodes: (string | Node)[]) => void) | HTMLCollection | ((...nodes: (string | Node)[]) => void) | ((...nodes: (string | Node)[]) => void) | {
|
|
45
|
-
<K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6] | null;
|
|
46
|
-
<K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7] | null;
|
|
47
|
-
<E_1 extends Element = Element>(selectors: string): E_1 | null;
|
|
48
|
-
} | {
|
|
49
|
-
<K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
|
|
50
|
-
<K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
|
|
51
|
-
<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
|
|
52
|
-
} | ((...nodes: (string | Node)[]) => void) | HTMLSlotElement | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | CSSStyleDeclaration | DOMStringMap | (() => void) | ((options?: FocusOptions | undefined) => void) | undefined>;
|
|
53
|
-
//# sourceMappingURL=getProperty.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getProperty.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getProperty.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qYAYnB"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const utils_1 = require("../../utils");
|
|
7
|
-
const getProperty_1 = __importDefault(require("../../scripts/getProperty"));
|
|
8
|
-
/**
|
|
9
|
-
* The Get Element Property command will return the result of getting a property of an element.
|
|
10
|
-
*
|
|
11
|
-
* <example>
|
|
12
|
-
:getProperty.js
|
|
13
|
-
it('should demonstrate the getProperty command', async () => {
|
|
14
|
-
var elem = await $('body')
|
|
15
|
-
var tag = await elem.getProperty('tagName')
|
|
16
|
-
console.log(tag) // outputs: "BODY"
|
|
17
|
-
})
|
|
18
|
-
* </example>
|
|
19
|
-
*
|
|
20
|
-
* @alias element.getProperty
|
|
21
|
-
* @param {String} property name of the element property
|
|
22
|
-
* @return {Object|String|Boolean|Number|null} the value of the property of the selected element
|
|
23
|
-
*/
|
|
24
|
-
function getProperty(property) {
|
|
25
|
-
if (this.isW3C) {
|
|
26
|
-
return this.getElementProperty(this.elementId, property);
|
|
27
|
-
}
|
|
28
|
-
const browser = (0, utils_1.getBrowserObject)(this);
|
|
29
|
-
return browser.execute(getProperty_1.default, { ELEMENT: this.elementId }, property);
|
|
30
|
-
}
|
|
31
|
-
exports.default = getProperty;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { RectReturn } from '@wdio/protocols';
|
|
2
|
-
export declare type Size = Pick<RectReturn, 'width' | 'height'>;
|
|
3
|
-
declare function getSize(this: WebdriverIO.Element): Promise<Size>;
|
|
4
|
-
declare function getSize(this: WebdriverIO.Element, prop: keyof RectReturn): Promise<number>;
|
|
5
|
-
export default getSize;
|
|
6
|
-
//# sourceMappingURL=getSize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSize.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getSize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAIjD,oBAAY,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;AAExD,iBAAS,OAAO,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5D,iBAAS,OAAO,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAmDtF,eAAe,OAAO,CAAA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const utils_1 = require("../../utils");
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* Get the width and height for an DOM-element.
|
|
7
|
-
*
|
|
8
|
-
* <example>
|
|
9
|
-
:getSize.js
|
|
10
|
-
it('should demonstrate the getSize command', async () => {
|
|
11
|
-
await browser.url('http://github.com')
|
|
12
|
-
const logo = await $('.octicon-mark-github')
|
|
13
|
-
|
|
14
|
-
const size = await logo.getSize()
|
|
15
|
-
console.log(size) // outputs: { width: 32, height: 32 }
|
|
16
|
-
|
|
17
|
-
const width = await logo.getSize('width')
|
|
18
|
-
console.log(width) // outputs: 32
|
|
19
|
-
|
|
20
|
-
const height = await logo.getSize('height')
|
|
21
|
-
console.log(height) // outputs: 32
|
|
22
|
-
})
|
|
23
|
-
* </example>
|
|
24
|
-
*
|
|
25
|
-
* @alias element.getElementSize
|
|
26
|
-
* @param {String=} prop size to receive [optional] ("width" or "height")
|
|
27
|
-
* @return {Object|Number} requested element size (`{ width: <Number>, height: <Number> }`) or actual width/height as number if prop param is given
|
|
28
|
-
* @type property
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
async function getSize(prop) {
|
|
32
|
-
let rect = {};
|
|
33
|
-
if (this.isW3C) {
|
|
34
|
-
rect = await (0, utils_1.getElementRect)(this);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
rect = await this.getElementSize(this.elementId);
|
|
38
|
-
}
|
|
39
|
-
if (prop && rect[prop]) {
|
|
40
|
-
return rect[prop];
|
|
41
|
-
}
|
|
42
|
-
return {
|
|
43
|
-
width: rect.width,
|
|
44
|
-
height: rect.height
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
exports.default = getSize;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Get tag name of a DOM-element.
|
|
4
|
-
*
|
|
5
|
-
* <example>
|
|
6
|
-
:index.html
|
|
7
|
-
<div id="elem">Lorem ipsum</div>
|
|
8
|
-
|
|
9
|
-
:getTagName.js
|
|
10
|
-
it('should demonstrate the getTagName command', async () => {
|
|
11
|
-
const elem = await $('#elem');
|
|
12
|
-
|
|
13
|
-
const tagName = await elem.getTagName();
|
|
14
|
-
console.log(tagName); // outputs: "div"
|
|
15
|
-
})
|
|
16
|
-
* </example>
|
|
17
|
-
*
|
|
18
|
-
* @alias element.getTagName
|
|
19
|
-
* @return {String} the element's tag name, as a lowercase string
|
|
20
|
-
* @uses protocol/elements, protocol/elementIdName
|
|
21
|
-
* @type property
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
export default function getTagName(this: WebdriverIO.Element): Promise<string>;
|
|
25
|
-
//# sourceMappingURL=getTagName.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTagName.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getTagName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,mBAE5D"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* Get tag name of a DOM-element.
|
|
6
|
-
*
|
|
7
|
-
* <example>
|
|
8
|
-
:index.html
|
|
9
|
-
<div id="elem">Lorem ipsum</div>
|
|
10
|
-
|
|
11
|
-
:getTagName.js
|
|
12
|
-
it('should demonstrate the getTagName command', async () => {
|
|
13
|
-
const elem = await $('#elem');
|
|
14
|
-
|
|
15
|
-
const tagName = await elem.getTagName();
|
|
16
|
-
console.log(tagName); // outputs: "div"
|
|
17
|
-
})
|
|
18
|
-
* </example>
|
|
19
|
-
*
|
|
20
|
-
* @alias element.getTagName
|
|
21
|
-
* @return {String} the element's tag name, as a lowercase string
|
|
22
|
-
* @uses protocol/elements, protocol/elementIdName
|
|
23
|
-
* @type property
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
function getTagName() {
|
|
27
|
-
return this.getElementTagName(this.elementId);
|
|
28
|
-
}
|
|
29
|
-
exports.default = getTagName;
|