@qawolf/web
Advanced tools
Comparing version 0.5.0 to 0.5.4
@@ -103,4 +103,9 @@ "use strict"; | ||
const xpath = xpath_1.getXpath(element); | ||
if (xpath === "/html") | ||
return { xpath }; | ||
const tagName = element.tagName ? element.tagName.toLowerCase() : null; | ||
if (xpath === "/html" || xpath === "/html/body") { | ||
return { | ||
tagName, | ||
xpath | ||
}; | ||
} | ||
return { | ||
@@ -121,4 +126,4 @@ ariaLabel: element.getAttribute("aria-label") || null, | ||
placeholder: exports.getPlaceholder(element), | ||
tagName: element.tagName ? element.tagName.toLowerCase() : null, | ||
innerText: exports.getTextContent(element), | ||
tagName, | ||
title: element.title || null, | ||
@@ -125,0 +130,0 @@ xpath |
@@ -55,4 +55,4 @@ "use strict"; | ||
} | ||
if (target.xpath === "/html") | ||
return xpath_1.findElementByXpath("/html"); | ||
if (target.xpath === "/html" || target.xpath === "/html/body") | ||
return xpath_1.findElementByXpath(target.xpath); | ||
const strongMatch = yield wait_1.waitFor(() => { | ||
@@ -59,0 +59,0 @@ console.log("waiting for top strong match", target); |
@@ -11,7 +11,7 @@ import * as element from "./element"; | ||
declare const isKeyEvent: (event: import("@qawolf/types").Event | null) => boolean | null; | ||
declare const compareArrays: (base?: string[] | null | undefined, compare?: string[] | null | undefined) => number, compareDescriptorKey: (key: "ariaLabel" | "classList" | "dataValue" | "href" | "iconContent" | "id" | "inputType" | "isContentEditable" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "innerText" | "title" | "xpath", targetValue: string | boolean | string[] | null | undefined, compareValue: string | boolean | string[] | null | undefined) => { | ||
key: "ariaLabel" | "classList" | "dataValue" | "href" | "iconContent" | "id" | "inputType" | "isContentEditable" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "innerText" | "title" | "xpath"; | ||
declare const compareArrays: (base?: string[] | null | undefined, compare?: string[] | null | undefined) => number, compareDescriptorKey: (key: "dataValue" | "title" | "ariaLabel" | "classList" | "href" | "iconContent" | "id" | "inputType" | "isContentEditable" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "innerText" | "xpath", targetValue: string | boolean | string[] | null | undefined, compareValue: string | boolean | string[] | null | undefined) => { | ||
key: "dataValue" | "title" | "ariaLabel" | "classList" | "href" | "iconContent" | "id" | "inputType" | "isContentEditable" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "innerText" | "xpath"; | ||
percent: number; | ||
}, compareDescriptors: (target: import("@qawolf/types").ElementDescriptor, compare: import("@qawolf/types").ElementDescriptor) => { | ||
key: "ariaLabel" | "classList" | "dataValue" | "href" | "iconContent" | "id" | "inputType" | "isContentEditable" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "innerText" | "title" | "xpath"; | ||
key: "dataValue" | "title" | "ariaLabel" | "classList" | "href" | "iconContent" | "id" | "inputType" | "isContentEditable" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "innerText" | "xpath"; | ||
percent: number; | ||
@@ -18,0 +18,0 @@ }[], countPresentKeys: (descriptor: import("@qawolf/types").ElementDescriptor) => number, isNil: (value?: any) => boolean; |
@@ -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" | "isContentEditable" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "innerText" | "title" | "xpath", targetValue: DescriptorValue, compareValue: DescriptorValue) => { | ||
key: "ariaLabel" | "classList" | "dataValue" | "href" | "iconContent" | "id" | "inputType" | "isContentEditable" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "innerText" | "title" | "xpath"; | ||
export declare const compareDescriptorKey: (key: "dataValue" | "title" | "ariaLabel" | "classList" | "href" | "iconContent" | "id" | "inputType" | "isContentEditable" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "innerText" | "xpath", targetValue: DescriptorValue, compareValue: DescriptorValue) => { | ||
key: "dataValue" | "title" | "ariaLabel" | "classList" | "href" | "iconContent" | "id" | "inputType" | "isContentEditable" | "labels" | "name" | "parentText" | "placeholder" | "tagName" | "innerText" | "xpath"; | ||
percent: number; | ||
@@ -27,0 +27,0 @@ }; |
@@ -154,7 +154,12 @@ var qawolf = (function (exports) { | ||
var xpath = getXpath(element); | ||
// if a root element just return the xpath | ||
// since we know it will match properly | ||
// to avoid collecting a lot of superfluous info | ||
if (xpath === "/html") | ||
return { xpath: xpath }; | ||
var tagName = element.tagName ? element.tagName.toLowerCase() : null; | ||
// if a root element avoid collecting a lot of superfluous info | ||
// just return the xpath for matching | ||
// and tagName for test naming | ||
if (xpath === "/html" || xpath === "/html/body") { | ||
return { | ||
tagName: tagName, | ||
xpath: xpath | ||
}; | ||
} | ||
return { | ||
@@ -175,4 +180,4 @@ ariaLabel: element.getAttribute("aria-label") || null, | ||
placeholder: getPlaceholder(element), | ||
tagName: element.tagName ? element.tagName.toLowerCase() : null, | ||
innerText: getTextContent(element), | ||
tagName: tagName, | ||
title: element.title || null, | ||
@@ -489,4 +494,4 @@ xpath: xpath | ||
// return root elements right away | ||
if (target.xpath === "/html") | ||
return [2 /*return*/, findElementByXpath("/html")]; | ||
if (target.xpath === "/html" || target.xpath === "/html/body") | ||
return [2 /*return*/, findElementByXpath(target.xpath)]; | ||
return [4 /*yield*/, waitFor(function () { | ||
@@ -493,0 +498,0 @@ console.log("waiting for top strong match", target); |
{ | ||
"name": "@qawolf/web", | ||
"description": "qawolf web library", | ||
"version": "0.5.0", | ||
"version": "0.5.4", | ||
"license": "BSD-3.0", | ||
@@ -33,3 +33,3 @@ "main": "./lib/index.js", | ||
}, | ||
"gitHead": "ab0de314c354a4adb5889edd2a35a98ea7708798" | ||
"gitHead": "00c193cb2a3bd7e703c6aafaf7fa60fa1255a2a4" | ||
} |
@@ -131,7 +131,14 @@ import { ElementDescriptor } from "@qawolf/types"; | ||
// if a root element just return the xpath | ||
// since we know it will match properly | ||
// to avoid collecting a lot of superfluous info | ||
if (xpath === "/html") return { xpath }; | ||
const tagName = element.tagName ? element.tagName.toLowerCase() : null; | ||
// if a root element avoid collecting a lot of superfluous info | ||
// just return the xpath for matching | ||
// and tagName for test naming | ||
if (xpath === "/html" || xpath === "/html/body") { | ||
return { | ||
tagName, | ||
xpath | ||
}; | ||
} | ||
return { | ||
@@ -152,4 +159,4 @@ ariaLabel: element.getAttribute("aria-label") || null, | ||
placeholder: getPlaceholder(element), | ||
tagName: element.tagName ? element.tagName.toLowerCase() : null, | ||
innerText: getTextContent(element), | ||
tagName, | ||
title: element.title || null, | ||
@@ -156,0 +163,0 @@ xpath |
@@ -78,3 +78,4 @@ import { Action, Locator } from "@qawolf/types"; | ||
// return root elements right away | ||
if (target.xpath === "/html") return findElementByXpath("/html"); | ||
if (target.xpath === "/html" || target.xpath === "/html/body") | ||
return findElementByXpath(target.xpath); | ||
@@ -81,0 +82,0 @@ const strongMatch = await waitFor(() => { |
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
122397
2378