Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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
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) {