Skip to content

Instantly share code, notes, and snippets.

@tuliobluz
Last active August 1, 2018 13:18
Show Gist options
  • Save tuliobluz/eb99fe3f463f0be3e1b37b5c3746c91a to your computer and use it in GitHub Desktop.
Save tuliobluz/eb99fe3f463f0be3e1b37b5c3746c91a to your computer and use it in GitHub Desktop.
spec.spec.js
let specPage = require('../pages/spec.po.js');
let chai = require('chai');
let chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
let expect = chai.expect;
Before(function(){
specPage.init();
})
Given('The user go to {string}', function (string) {
specPage.get(string);
});
When('The user adds {string} in the name field', function (string) {
specPage.setName(string);
});
Then('The user should see Hello with the username', function () {
expect(specPage.getGreetingText())
.to.eventually.equal('Hello Julie!')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment