We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34a19b2 commit 1abc6d8Copy full SHA for 1abc6d8
src/webpage.js
@@ -95,13 +95,16 @@ export default class Webpage {
95
getElementFromPage(pageFunction, selector, ...args) {
96
const parsedFn = parseFunction(pageFunction, this.getBabelPresetOptions())
97
98
+ // It would be bettter to return undefined when no el exists,
99
+ // but selenium always returns null for undefined so better to keep
100
+ // the return value consistent
101
+
102
/* eslint-disable no-var */
103
return this.runScript(
104
/* istanbul ignore next */
105
function (selector, fn, args) {
106
var el = document.querySelector(selector)
107
if (!el) {
- // undefined would be better but selenium returns null for undefined
108
return null
109
}
110
0 commit comments