@nodebug/selenium
Advanced tools
Comparing version 4.2.0 to 4.3.0
@@ -141,3 +141,3 @@ const { By } = require('selenium-webdriver') | ||
element.rect.midy = element.rect.y + element.rect.height / 2 | ||
element.tagName = await element.getTagName() | ||
element.tagName = (await element.getTagName()).toLowerCase() | ||
return element | ||
@@ -174,3 +174,3 @@ } | ||
const frames = await this.driver.findElements( | ||
By.xpath('//iframe[not(contains(@style,"display: none;"))]'), | ||
By.xpath('//iframe'), | ||
) | ||
@@ -211,3 +211,3 @@ | ||
const frames = await this.driver.findElements( | ||
By.xpath('//iframe[not(contains(@style,"display: none;"))]'), | ||
By.xpath('//iframe'), | ||
) | ||
@@ -214,0 +214,0 @@ |
const config = require('@nodebug/config')('selenium') | ||
const { log } = require('@nodebug/logger') | ||
const { Builder } = require('selenium-webdriver') | ||
const remote = require('selenium-webdriver/remote') | ||
const capabilities = require('../capabilities') | ||
const Window = require('./window') | ||
const remote = require('selenium-webdriver/remote') | ||
@@ -36,3 +36,3 @@ class Browser { | ||
new() { | ||
async new() { | ||
const builder = new Builder() | ||
@@ -45,2 +45,8 @@ builder.withCapabilities(this.capabilities) | ||
if (!['', undefined, null].includes(this.hub)) { | ||
await this.driver.setFileDetector(new remote.FileDetector()) | ||
} | ||
await this.sleep(2000) | ||
;['SIGINT', 'SIGTERM', 'exit', 'uncaughtException'].forEach((signal) => | ||
@@ -194,7 +200,6 @@ process.on(signal, async () => { | ||
await this.driver.manage().setTimeouts({ | ||
implicit: 1000, | ||
implicit: 500, | ||
pageLoad: 6 * this.timeout(), | ||
script: 6 * this.timeout(), | ||
}) | ||
await this.driver.setFileDetector(new remote.FileDetector()) | ||
await this.driver.get(url) | ||
@@ -201,0 +206,0 @@ return true |
@@ -10,3 +10,2 @@ const { log } = require('@nodebug/logger') | ||
class Driver extends Browser { | ||
// // const alert = new Alert(driver) | ||
constructor() { | ||
@@ -528,3 +527,3 @@ super() | ||
const locator = await this.finder(null, 'select') | ||
if (locator.tagName === 'select') { | ||
if (['select'].includes(locator.tagName)) { | ||
const selected = await locator.findElements( | ||
@@ -531,0 +530,0 @@ By.xpath(`.//option[.="${value}"][@selected]`), |
{ | ||
"name": "@nodebug/selenium", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Node Bug", |
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
89077
2206