Created
June 18, 2018 15:18
-
-
Save DMeechan/205f0c8bdf0ba03f50cdf00bb9698f8a to your computer and use it in GitHub Desktop.
DevOps Course Chapter 8 - Automated testing
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
describe('tasks', function() { | |
const driver = getDriver(); | |
beforeEach(openWebsite(driver)); | |
// ▼ Write the test case for the tasks list below here ▼ | |
it('lists four tasks', async function() { | |
try { | |
const list = await driver.findElements(By.tagName("li")); | |
list.length.should.equal(4); | |
} catch (error) { | |
throw new Error(error); | |
} | |
}); | |
it('contains DevOps course task', async function() { | |
try { | |
const expectedValue = "Finish DevOps course"; | |
const matchingTasks = await driver.findElements(By.css(`li[value="${expectedValue}"]`)); | |
matchingTasks.length.should.equal(1); | |
} catch (error) { | |
throw new Error(error); | |
} | |
}); | |
// ▲ Write the test case for the tasks list above here ▲ | |
after(closeWebsite(driver)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment