lundi 27 novembre 2017

define multiple test suite in single file nigthwatch

I want to define multiple test suite in a single file for "nightwatch". Is there a way to do it. If I define like below "nightwatch" will run only one test suite.

module.exports.test1 = {
  'demo test google' : function (client) {
    client
      .url('http://google.com')
      .waitForElementPresent('body', 1000);
  },

  'part two' : function(client) {
    client
      .setValue('input[type=text]', ['nightwatch', client.Keys.ENTER])
      .pause(1000)
      .assert.containsText('#main', 'Night Watch')
      .end();
  }
};

module.exports.test = {
  'demo test google2' : function (client) {
    client
      .url('http://google.com')
      .waitForElementPresent('body', 1000);
  },

  'part two' : function(client) {
    client
      .setValue('input[type=text]', ['nightwatch', client.Keys.ENTER])
      .pause(1000)
      .assert.containsText('#main', 'Night Watch')
      .end();
  }
};

Aucun commentaire:

Enregistrer un commentaire