Skip to content

Instantly share code, notes, and snippets.

@elpete
Last active December 17, 2015 14:55
Show Gist options
  • Select an option

  • Save elpete/86bb1d4c1a9559059b9a to your computer and use it in GitHub Desktop.

Select an option

Save elpete/86bb1d4c1a9559059b9a to your computer and use it in GitHub Desktop.
component extends='cfselenium.BaseSpec' {
function beforeAll() {
super.beforeAll('http://#CGI.HTTP_HOST#/');
}
function afterAll() {
super.afterAll();
}
function run() {
story('As a user, I want to log in', function() {
given('I have a user with an email of "[email protected]" and a password of "1234"', function() {
when('I go to the login page, enter my credentials, and click "Log In"', function() {
then('I should be on the home page and I should see "Welcome Back!"', function() {
var email = '[email protected]';
var password = '1234';
// create user in database
variables.selenium.open('/login');
expect(selenium.getTitle).toBe('Log In');
// etc...
});
});
});
});
}
}
component extends='cfselenium.BaseSpec' {
function beforeAll() {
super.beforeAll('http://#CGI.HTTP_HOST#/');
}
function afterAll() {
super.afterAll();
}
function run() {
story('As a user, I want to log in', function() {
given('I have a user with an email of "[email protected]" and a password of "1234"', function() {
var email = '[email protected]';
var password = '1234';
// create user in database
when('I go to the login page, enter my credentials, and click "Log In"', function() {
variables.selenium.open('/login');
then('I should be on the home page and I should see "Welcome Back!"', function() {
expect(selenium.getTitle).toBe('Log In');
// etc...
});
});
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment