【发布时间】:2017-10-03 18:21:01
【问题描述】:
我正在使用 Spectron 测试我的电子应用程序。 我正在尝试从警报框中获取文本,但出现错误。 我想从警报中获取文本,如果这是预期的,则接受它。
测试:
it('Check alert message', function() {
return this.app.client
.waitForExist('#associates', 20000).should.eventually.equal(true)
.click('#pq-associates')
.click('#submit-selection')
.alertText().should.eventually.equal("You have to select any one")
.should.eventually.exist
});
我收到以下错误
no alert open
Error: An attempt was made to operate on a modal dialog when one was not open.
但我可以看到警报。
【问题讨论】:
标签: electron webdriver-io spectron