How to use the wd.addElementAsyncMethod 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-pc-specs.js View on Github external
it('wd.addAsyncMethod', function() {
    _(extraAsyncMethods).each(function(method, name) {
      wd.addAsyncMethod(name, method);
    });
    return browser
      // .sleepAndElementById('theDiv')
      //   .should.be.fulfilled
      // .sleepAndText()
      //   .should.be.fulfilled
      // .sleepAndElementById('theDiv')
      // .sleepAndText().should.eventually.include("Hello World!")
      .elementByCssWhenReady('#theDiv', 500).text()
        .should.become("Hello World!");
  });

  partials['wd.addElementAsyncMethod'] =
    '<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.addElementAsyncMethod', function() {
    _(extraElementAsyncMethods).each(function(method, name) {
      wd.addElementAsyncMethod(name, method);
    });
    return browser
github admc / wd / test / midway / add-methods-pnc-specs.js View on Github external
it('wd.addAsyncMethod', function() {
    _(extraAsyncMethods).each(function(method, name) {
      wd.addAsyncMethod(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.addElementAsyncMethod'] =
    '<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.addElementAsyncMethod', function() {
    _(extraElementAsyncMethods).each(function(method, name) {
      wd.addElementAsyncMethod(name, method);
    });
    return browser
github admc / wd / test / midway / add-methods-async-specs.js View on Github external
it('wd.addAsyncMethod', function(done) {
    _(extraAsyncMethods).each(function(method, name) {
      wd.addAsyncMethod(name, method);
    });
    browser.sleepAndElementById('theDiv', function(err, el) {
      if(err) { return done(err); }
      el.should.exist;
      browser.sleepAndText(el, function(err,text) {
        if(err) { return done(err); }
        text.should.equal('Hello World!');
        done();
      });
    });
  });

  partials['wd.addElementAsyncMethod'] =
    '<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.addElementAsyncMethod', function(done) {
    _(extraElementAsyncMethods).each(function(method, name) {
      wd.addElementAsyncMethod(name, method);
    });
    browser.elementById('div1', function(err, el) {