@applitools/spec-driver-webdriver
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -31,2 +31,3 @@ "use strict"; | ||
__exportStar(require("./spec-driver"), exports); | ||
exports.default = spec; | ||
const typedSpec = spec; | ||
exports.default = typedSpec; |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.build = exports.switchWorld = exports.getWorlds = exports.getCurrentWorld = exports.performAction = exports.getElementAttribute = exports.getElementRegion = exports.setOrientation = exports.getOrientation = exports.getSystemBars = exports.click = exports.takeScreenshot = exports.visit = exports.getUrl = exports.getTitle = exports.getDriverInfo = exports.getCapabilities = exports.getCookies = exports.setWindowSize = exports.getWindowSize = exports.getElementText = exports.setElementText = exports.findElements = exports.findElement = exports.childContext = exports.parentContext = exports.mainContext = exports.executeScript = exports.isEqualElements = exports.isStaleElementError = exports.untransformSelector = exports.extractHostName = exports.transformSelector = exports.transformElement = exports.transformDriver = exports.isSelector = exports.isShadowRoot = exports.isElement = exports.isDriver = void 0; | ||
exports.build = exports.switchWorld = exports.getWorlds = exports.getCurrentWorld = exports.performAction = exports.getElementAttribute = exports.getElementRegion = exports.setOrientation = exports.getOrientation = exports.getSystemBars = exports.click = exports.takeScreenshot = exports.visit = exports.getUrl = exports.getTitle = exports.getDriverInfo = exports.getCapabilities = exports.getCookies = exports.setWindowSize = exports.getWindowSize = exports.getElementText = exports.setElementText = exports.findElements = exports.findElement = exports.childContext = exports.parentContext = exports.mainContext = exports.executeScript = exports.isEqualElements = exports.isStaleElementError = exports.extractHostName = exports.untransformSelector = exports.transformSelector = exports.transformElement = exports.transformDriver = exports.isSelector = exports.isShadowRoot = exports.isElement = exports.isDriver = void 0; | ||
const url_1 = require("url"); | ||
@@ -200,7 +200,2 @@ const utils = __importStar(require("@applitools/utils")); | ||
exports.transformSelector = transformSelector; | ||
function extractHostName(driver) { | ||
var _a, _b; | ||
return (_b = (_a = driver.options) === null || _a === void 0 ? void 0 : _a.hostname) !== null && _b !== void 0 ? _b : null; | ||
} | ||
exports.extractHostName = extractHostName; | ||
function untransformSelector(selector) { | ||
@@ -213,2 +208,7 @@ if (utils.types.has(selector, ['using', 'value'])) { | ||
exports.untransformSelector = untransformSelector; | ||
function extractHostName(driver) { | ||
var _a, _b; | ||
return (_b = (_a = driver.options) === null || _a === void 0 ? void 0 : _a.hostname) !== null && _b !== void 0 ? _b : null; | ||
} | ||
exports.extractHostName = extractHostName; | ||
function isStaleElementError(error) { | ||
@@ -253,6 +253,11 @@ if (!error) | ||
const parentId = parent ? (isShadowRoot(parent) ? extractShadowRootId(parent) : extractElementId(parent)) : null; | ||
const element = parentId | ||
? await driver.findElementFromElement(parentId, selector.using, selector.value) | ||
: await driver.findElement(selector.using, selector.value); | ||
return isElement(element) ? element : null; | ||
try { | ||
const element = parentId | ||
? await driver.findElementFromElement(parentId, selector.using, selector.value) | ||
: await driver.findElement(selector.using, selector.value); | ||
return isElement(element) ? element : null; | ||
} | ||
catch { | ||
return null; | ||
} | ||
} | ||
@@ -259,0 +264,0 @@ exports.findElement = findElement; |
{ | ||
"name": "@applitools/spec-driver-webdriver", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"keywords": [ | ||
@@ -69,3 +69,3 @@ "webdriver", | ||
"dependencies": { | ||
"@applitools/driver": "1.11.17", | ||
"@applitools/driver": "1.11.18", | ||
"@applitools/utils": "1.3.21", | ||
@@ -78,3 +78,3 @@ "proxy-agent": "5.0.0" | ||
"@applitools/scripts": "1.2.0", | ||
"@applitools/test-utils": "1.5.4", | ||
"@applitools/test-utils": "1.5.5", | ||
"@types/mocha": "^9.1.1", | ||
@@ -81,0 +81,0 @@ "@types/node": "12", |
@@ -1,2 +0,2 @@ | ||
declare const _default: typeof spec; | ||
declare const _default: import('@applitools/driver').SpecDriver<Driver, Driver, Element, Selector>; | ||
export default _default; | ||
@@ -10,4 +10,4 @@ export function isDriver(driver: any): driver is Driver; | ||
export function transformSelector(selector: string | { selector: string | Selector; type?: undefined | string; }): Selector; | ||
export function untransformSelector(selector: Selector): string | { selector: string; type?: undefined | string; }; | ||
export function extractHostName(driver: Driver): null | string; | ||
export function untransformSelector(selector: Selector): string | { selector: string; type?: undefined | string; }; | ||
export function isStaleElementError(error: any): boolean; | ||
@@ -60,3 +60,3 @@ export function isEqualElements(_driver: Driver, element1: Element, element2: Element): Promise<boolean>; | ||
export function build(env: any): Promise<[Driver, () => Promise<void>]>; | ||
export type Driver = import('webdriver').Client & { __applitoolsBrand?: undefined; }; | ||
export type Driver = import('webdriver').Client & { original?: any; } & { __applitoolsBrand?: undefined; }; | ||
export type Element = ({ 'element-6066-11e4-a52e-4f735466cecf': string; } | { ELEMENT: string; }) & { __applitoolsBrand?: undefined; }; | ||
@@ -63,0 +63,0 @@ export type ShadowRoot = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41942
547
+ Added@applitools/driver@1.11.18(transitive)
+ Added@wdio/config@9.2.8(transitive)
+ Added@wdio/logger@8.38.0(transitive)
+ Added@wdio/types@9.2.2(transitive)
+ Added@wdio/utils@9.2.8(transitive)
+ Addedbare-stream@2.6.0(transitive)
+ Addededgedriver@5.6.1(transitive)
+ Addedgeckodriver@4.5.1(transitive)
+ Addedsafaridriver@0.1.2(transitive)
+ Addedwebdriver@9.4.1(transitive)
+ Addedwhich@4.0.0(transitive)
- Removed@applitools/driver@1.11.17(transitive)
- Removed@wdio/config@9.4.2(transitive)
- Removed@wdio/types@9.4.2(transitive)
- Removed@wdio/utils@9.4.2(transitive)
- Removedbare-stream@2.6.1(transitive)
- Removededgedriver@6.1.1(transitive)
- Removedgeckodriver@5.0.0(transitive)
- Removedsafaridriver@1.0.0(transitive)
- Removedwebdriver@9.4.2(transitive)
- Removedwhich@5.0.0(transitive)
Updated@applitools/driver@1.11.18