@qawolf/browser
Advanced tools
Comparing version 0.8.0-alpha.1 to 0.8.0-alpha.2
@@ -13,2 +13,3 @@ "use strict"; | ||
const config_1 = require("@qawolf/config"); | ||
const logger_1 = require("@qawolf/logger"); | ||
const createPage_1 = require("../page/createPage"); | ||
@@ -28,6 +29,11 @@ exports.managePages = (browser) => __awaiter(void 0, void 0, void 0, function* () { | ||
browser.on("targetcreated", (target) => __awaiter(void 0, void 0, void 0, function* () { | ||
const page = yield target.page(); | ||
if (page) { | ||
qawolf.pages.push(yield createPage_1.createPage(Object.assign(Object.assign({}, options), { page, index: pages.length }))); | ||
try { | ||
const page = yield target.page(); | ||
if (page) { | ||
qawolf.pages.push(yield createPage_1.createPage(Object.assign(Object.assign({}, options), { page, index: pages.length }))); | ||
} | ||
} | ||
catch (e) { | ||
logger_1.logger.error(`Could not setup page: ${e}`); | ||
} | ||
})); | ||
@@ -34,0 +40,0 @@ browser.on("targetdestroyed", () => __awaiter(void 0, void 0, void 0, function* () { |
@@ -47,3 +47,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: options.page || getSelectorPage(selector) })); | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: getSelectorPage(selector) || options.page })); | ||
return page.qawolf.click(selector, options); | ||
@@ -82,3 +82,3 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: options.page || getSelectorPage(selector) })); | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: getSelectorPage(selector) || options.page })); | ||
return page.qawolf.find(selector, options); | ||
@@ -89,3 +89,3 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: options.page || getSelectorPage(selector) })); | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: getSelectorPage(selector) || options.page })); | ||
return page.qawolf.findProperty(selector, property, options); | ||
@@ -119,3 +119,3 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: options.page || getSelectorPage(selector) })); | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: getSelectorPage(selector) || options.page })); | ||
return page.qawolf.scroll(selector, value, options); | ||
@@ -126,3 +126,3 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: options.page || getSelectorPage(selector) })); | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: getSelectorPage(selector) || options.page })); | ||
return page.qawolf.select(selector, value, options); | ||
@@ -133,3 +133,3 @@ }); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: options.page || getSelectorPage(selector) })); | ||
const page = yield this.page(Object.assign(Object.assign({}, options), { page: getSelectorPage(selector) || options.page })); | ||
return page.qawolf.type(selector, value, options); | ||
@@ -136,0 +136,0 @@ }); |
{ | ||
"name": "@qawolf/browser", | ||
"description": "qawolf browser manager", | ||
"version": "0.8.0-alpha.1", | ||
"version": "0.8.0-alpha.2", | ||
"license": "BSD-3.0", | ||
@@ -41,3 +41,3 @@ "main": "./lib/index.js", | ||
}, | ||
"gitHead": "4780e65c827da7413bbbfe85201edf28d907a32e" | ||
"gitHead": "070d2bb355a30617c92b935793e972a7d064a45d" | ||
} |
import { CONFIG } from "@qawolf/config"; | ||
import { logger } from "@qawolf/logger"; | ||
import { Browser } from "./Browser"; | ||
@@ -25,7 +26,11 @@ import { createPage } from "../page/createPage"; | ||
browser.on("targetcreated", async target => { | ||
const page = await target.page(); | ||
if (page) { | ||
qawolf.pages.push( | ||
await createPage({ ...options, page, index: pages.length }) | ||
); | ||
try { | ||
const page = await target.page(); | ||
if (page) { | ||
qawolf.pages.push( | ||
await createPage({ ...options, page, index: pages.length }) | ||
); | ||
} | ||
} catch (e) { | ||
logger.error(`Could not setup page: ${e}`); | ||
} | ||
@@ -32,0 +37,0 @@ }); |
@@ -73,3 +73,3 @@ import { CONFIG } from "@qawolf/config"; | ||
...options, | ||
page: options.page || getSelectorPage(selector) | ||
page: getSelectorPage(selector) || options.page | ||
}); | ||
@@ -131,3 +131,3 @@ return page.qawolf.click(selector, options); | ||
...options, | ||
page: options.page || getSelectorPage(selector) | ||
page: getSelectorPage(selector) || options.page | ||
}); | ||
@@ -144,3 +144,3 @@ return page.qawolf.find(selector, options); | ||
...options, | ||
page: options.page || getSelectorPage(selector) | ||
page: getSelectorPage(selector) || options.page | ||
}); | ||
@@ -192,3 +192,3 @@ return page.qawolf.findProperty(selector, property, options); | ||
...options, | ||
page: options.page || getSelectorPage(selector) | ||
page: getSelectorPage(selector) || options.page | ||
}); | ||
@@ -205,3 +205,3 @@ return page.qawolf.scroll(selector, value, options); | ||
...options, | ||
page: options.page || getSelectorPage(selector) | ||
page: getSelectorPage(selector) || options.page | ||
}); | ||
@@ -218,3 +218,3 @@ return page.qawolf.select(selector, value, options); | ||
...options, | ||
page: options.page || getSelectorPage(selector) | ||
page: getSelectorPage(selector) || options.page | ||
}); | ||
@@ -221,0 +221,0 @@ return page.qawolf.type(selector, value, options); |
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
204217
3443