@qawolf/web
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -9,7 +9,7 @@ import * as element from "./element"; | ||
export declare type Match = Match; | ||
declare const compareArrays: (base?: string[] | null | undefined, compare?: string[] | null | undefined) => number, compareDescriptorKey: (key: "ariaLabel" | "classList" | "dataValue" | "href" | "iconContent" | "id" | "inputType" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "textContent" | "title" | "xpath", targetValue: string | string[] | null | undefined, compareValue: string | string[] | null | undefined) => { | ||
key: "ariaLabel" | "classList" | "dataValue" | "href" | "iconContent" | "id" | "inputType" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "textContent" | "title" | "xpath"; | ||
declare const compareArrays: (base?: string[] | null | undefined, compare?: string[] | null | undefined) => number, compareDescriptorKey: (key: "dataValue" | "title" | "ariaLabel" | "classList" | "href" | "iconContent" | "id" | "inputType" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "textContent" | "xpath", targetValue: string | string[] | null | undefined, compareValue: string | string[] | null | undefined) => { | ||
key: "dataValue" | "title" | "ariaLabel" | "classList" | "href" | "iconContent" | "id" | "inputType" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "textContent" | "xpath"; | ||
percent: number; | ||
}, compareDescriptors: (target: import("@qawolf/types").ElementDescriptor, compare: import("@qawolf/types").ElementDescriptor) => { | ||
key: "ariaLabel" | "classList" | "dataValue" | "href" | "iconContent" | "id" | "inputType" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "textContent" | "title" | "xpath"; | ||
key: "dataValue" | "title" | "ariaLabel" | "classList" | "href" | "iconContent" | "id" | "inputType" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "textContent" | "xpath"; | ||
percent: number; | ||
@@ -24,3 +24,3 @@ }[], countPresentKeys: (descriptor: import("@qawolf/types").ElementDescriptor) => number, isNil: (value?: any) => boolean; | ||
Recorder: typeof Recorder; | ||
scroll: (element: Element, value: import("@qawolf/types").ScrollValue, timeoutMs?: number) => Promise<void>; | ||
scrollElement: (element: Element, value: import("@qawolf/types").ScrollValue, timeoutMs?: number) => Promise<void>; | ||
timer: typeof timer; | ||
@@ -27,0 +27,0 @@ xpath: typeof xpath; |
@@ -14,3 +14,3 @@ "use strict"; | ||
const Recorder_1 = require("./Recorder"); | ||
const scroll_1 = require("./scroll"); | ||
const scrollElement_1 = require("./scrollElement"); | ||
const timer = __importStar(require("./timer")); | ||
@@ -32,3 +32,3 @@ const xpath = __importStar(require("./xpath")); | ||
Recorder: Recorder_1.Recorder, | ||
scroll: scroll_1.scroll, | ||
scrollElement: scrollElement_1.scrollElement, | ||
timer, | ||
@@ -35,0 +35,0 @@ xpath |
@@ -42,3 +42,3 @@ "use strict"; | ||
if (dataAttribute && target.dataValue) { | ||
console.log(`finding element by data attribute ${dataAttribute}=${target.dataValue}`); | ||
console.log(`finding element by data attribute ${dataAttribute}=${target.dataValue}`, target); | ||
return timer_1.waitFor(() => { | ||
@@ -59,3 +59,3 @@ const elements = exports.queryDataElements({ | ||
const strongMatch = yield timer_1.waitFor(() => { | ||
console.log("waiting for strong match"); | ||
console.log("waiting for top strong match", target); | ||
const elements = exports.queryActionElements(action); | ||
@@ -72,3 +72,3 @@ return match_1.topMatch({ | ||
return strongMatch.element; | ||
console.log("no strong match found before timeout, choosing top weak match"); | ||
console.log("no strong match found before timeout, choosing top weak match", target); | ||
const elements = exports.queryActionElements(action); | ||
@@ -75,0 +75,0 @@ const match = match_1.topMatch({ dataAttribute, target, elements, value }); |
@@ -23,4 +23,4 @@ import { ElementDescriptor } from "@qawolf/types"; | ||
export declare const compareArrays: (base?: string[] | null | undefined, compare?: string[] | null | undefined) => number; | ||
export declare const compareDescriptorKey: (key: "ariaLabel" | "classList" | "dataValue" | "href" | "iconContent" | "id" | "inputType" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "textContent" | "title" | "xpath", targetValue: DescriptorValue, compareValue: DescriptorValue) => { | ||
key: "ariaLabel" | "classList" | "dataValue" | "href" | "iconContent" | "id" | "inputType" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "textContent" | "title" | "xpath"; | ||
export declare const compareDescriptorKey: (key: "dataValue" | "title" | "ariaLabel" | "classList" | "href" | "iconContent" | "id" | "inputType" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "textContent" | "xpath", targetValue: DescriptorValue, compareValue: DescriptorValue) => { | ||
key: "dataValue" | "title" | "ariaLabel" | "classList" | "href" | "iconContent" | "id" | "inputType" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "textContent" | "xpath"; | ||
percent: number; | ||
@@ -27,0 +27,0 @@ }; |
@@ -94,3 +94,3 @@ "use strict"; | ||
if (matches.length <= 0 || matches[0].value <= 0) { | ||
console.log("no match found"); | ||
console.log("no top match found", args); | ||
return null; | ||
@@ -100,12 +100,12 @@ } | ||
if (equalTopMatches.length > 1) { | ||
console.log("no match since all top matches are equal", equalTopMatches); | ||
console.log("no top match since all top matches are equal", args, equalTopMatches); | ||
return null; | ||
} | ||
if (!exports.isSelectValueAvailable(matches[0].element, args.value)) { | ||
console.log(`desired select value ${args.value} not available yet`); | ||
console.log(`desired select value ${args.value} not available yet`, args); | ||
return null; | ||
} | ||
console.log("top match found", matches[0]); | ||
console.log("top match found", args, matches[0]); | ||
return matches[0]; | ||
}; | ||
//# sourceMappingURL=match.js.map |
@@ -343,3 +343,3 @@ var qawolf = (function (exports) { | ||
if (matches.length <= 0 || matches[0].value <= 0) { | ||
console.log("no match found"); | ||
console.log("no top match found", args); | ||
return null; | ||
@@ -349,10 +349,10 @@ } | ||
if (equalTopMatches.length > 1) { | ||
console.log("no match since all top matches are equal", equalTopMatches); | ||
console.log("no top match since all top matches are equal", args, equalTopMatches); | ||
return null; | ||
} | ||
if (!isSelectValueAvailable(matches[0].element, args.value)) { | ||
console.log("desired select value " + args.value + " not available yet"); | ||
console.log("desired select value " + args.value + " not available yet", args); | ||
return null; | ||
} | ||
console.log("top match found", matches[0]); | ||
console.log("top match found", args, matches[0]); | ||
return matches[0]; | ||
@@ -440,3 +440,3 @@ }; | ||
if (dataAttribute && target.dataValue) { | ||
console.log("finding element by data attribute " + dataAttribute + "=" + target.dataValue); | ||
console.log("finding element by data attribute " + dataAttribute + "=" + target.dataValue, target); | ||
return [2 /*return*/, waitFor(function () { | ||
@@ -458,3 +458,3 @@ var elements = queryDataElements({ | ||
return [4 /*yield*/, waitFor(function () { | ||
console.log("waiting for strong match"); | ||
console.log("waiting for top strong match", target); | ||
var elements = queryActionElements(action); | ||
@@ -473,3 +473,3 @@ return topMatch({ | ||
return [2 /*return*/, strongMatch.element]; | ||
console.log("no strong match found before timeout, choosing top weak match"); | ||
console.log("no strong match found before timeout, choosing top weak match", target); | ||
elements = queryActionElements(action); | ||
@@ -594,3 +594,3 @@ match = topMatch({ dataAttribute: dataAttribute, target: target, elements: elements, value: value }); | ||
var scroll = function (element, value, timeoutMs) { | ||
var scrollElement = function (element, value, timeoutMs) { | ||
if (timeoutMs === void 0) { timeoutMs = 10000; } | ||
@@ -630,3 +630,3 @@ return __awaiter(void 0, void 0, void 0, function () { | ||
Recorder: Recorder, | ||
scroll: scroll, | ||
scrollElement: scrollElement, | ||
timer: timer, | ||
@@ -633,0 +633,0 @@ xpath: xpath |
{ | ||
"name": "@qawolf/web", | ||
"description": "qawolf web library", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"license": "BSD-3.0", | ||
@@ -27,3 +27,3 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@qawolf/types": "^0.4.0", | ||
"@qawolf/types": "^0.4.1", | ||
"rollup": "^1.23.1", | ||
@@ -34,3 +34,3 @@ "rollup-plugin-commonjs": "^10.1.0", | ||
}, | ||
"gitHead": "a0a2411b4e62470aea6d556082385f7df832cc80" | ||
"gitHead": "01d4fb6943e8dc6f9eeea4e34ef14b0ad702275a" | ||
} |
@@ -6,3 +6,3 @@ import * as element from "./element"; | ||
import { Recorder } from "./Recorder"; | ||
import { scroll } from "./scroll"; | ||
import { scrollElement } from "./scrollElement"; | ||
import * as timer from "./timer"; | ||
@@ -38,3 +38,3 @@ import * as xpath from "./xpath"; | ||
Recorder, | ||
scroll, | ||
scrollElement, | ||
timer, | ||
@@ -41,0 +41,0 @@ xpath |
@@ -59,3 +59,4 @@ import { Action, Locator } from "@qawolf/types"; | ||
console.log( | ||
`finding element by data attribute ${dataAttribute}=${target.dataValue}` | ||
`finding element by data attribute ${dataAttribute}=${target.dataValue}`, | ||
target | ||
); | ||
@@ -80,3 +81,3 @@ return waitFor(() => { | ||
const strongMatch = await waitFor(() => { | ||
console.log("waiting for strong match"); | ||
console.log("waiting for top strong match", target); | ||
const elements = queryActionElements(action); | ||
@@ -93,3 +94,6 @@ return topMatch({ | ||
console.log("no strong match found before timeout, choosing top weak match"); | ||
console.log( | ||
"no strong match found before timeout, choosing top weak match", | ||
target | ||
); | ||
const elements = queryActionElements(action); | ||
@@ -96,0 +100,0 @@ const match = topMatch({ dataAttribute, target, elements, value }); |
@@ -169,3 +169,3 @@ import { ElementDescriptor } from "@qawolf/types"; | ||
if (matches.length <= 0 || matches[0].value <= 0) { | ||
console.log("no match found"); | ||
console.log("no top match found", args); | ||
return null; | ||
@@ -176,3 +176,7 @@ } | ||
if (equalTopMatches.length > 1) { | ||
console.log("no match since all top matches are equal", equalTopMatches); | ||
console.log( | ||
"no top match since all top matches are equal", | ||
args, | ||
equalTopMatches | ||
); | ||
return null; | ||
@@ -182,8 +186,8 @@ } | ||
if (!isSelectValueAvailable(matches[0].element, args.value)) { | ||
console.log(`desired select value ${args.value} not available yet`); | ||
console.log(`desired select value ${args.value} not available yet`, args); | ||
return null; | ||
} | ||
console.log("top match found", matches[0]); | ||
console.log("top match found", args, matches[0]); | ||
return matches[0]; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
101940
53
1989