Devin Kelly-Collins
Scenario: easy maths
Given a variable set to 1
When I increment the variable by 1
Then the variable should contain 2
Then(/^the response status is (.*)$/, function (status) {
assert.equal(this.responseStatus, status)
});
Then(/^the error output contains the text snippets:$/, function(table) {
const actualOutput = normalizeText(this.lastRun.errorOutput)
table.rows().forEach(row => {
const expectedOutput = normalizeText(row[0])
expect(actualOutput).to.include(expectedOutput)
})
})
Before(function () {
// This hook will be executed before all scenarios
});
Before({tags: "@foo"}, function () {
// This hook will be executed before scenarios tagged with @foo
});
Before({tags: "@foo and @bar"}, function () {
// This hook will be executed before scenarios tagged with @foo and @bar
});
Before({tags: "@foo or @bar"}, function () {
// This hook will be executed before scenarios tagged with @foo or @bar
});
// You can use the following shorthand when only specifying tags
Before("@foo", function () {
// This hook will be executed before scenarios tagged with @foo
});
function CustomWorld() {
this.driver = new seleniumWebdriver.Builder()
.forBrowser('firefox')
.build();
// Returns a promise that resolves to the element
this.waitForElement = function(locator) {
var condition = seleniumWebdriver.until.elementLocated(locator);
return this.driver.wait(condition)
}
}
setWorldConstructor(CustomWorld)
devin.kellycollins@artisantechgroup.com