Last active
August 29, 2015 14:27
-
-
Save eyalzek/52f702f69f86f45ac2fe to your computer and use it in GitHub Desktop.
webdriverio + mocha issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// run with: ./node_modules/.bin/mocha --timeout 99999 testme.js | |
var webdriverio = require('webdriverio'), | |
mocha = require('mocha'), | |
url = "http://google.com"; | |
var client = webdriverio.remote( | |
{ | |
desiredCapabilities: {browserName: 'chrome'} | |
} | |
); | |
client.addCommand('custom', function(cb) { | |
return this.url(url) | |
.pause(5000) | |
.waitUntil(function() { | |
console.log('returning true'); | |
return (1 + 1 == 2); | |
}, 5000) | |
.addValue('.gsfi', 'test') | |
.click("input[name='btnI']"); | |
}); | |
describe('test', function() { | |
before(function(done){ | |
client.init(done); | |
}); | |
it('should work', function(done) { | |
client | |
.custom() | |
// this is invoked immediately instead of waiting for custom to return: | |
.waitForVisible('#nonexistent', 5000).then(function(el) { | |
console.log('non existent exists!'); // how is this logging?!?!?!?! | |
}); | |
}); | |
after(function(done) { | |
client.end(done); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment