@qawolf/browser
Advanced tools
Comparing version 0.5.12 to 0.5.13
@@ -43,6 +43,7 @@ "use strict"; | ||
logger_1.logger.verbose("actions.select"); | ||
const findTimeoutMs = (web_1.isNil(timeoutMs) ? config_1.CONFIG.findTimeoutMs : timeoutMs); | ||
yield elementHandle.evaluate((element, value, timeoutMs) => { | ||
const qawolf = window.qawolf; | ||
return qawolf.select.waitForOption(element, value, timeoutMs); | ||
}, value, timeoutMs || config_1.CONFIG.findTimeoutMs); | ||
}, value, findTimeoutMs); | ||
yield elementHandle.select(value || ""); | ||
@@ -49,0 +50,0 @@ }); |
@@ -18,2 +18,3 @@ "use strict"; | ||
logger_1.logger.verbose(`findElement: ${JSON.stringify(step.target).substring(0, 100)}`); | ||
const findTimeoutMs = (web_1.isNil(timeoutMs) ? config_1.CONFIG.findTimeoutMs : timeoutMs); | ||
const jsHandle = yield page.evaluateHandle((locator) => { | ||
@@ -26,3 +27,3 @@ const qawolf = window.qawolf; | ||
target: step.target, | ||
timeoutMs: timeoutMs || config_1.CONFIG.findTimeoutMs, | ||
timeoutMs: findTimeoutMs, | ||
value: step.value | ||
@@ -37,3 +38,3 @@ }); | ||
exports.findProperty = (page, { property, selector }, timeoutMs) => __awaiter(void 0, void 0, void 0, function* () { | ||
const waitForTimeoutMs = timeoutMs || config_1.CONFIG.findTimeoutMs; | ||
const findTimeoutMs = (web_1.isNil(timeoutMs) ? config_1.CONFIG.findTimeoutMs : timeoutMs); | ||
const result = yield retry_1.retryExecutionError(() => __awaiter(void 0, void 0, void 0, function* () { | ||
@@ -45,3 +46,3 @@ const elementHandle = yield web_1.waitFor(() => __awaiter(void 0, void 0, void 0, function* () { | ||
return elementHandles[0]; | ||
}), waitForTimeoutMs, 100); | ||
}), findTimeoutMs, 100); | ||
if (!elementHandle) | ||
@@ -56,3 +57,3 @@ return null; | ||
exports.hasText = (page, text, timeoutMs) => __awaiter(void 0, void 0, void 0, function* () { | ||
const waitForTimeoutMs = timeoutMs || config_1.CONFIG.findTimeoutMs; | ||
const findTimeoutMs = (web_1.isNil(timeoutMs) ? config_1.CONFIG.findTimeoutMs : timeoutMs); | ||
const result = yield retry_1.retryExecutionError(() => __awaiter(void 0, void 0, void 0, function* () { | ||
@@ -62,3 +63,3 @@ const pageHasText = yield page.evaluate(({ text, timeoutMs }) => { | ||
return qawolf.find.hasText(text, timeoutMs); | ||
}, { text, timeoutMs: waitForTimeoutMs }); | ||
}, { text, timeoutMs: findTimeoutMs }); | ||
return pageHasText; | ||
@@ -65,0 +66,0 @@ })); |
{ | ||
"name": "@qawolf/browser", | ||
"description": "qawolf browser manager", | ||
"version": "0.5.12", | ||
"version": "0.5.13", | ||
"license": "BSD-3.0", | ||
@@ -30,3 +30,3 @@ "main": "./lib/index.js", | ||
"@qawolf/types": "^0.5.6", | ||
"@qawolf/web": "^0.5.12", | ||
"@qawolf/web": "^0.5.13", | ||
"fs-extra": "^8.1.0", | ||
@@ -41,3 +41,3 @@ "lodash": "^4.17.15", | ||
}, | ||
"gitHead": "f4ac1245b88c32309fa357e627185b33cfd861d3" | ||
"gitHead": "1f45cf076bcbf323229d5e263e0b8ecf40440a7a" | ||
} |
import { CONFIG } from "@qawolf/config"; | ||
import { logger } from "@qawolf/logger"; | ||
import { ScrollValue } from "@qawolf/types"; | ||
import { QAWolfWeb, sleep } from "@qawolf/web"; | ||
import { isNil, QAWolfWeb, sleep } from "@qawolf/web"; | ||
import { ElementHandle, Page } from "puppeteer"; | ||
@@ -61,2 +61,4 @@ import { valueToStrokes } from "./strokes"; | ||
logger.verbose("actions.select"); | ||
const findTimeoutMs = (isNil(timeoutMs) ? CONFIG.findTimeoutMs : timeoutMs)!; | ||
// ensure option with desired value is loaded before selecting | ||
@@ -69,3 +71,3 @@ await elementHandle.evaluate( | ||
value, | ||
timeoutMs || CONFIG.findTimeoutMs | ||
findTimeoutMs | ||
); | ||
@@ -72,0 +74,0 @@ |
import { CONFIG } from "@qawolf/config"; | ||
import { logger } from "@qawolf/logger"; | ||
import { QAWolfWeb, waitFor } from "@qawolf/web"; | ||
import { isNil, QAWolfWeb, waitFor } from "@qawolf/web"; | ||
import { Locator, Step } from "@qawolf/types"; | ||
@@ -21,2 +21,3 @@ import { ElementHandle, Page, Serializable } from "puppeteer"; | ||
); | ||
const findTimeoutMs = (isNil(timeoutMs) ? CONFIG.findTimeoutMs : timeoutMs)!; | ||
@@ -32,3 +33,3 @@ const jsHandle = await page.evaluateHandle( | ||
target: step.target, | ||
timeoutMs: timeoutMs || CONFIG.findTimeoutMs, | ||
timeoutMs: findTimeoutMs, | ||
value: step.value | ||
@@ -51,3 +52,3 @@ } as Serializable | ||
): Promise<string | null | undefined> => { | ||
const waitForTimeoutMs = timeoutMs || CONFIG.findTimeoutMs; | ||
const findTimeoutMs = (isNil(timeoutMs) ? CONFIG.findTimeoutMs : timeoutMs)!; | ||
@@ -63,3 +64,3 @@ const result = await retryExecutionError(async () => { | ||
}, | ||
waitForTimeoutMs, | ||
findTimeoutMs, | ||
100 | ||
@@ -83,3 +84,3 @@ ); | ||
): Promise<boolean> => { | ||
const waitForTimeoutMs = timeoutMs || CONFIG.findTimeoutMs; | ||
const findTimeoutMs = (isNil(timeoutMs) ? CONFIG.findTimeoutMs : timeoutMs)!; | ||
@@ -93,3 +94,3 @@ const result = await retryExecutionError(async () => { | ||
}, | ||
{ text, timeoutMs: waitForTimeoutMs } | ||
{ text, timeoutMs: findTimeoutMs } | ||
); | ||
@@ -96,0 +97,0 @@ |
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
98673
1729
Updated@qawolf/web@^0.5.13