Skip to content

Instantly share code, notes, and snippets.

@mtheoryx
Created August 2, 2014 18:15
Show Gist options
  • Save mtheoryx/a199efa1bc0a6b112355 to your computer and use it in GitHub Desktop.
Save mtheoryx/a199efa1bc0a6b112355 to your computer and use it in GitHub Desktop.
Conversion of a user story into protractor/jasmine stubbed tests
"use strict";
/*
* Login page and fields
* */
xdescribe('Application login page > ', function () {
beforeEach(function() {
//start at root app url every time tests are run
browser.get('http://localhost:8888/#/login');
});
xit('should be accessible', function () {
});
xit('should present two form fields, a checkbox, and a submit button', function () {
});
xit('should have a disabled submit button when no fields filled out', function () {
});
xit('should have a disabled submit button when only username filled in', function () {
});
xit('should have an enabled button when username and password are filled in', function () {
});
xit('should have all fields visible when browser scaled down to mobile', function () {
});
});
/*
* Basic Application Authentication behaviors
* */
xdescribe('Application authentication behavior > ', function() {
beforeEach(function() {
//start at root app url every time tests are run
browser.get('http://localhost:8888/');
});
xdescribe('when a user is not logged in > ', function() {
xit('should jump to the /login path when / is accessed', function() {
});
xit('should jump to the /login path when /home is accessed', function () {
});
xit('should jump to the /login path when /business is accessed', function () {
});
xdescribe('they should not see > ', function () {
xit('a welcome message', function () {
});
xit('a logout button', function () {
});
xit('an application menu', function () {
});
xdescribe('(when scaled down to mobile) > ', function () {
xit('a dropdown menu', function () {
});
xit('a main nav menu', function () {
});
});
});
});
/*
* Existence of the page, and the
* Form validations and behavior
* are tested e2e in separate test
* */
xdescribe('when an invalid user logs in > ', function() {
xit('they should remain on the /login page', function () {
});
xit('they should get redirected to /login if they access /home', function () {
});
xit('they should get redirected to /login if they access /business', function () {
});
});
xdescribe('when a valid user logs in > ', function() {
xit('they should be redirected to /home', function () {
});
});
xdescribe('when a user is logged in > ', function() {
xit('they should see a welcome message', function () {
});
xit('they should see a logout button', function () {
});
xit('they should not be able to navigate to /login', function () {
});
xit('they should see a menu of items they have access to', function () {
});
xdescribe('(and scales the app down to mobile) > ', function () {
xit('they should see a dropdown menu of items', function () {
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment