Skip to content

Instantly share code, notes, and snippets.

@DMeechan
Last active June 19, 2018 12:22
Show Gist options
  • Save DMeechan/4079f74462d1119342ce5a36d5a6304f to your computer and use it in GitHub Desktop.
Save DMeechan/4079f74462d1119342ce5a36d5a6304f to your computer and use it in GitHub Desktop.
DevOps Course Chapter 8 - Automated testing
// This collection of test cases will be testing the title of the page
describe('title', function() {
const driver = getDriver();
// Before every test runs, we'll need to open up the web page in Firefox
beforeEach(openWebsite(driver));
// ▼ Write the test case for the page title below here ▼
it('is correct', async function() {
try {
const expectedTitle = 'Example To Do List';
const title = await driver.getTitle();
title.should.equal(expectedTitle);
} catch (error) {
throw new Error(error);
}
});
// ▲ Write the test case for the page title above here ▲
// And then after all the tests, we can close the web page
after(closeWebsite(driver));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment