How to use the wd.addPromisedMethod function in wd

To help you get started, we’ve selected a few wd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github admc / wd / test / midway / add-methods-pnc-specs.js View on Github external
should.not.exist(wd.PromiseChainWebdriver.prototype[name]);
    });
  };

  beforeEach(function() {
    noExtraMethodCheck();
  });

  afterEach(function() {
    _(allExtraMethodNames).each(function(name) {
      wd.removeMethod(name);
    });
    noExtraMethodCheck();
  });

  partials['wd.addPromisedMethod'] =
    '<div id="theDiv">Hello World!</div>';
  it('wd.addPromisedMethod', function() {
    _(extraPromiseNoChainMethods).each(function(method, name) {
      wd.addPromiseMethod(name, method);
    });

    return browser
      .sleepAndElementById('theDiv').should.be.fulfilled
      .then(function() {
        return browser.sleepAndText().should.be.fulfilled;
      }).then(function() {
        return browser.sleepAndElementById('theDiv');
      }).then(function(el){
        return browser.sleepAndText(el).should.become("Hello World!");
      });
  });