0
我对量角器内部引号引起的问题有疑问。量角器报价问题
这里是我的代码:
browser.executeScript('var str = window.document.getElementsByTagName("pre")[0].innerText;var patt = new RegExp("16.5");console.log(patt);var res = patt.test(str);console.log(res);if(res){window.location="http://www.mysite.nl/info/"}');
expect(browser.getCurrentUrl()).toBe('http://www.mysite.nl/info/');
这工作得很好,但现在我想正则表达式(“16.5”),以检查是否“状态”:“OK”是字符串内。
我想要的是:RegEXP(“”status“:”ok“”),但当然这不起作用,并且我不能使用单引号,因为来自browser.executeScript的单引号。
有人知道我还能如何让它工作吗?