Created
March 5, 2018 13:35
-
-
Save anonymous/89a84dbc15ba4088719400be1f359045 to your computer and use it in GitHub Desktop.
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
const {Builder, By, Key, until, assert} = require('selenium-webdriver'); | |
let driver = new Builder() | |
.forBrowser('chrome') | |
.build(); | |
driver.get('http://mujomusic.net/WDV321/Selenium/index.html') | |
.then(_ => | |
driver.getTitle().then(function(title) { | |
var expectedTitle = "Selenium Form Test"; | |
var actualTitle = driver.getTitle(); | |
if(expectedTitle === title){ | |
console.log("Title is Correct"); | |
} | |
else{ | |
console.log("Title is Wrong"); | |
} | |
})) | |
.then(_ => | |
driver.findElement(By.id('quantityInput')).sendKeys('-5', Key.TAB)) | |
.then(_ => | |
driver.findElement(By.name('submit')).click()) | |
.then(_ => | |
driver.findElement(By.id('quantityInput')).clear()) | |
.then(_ => | |
driver.findElement(By.id('quantityInput')).sendKeys('0', Key.TAB)) | |
.then(_ => | |
driver.findElement(By.name('submit')).click()) | |
.then(_ => | |
driver.findElement(By.id('quantityInput')).clear()) | |
.then(_ => | |
driver.findElement(By.id('quantityInput')).sendKeys('56', Key.TAB)) | |
.then(_ => | |
driver.findElement(By.name('submit')).click()) | |
.then(_ => | |
driver.findElement(By.id('quantityInput')).clear()) | |
.then(_ => | |
driver.findElement(By.id('quantityInput')).sendKeys('100', Key.TAB)) | |
.then(_ => | |
driver.findElement(By.name('submit')).click()) | |
.then(_ => | |
driver.findElement(By.id('quantityInput')).clear()) | |
.then(_ => | |
driver.findElement(By.id('quantityInput')).sendKeys('106', Key.TAB)) | |
.then(_ => | |
driver.findElement(By.name('submit')).click()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment