Created
July 15, 2014 15:20
-
-
Save jzelenkov/b4227ed32d675f4c7d12 to your computer and use it in GitHub Desktop.
make your browsers test for you article source code
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
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'); | |
}); |
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
client | |
.addValue('[name="whoami"]', 'FrankfurtJS!') | |
.buttonClick('#greet') | |
.getText('#message', function(err, text) { | |
assert.equal(text, 'FrankfurtJS!', 'Messages should be the same'); | |
}); |
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
test | |
.type('[name="whoami"]', 'FrankfurtJS!') | |
.click('#greet') | |
.assert.text('#message').is('FrankfurtJS!'); |
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
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!'); | |
}); |
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
webdriver-manager update | |
webdriver-manager start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment