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
--- | |
- hosts: mygroup | |
become: yes | |
become_method: sudo | |
vars: | |
NODEJS_VERSION: "10" | |
ansible_become_pass: devops | |
gecko_version: 0.17.0 | |
selenium_install_firefox: yes |
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('earth', function() { | |
describe('united kingdom', function() { | |
it('should have at least 70% rain', function() { | |
// Code for determining if there is enough rain | |
}); | |
}); | |
describe('australia', function() { | |
it('should have at least 80% sunshine', function() { |
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("string length", function() { | |
it('should return number of characters in a string', function() { | |
"Hello".length.should.equal(5) | |
}); | |
}); |
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
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); | |
} | |
}); |
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
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); | |
} | |
}); |
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
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); | |
} | |
}); |
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) { |
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
#!/bin/bash | |
cf push -f ./manifest.yml | |
export APP_URL=http://$(cf app $CF_APP_NAME | grep -e urls: -e routes: | awk '{print $2}') |
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
// 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() { |
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
#!/bin/bash | |
# This script is run on IBM Cloud in the delivery pipeline | |
# It enables a Test stage to run automated Selenium tests | |
# In Firefox using a virtual display | |
echo "==> Updating all dependencies" | |
sudo apt-get -y --force-yes update | |
echo "==> Installing Firefox" | |
sudo apt-get -y --force-yes install firefox | |
firefox -v |