forked from enviPath/enviPy
Current Dev State
This commit is contained in:
29
static/js/ketcher2/node_modules/webdriverio/lib/protocol/elementActive.js
generated
vendored
Normal file
29
static/js/ketcher2/node_modules/webdriverio/lib/protocol/elementActive.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
*
|
||||
* Get the element on the page that currently has focus. The element will be returned as a WebElement JSON object.
|
||||
*
|
||||
* @return {String} A WebElement JSON object for the active element.
|
||||
*
|
||||
* @see https://w3c.github.io/webdriver/webdriver-spec.html#get-active-element
|
||||
* @type protocol
|
||||
*
|
||||
*/
|
||||
|
||||
export default function elementActive () {
|
||||
const requestOptions = {
|
||||
path: '/session/:sessionId/element/active',
|
||||
method: 'POST'
|
||||
}
|
||||
|
||||
return this.requestHandler.create(requestOptions).catch((err) => {
|
||||
/**
|
||||
* jsonwire command not supported try webdriver endpoint
|
||||
*/
|
||||
if (err.message.match(/did not match a known command/)) {
|
||||
requestOptions.method = 'GET'
|
||||
return this.requestHandler.create(requestOptions)
|
||||
}
|
||||
|
||||
throw err
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user