@qawolf/browser
Advanced tools
Comparing version 0.9.3-alpha.0 to 0.9.3
@@ -21,2 +21,3 @@ "use strict"; | ||
catch (e) { | ||
element.blur(); | ||
element.focus(); | ||
@@ -23,0 +24,0 @@ } |
@@ -30,2 +30,12 @@ "use strict"; | ||
yield elementHandle.evaluate((element) => { | ||
element.blur(); | ||
element.focus(); | ||
if (element.setSelectionRange) { | ||
try { | ||
const len = element.value.length; | ||
element.setSelectionRange(len, len); | ||
} | ||
catch (e) { } | ||
return; | ||
} | ||
if (!element.isContentEditable || | ||
@@ -35,3 +45,2 @@ !window.getSelection || | ||
return; | ||
element.focus(); | ||
const selection = window.getSelection(); | ||
@@ -38,0 +47,0 @@ if (!selection) |
@@ -35,3 +35,3 @@ "use strict"; | ||
} | ||
logger_1.logger.error(`retryExecutionError: will not retry error: "${error.message}"`); | ||
logger_1.logger.error(`retryExecutionError: will not retry error >${times}x: "${error.message}"`); | ||
throw error; | ||
@@ -38,0 +38,0 @@ } |
{ | ||
"name": "@qawolf/browser", | ||
"description": "qawolf browser manager", | ||
"version": "0.9.3-alpha.0", | ||
"version": "0.9.3", | ||
"license": "BSD-3.0", | ||
@@ -27,12 +27,12 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@qawolf/config": "0.9.3-alpha.0", | ||
"@qawolf/logger": "0.9.3-alpha.0", | ||
"@qawolf/repl": "0.9.3-alpha.0", | ||
"@qawolf/screen": "0.9.3-alpha.0", | ||
"@qawolf/types": "0.9.3-alpha.0", | ||
"@qawolf/web": "0.9.3-alpha.0", | ||
"@qawolf/config": "0.9.3", | ||
"@qawolf/logger": "0.9.3", | ||
"@qawolf/repl": "0.9.3", | ||
"@qawolf/screen": "0.9.3", | ||
"@qawolf/types": "0.9.3", | ||
"@qawolf/web": "0.9.3", | ||
"rrweb": "^0.7.25" | ||
}, | ||
"devDependencies": { | ||
"@qawolf/jest-plugin": "0.9.3-alpha.0", | ||
"@qawolf/jest-plugin": "0.9.3", | ||
"@types/debug": "^4.1.5", | ||
@@ -50,3 +50,3 @@ "fs-extra": "^8.x", | ||
}, | ||
"gitHead": "4a729506a9cbe8fe126682d77000727472a440ba" | ||
"gitHead": "87e23647fd82b656ffbbb5613d9e19be27b68bc1" | ||
} |
@@ -21,3 +21,4 @@ import { logger } from "@qawolf/logger"; | ||
// setSelectionRange throws an error for inputs: number/date/time/etc | ||
// we can just focus them and the content will be selected | ||
// we can just blur/focus them and the content will be selected | ||
element.blur(); | ||
element.focus(); | ||
@@ -24,0 +25,0 @@ } |
@@ -30,5 +30,18 @@ import { logger } from "@qawolf/logger"; | ||
} else { | ||
// place caret at end of content editable | ||
// https://stackoverflow.com/a/4238971/230462 | ||
await elementHandle.evaluate((element: HTMLElement) => { | ||
// blur will fix the placement for date inputs | ||
element.blur(); | ||
element.focus(); | ||
if ((element as HTMLInputElement).setSelectionRange) { | ||
try { | ||
// more caret to end of inputs / text areas | ||
const len = (element as HTMLInputElement).value.length; | ||
(element as HTMLInputElement).setSelectionRange(len, len); | ||
} catch (e) {} | ||
return; | ||
} | ||
// place caret at end of content editable | ||
// https://stackoverflow.com/a/4238971/230462 | ||
if ( | ||
@@ -41,4 +54,2 @@ !element.isContentEditable || | ||
element.focus(); | ||
const selection = window.getSelection(); | ||
@@ -45,0 +56,0 @@ if (!selection) return; |
@@ -38,3 +38,3 @@ import { logger } from "@qawolf/logger"; | ||
logger.error( | ||
`retryExecutionError: will not retry error: "${error.message}"` | ||
`retryExecutionError: will not retry error >${times}x: "${error.message}"` | ||
); | ||
@@ -41,0 +41,0 @@ throw error; |
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
176365
3119
+ Added@qawolf/config@0.9.3(transitive)
+ Added@qawolf/logger@0.9.3(transitive)
+ Added@qawolf/repl@0.9.3(transitive)
+ Added@qawolf/screen@0.9.3(transitive)
+ Added@qawolf/types@0.9.3(transitive)
+ Added@qawolf/web@0.9.3(transitive)
- Removed@qawolf/config@0.9.3-alpha.0(transitive)
- Removed@qawolf/logger@0.9.3-alpha.0(transitive)
- Removed@qawolf/repl@0.9.3-alpha.0(transitive)
- Removed@qawolf/screen@0.9.3-alpha.0(transitive)
- Removed@qawolf/types@0.9.3-alpha.0(transitive)
- Removed@qawolf/web@0.9.3-alpha.0(transitive)
Updated@qawolf/config@0.9.3
Updated@qawolf/logger@0.9.3
Updated@qawolf/repl@0.9.3
Updated@qawolf/screen@0.9.3
Updated@qawolf/types@0.9.3
Updated@qawolf/web@0.9.3