前端自动化测试解决方案探析(11)

发表于:2016-11-23来源:ouven作者:ouven点击数: 标签:前端
http://www.nightmarejs.org/ Nightwatch。 Nightwatch则可以使用node书写端对端的测试用例,并在 Selenium server服务端运行测试,同样支持同步和异步。 this . demoTestGoog

http://www.nightmarejs.org/

  • Nightwatch。

  Nightwatch则可以使用node书写端对端的测试用例,并在Selenium server服务端运行测试,同样支持同步和异步。

this.demoTestGoogle = function (browser) {
  browser
    .url('http://www.google.com')
    .waitForElementVisible('body', 1000)
    .setValue('input[type=text]', 'nightwatch')
    .waitForElementVisible('button[name=btnG]', 1000)
    .click('button[name=btnG]')
    .pause(1000)
    .assert.containsText('#main', 'The Night Watch')
    .end();
};

原文转自:http://jixianqianduan.com/frontend-javascript/2016/11/22/front-end-auto-test.html