Created
March 27, 2018 17:37
-
-
Save andreidbr/ed323128da14c8e07d9ee2346165a250 to your computer and use it in GitHub Desktop.
A Selenium test using JS and Mocha
This file contains hidden or 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 {webdriver, Builder, By, Key, until} = require('selenium-webdriver'), | |
test = require('selenium-webdriver/testing'), | |
assert = require('assert'); | |
let driver; | |
test.describe('PortfolioTests', function() { | |
test.before(function *() { | |
driver = new Builder().forBrowser('chrome').build(); | |
}); | |
test.it('01 Drums Access', function() { | |
driver.get("https://andreidbr.github.io/JS30/"); | |
driver.findElement(By.xpath('/html/body/div[2]/div[1]')).click(); | |
driver.getTitle().then(function(title) { | |
assert.equal(title, "JS30: 01 Drums"); | |
}); | |
}); | |
test.after(() => driver.quit()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment