Skip to content

Instantly share code, notes, and snippets.

@DMeechan
Created June 18, 2018 15:18
Show Gist options
  • Save DMeechan/205f0c8bdf0ba03f50cdf00bb9698f8a to your computer and use it in GitHub Desktop.
Save DMeechan/205f0c8bdf0ba03f50cdf00bb9698f8a to your computer and use it in GitHub Desktop.
DevOps Course Chapter 8 - Automated testing
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