You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fails when making a call from the repl as node> driver.find('.foo', /Bar/);, it fails to recognize /Bar/ as being an instance of RegExp, so it treats it as a string and fails for not having a .replace function. The problem could be that the repl uses it's own RegExp constructor, making content instanceof RegExp inoperant in this context. One solution (tested on devs machine) is to change to
.
I've thought of other solutions, such as passing the RegExp constructor to the repl context. It does solves the issues when using driver.findContent('.foo', new RegExp('BAR')); but not when using /BAR/. Maybe there could be a solution by customizing further the repl eval function maybe parsing argument, but lack of documentation makes it hard.
The text was updated successfully, but these errors were encountered:
Running
node> driver.findContent('.foo', /BAR/);
in the repl is broken. The culprit is in mocha-webdriver inlib/webdriver-plus.ts
:This fails when making a call from the repl as
node> driver.find('.foo', /Bar/);
, it fails to recognize/Bar/
as being an instance of RegExp, so it treats it as astring
and fails for not having a.replace
function. The problem could be that therepl
uses it's own RegExp constructor, makingcontent instanceof RegExp
inoperant in this context. One solution (tested on devs machine) is to change to.
I've thought of other solutions, such as passing the
RegExp
constructor to the repl context. It does solves the issues when usingdriver.findContent('.foo', new RegExp('BAR'));
but not when using/BAR/
. Maybe there could be a solution by customizing further the repl eval function maybe parsing argument, but lack of documentation makes it hard.The text was updated successfully, but these errors were encountered: