Skip to content

Instantly share code, notes, and snippets.

@giltayar
Last active December 21, 2017 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giltayar/4be138a1a0c36864e283dafdee9f3a62 to your computer and use it in GitHub Desktop.
Save giltayar/4be138a1a0c36864e283dafdee9f3a62 to your computer and use it in GitHub Desktop.
Companion code to an article
const webdriver = require('selenium-webdriver')
const {By, until} = webdriver
require('chromedriver')
describe.only('todo list', function() {
let driver
beforeAll(async () => (driver = await new webdriver.Builder().forBrowser('chrome').build()))
afterAll(async () => await driver.quit())
it('should show the todos header', async () => {
await driver.get(`http://todomvc.com/examples/react`)
await driver.wait(until.elementLocated(By.tagName('h1')))
expect(await (await driver.findElement(By.tagName('h1'))).getText()).toEqual('todos')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment