mimik
Version:
Write end-to-end automation tests in natural language
30 lines (24 loc) • 878 B
JavaScript
var browser = driver.getClient();
// Given I am a registered user
Given(/I am a registered user/, function(done) {
done();
});
// When I go to github.com
When(/I go to github\.com/, function(done) {
browser.visit('https://github.com/login', done);
});
// And I enter my credentials and submit the login form
And(/I enter my credentials and submit the login form/, function(done) {
var username = 'user_name';
var password = 'user_pass';
browser.wait.for.element('#login_field').then.type(username);
browser.element('#password').type(password);
browser.element('input[name="commit"]').click(done);
});
// Then I should see a welcome page
Then(/I should see a welcome page/, function(done) {
browser.element('.account-switcher .js-select-button').text(function(err, val) {
expect(val).to.eql('simoami');
done(err);
});
});