Skip to content

Instantly share code, notes, and snippets.

@jzelenkov
Created July 15, 2014 15:20
Show Gist options
  • Save jzelenkov/b4227ed32d675f4c7d12 to your computer and use it in GitHub Desktop.
Save jzelenkov/b4227ed32d675f4c7d12 to your computer and use it in GitHub Desktop.
make your browsers test for you article source code
driver.findElement(webdriver.By.name('whoami'))
.sendKeys('FrankfurtJS!');
driver.findElement(webdriver.By.id('greet'))
.click();
driver.findElement(webdriver.By.id('message'))
.getText()
.then(function(val) {
assert.equal(val, 'FrankfurtJS!', 'Messages should be the same');
});
client
.addValue('[name="whoami"]', 'FrankfurtJS!')
.buttonClick('#greet')
.getText('#message', function(err, text) {
assert.equal(text, 'FrankfurtJS!', 'Messages should be the same');
});
test
.type('[name="whoami"]', 'FrankfurtJS!')
.click('#greet')
.assert.text('#message').is('FrankfurtJS!');
browser.ignoreSynchronization = true; // to work outside of AngularJS
element(by.name('whoami')).sendKeys('FrankfurtJS!');
element(by.id('greet')).click();
element(by.id('message')).getText().then(function(val) {
assert.equal(val, 'FrankfurtJS!');
});
webdriver-manager update
webdriver-manager start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment