1
我试图在使用CodeMirror组件的web应用程序的页面上编辑查询。我使用铬合金nightwatchjs进行测试。我无法设置基础textarea元素,因为它不可见。 Nightwatchjs setValue
方法不起作用,因为查询位于可编辑的div中。使用nightwatchjs测试其中包含CodeMirror组件的页面
例尝试:
module.exports = {
'Testing save code change' : function (browser) {
browser
.url("http://codemirror.net/index.html")
.waitForElementVisible("#demo", 3000)
.waitForElementVisible('.CodeMirror-code div:nth-child(3) .cm-string', 3000)
.setValue('.CodeMirror-code div:nth-child(3) .cm-string', 'New String');
}
};
任何人都可以提出一个方法,将工作?
第二个选项完美运作。非常感谢 –