How to use the wd.addElementPromisedMethod 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
_(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!");
      });
  });

  partials['wd.addElementPromisedMethod'] =
    '<div id="theDiv">\n' +
    '  <div id="div1">\n' +
    '    <span>one</span>\n' +
    '    <span>two</span>\n' +
    '  </div>\n' +
    '  <div id="div2">\n' +
    '    <span>one</span>\n' +
    '    <span>two</span>\n' +
    '    <span>three</span>\n' +
    '  </div>\n' +
    '</div>\n';
  it('wd.addElementPromisedMethod', function() {
    _(extraElementPromiseNoChainMethods).each(function(method, name) {
      wd.addElementPromiseMethod(name, method);
    });
    return browser