private-event-sourcing-examples-46 Write a single, simple protractor test:

- Sign Up (+cases)
- Login (+cases)
- Create Account (+cases)
- [WIP] Create 3rd Party Account (+cases)
This commit is contained in:
Andrew Revinsky (DART)
2016-09-28 04:42:01 +03:00
parent ebca25a2c8
commit 01bc1709c3
20 changed files with 408 additions and 71 deletions

View File

@@ -2568,12 +2568,14 @@ webpackJsonp([0,3],{
* Created by andrew on 26/02/16.
*/
function parseResponse(response) {
var json = response.json().catch(function (err) {
if (err.toString().indexOf('SyntaxError: Unexpected end of JSON input') >= 0) {
return Promise.resolve({});
}
throw err;
});
var json = response.json();
// .catch(err => {
// if (err.toString().indexOf('SyntaxError: Unexpected end of JSON input') >= 0) {
// return Promise.resolve({});
// }
// throw err;
// });
if (response.status >= 200 && response.status < 300) {
return json;
} else {
@@ -3819,7 +3821,8 @@ webpackJsonp([0,3],{
var name = _user$name === undefined ? {} : _user$name;
var _user$phoneNumber = user.phoneNumber;
var phoneNumber = _user$phoneNumber === undefined ? '' : _user$phoneNumber;
var address = user.address;
var _user$address = user.address;
var address = _user$address === undefined ? {} : _user$address;
var toAccounts = user.toAccounts;
@@ -4488,7 +4491,7 @@ webpackJsonp([0,3],{
null,
_react2.default.createElement(
"form",
null,
{ className: "account-create-ref clearfix" },
_react2.default.createElement(
"div",
{ className: "form-group", style: {
@@ -7154,4 +7157,4 @@ webpackJsonp([0,3],{
/***/ }
});
//# sourceMappingURL=app.3441ac93c60d32b5b228.js.map
//# sourceMappingURL=app.30980d75b78111237ddf.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,7 @@
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap-theme.min.css"><link href="/style.b588c60da106277d78c8.css" rel="stylesheet"></head>
<body><div id="root"></div><script src="/manifest.6cefa3c1211f2dfff0d6.js"></script><script src="/vendor.85781b28c9410377534e.js"></script><script src="/style.b588c60da106277d78c8.js"></script><script src="/app.3441ac93c60d32b5b228.js"></script><script>
<body><div id="root"></div><script src="/manifest.2790e4278ac45db31919.js"></script><script src="/vendor.85781b28c9410377534e.js"></script><script src="/style.b588c60da106277d78c8.js"></script><script src="/app.30980d75b78111237ddf.js"></script><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@@ -27,5 +27,5 @@
ga('send', 'pageview');
</script><!--{"files":{"publicPath":"/","chunks":{"manifest":{"size":0,"entry":"/manifest.6cefa3c1211f2dfff0d6.js","hash":"6cefa3c1211f2dfff0d6","css":[]},"vendor":{"size":1654379,"entry":"/vendor.85781b28c9410377534e.js","hash":"85781b28c9410377534e","css":[]},"style":{"size":122,"entry":"/style.b588c60da106277d78c8.js","hash":"b588c60da106277d78c8","css":["/style.b588c60da106277d78c8.css"]},"app":{"size":350828,"entry":"/app.3441ac93c60d32b5b228.js","hash":"3441ac93c60d32b5b228","css":[]}},"js":["/manifest.6cefa3c1211f2dfff0d6.js","/vendor.85781b28c9410377534e.js","/style.b588c60da106277d78c8.js","/app.3441ac93c60d32b5b228.js"],"css":["/style.b588c60da106277d78c8.css"]},"options":{"template":"/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/html-webpack-plugin/lib/loader.js!/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/public/index.ejs","filename":"index.html","hash":false,"inject":false,"compile":true,"favicon":false,"minify":false,"cache":true,"showErrors":true,"chunks":"all","excludeChunks":[],"title":"Money Transfer App","xhtml":false,"description":"ES Money Transfer App","appMountId":"root","googleAnalytics":{"trackingId":"UA-XXXX-XX","pageViewOnLoad":true},"mobile":true}}--></body>
</script><!--{"files":{"publicPath":"/","chunks":{"manifest":{"size":0,"entry":"/manifest.2790e4278ac45db31919.js","hash":"2790e4278ac45db31919","css":[]},"vendor":{"size":1654379,"entry":"/vendor.85781b28c9410377534e.js","hash":"85781b28c9410377534e","css":[]},"style":{"size":122,"entry":"/style.b588c60da106277d78c8.js","hash":"b588c60da106277d78c8","css":["/style.b588c60da106277d78c8.css"]},"app":{"size":350969,"entry":"/app.30980d75b78111237ddf.js","hash":"30980d75b78111237ddf","css":[]}},"js":["/manifest.2790e4278ac45db31919.js","/vendor.85781b28c9410377534e.js","/style.b588c60da106277d78c8.js","/app.30980d75b78111237ddf.js"],"css":["/style.b588c60da106277d78c8.css"]},"options":{"template":"/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/node_modules/html-webpack-plugin/lib/loader.js!/Users/andrew/dev/clients/ES/code/event-sourcing-examples/js-frontend/public/index.ejs","filename":"index.html","hash":false,"inject":false,"compile":true,"favicon":false,"minify":false,"cache":true,"showErrors":true,"chunks":"all","excludeChunks":[],"title":"Money Transfer App","xhtml":false,"description":"ES Money Transfer App","appMountId":"root","googleAnalytics":{"trackingId":"UA-XXXX-XX","pageViewOnLoad":true},"mobile":true}}--></body>
</html>

View File

@@ -76,7 +76,7 @@
/******/ script.charset = 'utf-8';
/******/ script.async = true;
/******/
/******/ script.src = __webpack_require__.p + "" + {"0":"3441ac93c60d32b5b228","1":"b588c60da106277d78c8","2":"85781b28c9410377534e"}[chunkId] + ".js";
/******/ script.src = __webpack_require__.p + "" + {"0":"30980d75b78111237ddf","1":"b588c60da106277d78c8","2":"85781b28c9410377534e"}[chunkId] + ".js";
/******/ head.appendChild(script);
/******/ }
/******/ };
@@ -92,4 +92,4 @@
/******/ })
/************************************************************************/
/******/ ([]);
//# sourceMappingURL=manifest.6cefa3c1211f2dfff0d6.js.map
//# sourceMappingURL=manifest.2790e4278ac45db31919.js.map

View File

@@ -1 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap ee0048d3207bbfc1d857?"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uDAA+C,iFAAiF;AAChI;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA","file":"manifest.6cefa3c1211f2dfff0d6.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, callbacks = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tcallbacks.push.apply(callbacks, installedChunks[chunkId]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);\n \t\twhile(callbacks.length)\n \t\t\tcallbacks.shift().call(null, __webpack_require__);\n \t\tif(moreModules[0]) {\n \t\t\tinstalledModules[0] = 0;\n \t\t\treturn __webpack_require__(0);\n \t\t}\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// \"0\" means \"already loaded\"\n \t// Array means \"loading\", array contains callbacks\n \tvar installedChunks = {\n \t\t3:0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId, callback) {\n \t\t// \"0\" is the signal for \"already loaded\"\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn callback.call(null, __webpack_require__);\n\n \t\t// an array means \"currently loading\".\n \t\tif(installedChunks[chunkId] !== undefined) {\n \t\t\tinstalledChunks[chunkId].push(callback);\n \t\t} else {\n \t\t\t// start chunk loading\n \t\t\tinstalledChunks[chunkId] = [callback];\n \t\t\tvar head = document.getElementsByTagName('head')[0];\n \t\t\tvar script = document.createElement('script');\n \t\t\tscript.type = 'text/javascript';\n \t\t\tscript.charset = 'utf-8';\n \t\t\tscript.async = true;\n\n \t\t\tscript.src = __webpack_require__.p + \"\" + {\"0\":\"3441ac93c60d32b5b228\",\"1\":\"b588c60da106277d78c8\",\"2\":\"85781b28c9410377534e\"}[chunkId] + \".js\";\n \t\t\thead.appendChild(script);\n \t\t}\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap ee0048d3207bbfc1d857\n **/"],"sourceRoot":""}
{"version":3,"sources":["webpack:///webpack/bootstrap 639cbdef3a3cb57e8b8a?"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uDAA+C,iFAAiF;AAChI;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA","file":"manifest.2790e4278ac45db31919.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, callbacks = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tcallbacks.push.apply(callbacks, installedChunks[chunkId]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);\n \t\twhile(callbacks.length)\n \t\t\tcallbacks.shift().call(null, __webpack_require__);\n \t\tif(moreModules[0]) {\n \t\t\tinstalledModules[0] = 0;\n \t\t\treturn __webpack_require__(0);\n \t\t}\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// \"0\" means \"already loaded\"\n \t// Array means \"loading\", array contains callbacks\n \tvar installedChunks = {\n \t\t3:0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId, callback) {\n \t\t// \"0\" is the signal for \"already loaded\"\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn callback.call(null, __webpack_require__);\n\n \t\t// an array means \"currently loading\".\n \t\tif(installedChunks[chunkId] !== undefined) {\n \t\t\tinstalledChunks[chunkId].push(callback);\n \t\t} else {\n \t\t\t// start chunk loading\n \t\t\tinstalledChunks[chunkId] = [callback];\n \t\t\tvar head = document.getElementsByTagName('head')[0];\n \t\t\tvar script = document.createElement('script');\n \t\t\tscript.type = 'text/javascript';\n \t\t\tscript.charset = 'utf-8';\n \t\t\tscript.async = true;\n\n \t\t\tscript.src = __webpack_require__.p + \"\" + {\"0\":\"30980d75b78111237ddf\",\"1\":\"b588c60da106277d78c8\",\"2\":\"85781b28c9410377534e\"}[chunkId] + \".js\";\n \t\t\thead.appendChild(script);\n \t\t}\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 639cbdef3a3cb57e8b8a\n **/"],"sourceRoot":""}

View File

@@ -2,12 +2,14 @@
* Created by andrew on 26/02/16.
*/
export function parseResponse (response) {
const json = response.json().catch(err => {
if (err.toString().indexOf('SyntaxError: Unexpected end of JSON input') >= 0) {
return Promise.resolve({});
}
throw err;
});
const json = response.json();
// .catch(err => {
// if (err.toString().indexOf('SyntaxError: Unexpected end of JSON input') >= 0) {
// return Promise.resolve({});
// }
// throw err;
// });
if (response.status >= 200 && response.status < 300) {
return json;
} else {

View File

@@ -140,7 +140,7 @@ class MyAccounts extends React.Component {
ssn = '',
name = {},
phoneNumber = '',
address,
address = {},
toAccounts
} = user;

View File

@@ -102,7 +102,7 @@ export class Add3rdPartyAccountModal extends React.Component {
<BS.Modal.Title>Add 3rd Party Account</BS.Modal.Title>
</BS.Modal.Header>
<BS.Modal.Body>
<form>
<form className="account-create-ref clearfix">
<div className="form-group" style={{
display: formErrors ? 'block' : 'none'
}}>

View File

@@ -89,7 +89,7 @@ export class NewAccountModal extends React.Component {
<BS.Modal.Title>New Account</BS.Modal.Title>
</BS.Modal.Header>
<BS.Modal.Body>
<form className='account-create-form clearfix'
<form className="account-create-form clearfix"
onSubmit={this.handleSubmit.bind(this)}>
<Input type="text"

View File

@@ -1,3 +1,55 @@
const salt = Math.random().toString().substr(2, 6);
const userData = (() => {
const [ fName, lName, email, pass, passConf, ssn ] = 'John|Doe|jd@em.com|12345|12345|12345'.split('|').map(k => `${k}_${salt}`);
return {
fName, lName, email, pass, passConf, ssn
}
})();
const otherUserData = (() => {
const [ fName, lName, email, pass, passConf, ssn ] = 'Jane|Dole|janed@ail.com|56789|56789|56789'.split('|').map(k => `${k}_${salt}`);
return {
fName, lName, email, pass, passConf, ssn
}
})();
const accountOne = (() => {
const [ title, amount, description ] = 'InitialAccount|100|One hundred'.split('|');
return {
title,
amount,
description
}
})();
const accountTwo = (() => {
const [ title, amount, description ] = 'SecondaryAccount|200|Two hundred'.split('|');
return {
title,
amount,
description
}
})();
export default {
waitForConditionTimeout: 10000,
userData,
otherUserData,
accountOne,
accountTwo
};

View File

@@ -1,9 +1,140 @@
const mainCommands = {
createAccount({ title, amount, description }, waitToHide) {
this
.waitForElementVisible('@modalCreateAccountHook')
.click('@modalCreateAccountHook');
this.api.pause(500);
this.waitForElementVisible('@modalCreateAccountModal')
.waitForElementVisible('@modalCreateAccountForm')
.setValue('@modalCreateAccountTitle', title)
.setValue('@modalCreateAccountAmount', amount)
.setValue('@modalCreateAccountDescription', description)
.click('@modalCreateAccountSubmit');
if (waitToHide) {
this.waitForElementNotPresent('@modalCreateAccountModal');
this.api.pause(1500);
}
return this;
},
createRef({ userQuery, accountQuery, title, description }, waitToHide) {
this
.waitForElementVisible('@modalCreateRefHook')
.click('@modalCreateRefHook');
this.api.pause(500);
this.waitForElementVisible('@modalCreateRefModal')
.waitForElementVisible('@modalCreateRefForm')
.waitForElementVisible('@modalCreateRefCustomerField')
.click('@modalCreateRefCustomerField')
.waitForElementVisible('@modealCreateRefCustomerOpen')
.waitForElementVisible('@modalCreateRefCustomerInput')
.setValue('@modalCreateRefCustomerInput', userQuery)
.waitForElementVisible('@modealCreateRefDDOption')
.click('@modealCreateRefDDOption')
.setValue('@modalCreateRefAccount', accountQuery)
.setValue('@modalCreateRefTitle', title)
.setValue('@modalCreateRefDescription', description)
.click('@modalCreateRefSubmit');
if (waitToHide) {
this.waitForElementNotPresent('@modalCreateRefModal');
this.api.pause(1500);
}
return this;
},
signOut() {
this
.waitForElementVisible('@signOutLink')
.click('@signOutLink');
return this.waitForElementNotPresent('@signOutLink');
}
};
export default {
url: 'http://localhost:8080/#/',
commands: [ mainCommands ],
elements: {
instancesListDescription: {
selector: '//div[@class="description-field col-flex-1"]',
signOutLink: {
selector: '//li/a[text()=\'Sign Out\']',
locateStrategy: 'xpath'
}
},
modalCreateAccountHook: {
selector: '//div/button[1][text()=\'Create Account\']',
locateStrategy: 'xpath'
},
modalCreateAccountModal: {
selector: '.modal-dialog'
},
modalCreateAccountForm: {
selector: 'form.account-create-form'
},
modalCreateAccountTitle: {
selector: 'form.account-create-form input[name=title]'
},
modalCreateAccountAmount: {
selector: 'form.account-create-form input[name=balance]'
},
modalCreateAccountDescription: {
selector: 'form.account-create-form textarea[name=description]'
},
modalCreateAccountSubmit: {
selector: '.modal-dialog button[type=submit]'
},
modalCreateAccountErrors: {
selector: 'form.account-create-form .inline-error-item'
},
modalCreateRefHook: {
selector: '//div/button[2][text()=\'Add 3rd Party Recipients\']',
locateStrategy: 'xpath'
},
modalCreateRefModal: {
selector: '.modal-dialog'
},
modalCreateRefForm: {
selector: 'form.account-create-ref'
},
modalCreateRefCustomerField: {
selector: 'form.account-create-ref .Select.is-searchable div.Select-input'
},
modalCreateRefCustomerInput: {
selector: 'form.account-create-ref .Select.is-searchable div.Select-input > input'
},
modealCreateRefCustomerOpen: {
selector: 'form.account-create-ref .Select.is-searchable.is-open.is-focused div.Select-menu-outer > div.Select-menu' //has-value
},
modealCreateRefDDOption: {
selector: 'form.account-create-ref .Select.is-searchable.is-open.is-focused div.Select-menu-outer > div.Select-menu > div.Select-option' //has-value
},
modalCreateRefAccount: {
selector: 'form.account-create-ref .Select:not(.is-searchable) div.Select-input'
},
modalCreateRefTitle: {
selector: 'form.account-create-ref input[name=title]'
},
modalCreateRefDescription: {
selector: 'form.account-create-ref textarea[name=description]'
},
modalCreateRefSubmit: {
selector: '.modal-dialog button[type=submit]'
},
modalCreateRefErrors: {
selector: 'form.account-create-ref .inline-error-item'
},
accountLink: {
selector: 'a[href^=\'#/account/\']'
},
firstAccountLink: {
selector: '(//a[starts-with(@href, "#/account/")])[1]',
locateStrategy: 'xpath'
},
secondAccountLink: {
selector: '(//a[starts-with(@href, "#/account/")])[2]',
locateStrategy: 'xpath'
},
}
};

View File

@@ -1,12 +1,21 @@
const loginCommands = {
login({email, pass}) {
login({ email, pass }) {
this
.waitForElementVisible('@emailInput')
.waitForElementVisible('@emailInput', 500);
this
.clearValue('@emailInput')
.setValue('@emailInput', email)
.clearValue('@passInput')
.setValue('@passInput', pass);
this.api.pause(500);
this.getValue('@emailInput', (result) => {
this.assert.equal(result.value, email);
});
return this.waitForElementVisible('@loginButton')
.click('@loginButton')
.submitForm('@loginButton');
}
@@ -27,6 +36,9 @@ export default {
},
loginButton: {
selector: 'button[type=submit]'
},
formError: {
selector: '.control-label.inline-error-item'
}
}
};

View File

@@ -1,5 +1,5 @@
const signupCommands = {
signup({fName, lName, email, pass, passConf, ssn}) {
signup({fName, lName, email, pass, passConf, ssn}, waitForNext) {
this
.waitForElementVisible('@fNameInput')
.setValue('@fNameInput', fName)
@@ -9,12 +9,15 @@ const signupCommands = {
.setValue('@passConfirmInput', passConf)
.setValue('@ssnInput', ssn);
this.api.pause(500);
this.waitForElementVisible('@signupButton')
.submitForm('@signupButton');
this.api.pause(500);
return this.waitForElementNotPresent('@fNameInput');
if (waitForNext) {
return this.waitForElementNotPresent('@signupButton');
}
return this;
}
};
@@ -43,6 +46,9 @@ export default {
signupButton: {
// selector: 'button[type=submit]'
selector: 'button[type=submit].email-sign-up-submit.btn.btn-default'
},
formError: {
selector: '.control-label.inline-error-item'
}
}
};

View File

@@ -0,0 +1,27 @@
import globals from '../e2e-globals/globals';
export default {
'@tags': ['register', 'sanity'],
'User signs up': (client) => {
const signupPage = client.page.signupPage();
const loginPage = client.page.loginPage();
const [ fName, lName, email, pass, passConf, ssn ] = '|||||'.split('|');
signupPage
.navigate()
.signup({
fName, lName, email, pass, passConf, ssn
}, false);
signupPage.expect.element('@formError').to.be.visible;
signupPage
.navigate()
.signup(globals.userData, true);
loginPage.expect.element('@emailLoginPageInput').to.be.visible;
client.end();
}
};

View File

@@ -1,19 +0,0 @@
export default {
'@tags': ['register', 'sanity'],
'User signs up': (client) => {
const page = client.page.signupPage();
const loginPage = client.page.loginPage();
const [fName, lName, email, pass, passConf, ssn] = 'Andrew|Revinsky|ar@gm.com|12345|12345|12345'.split('|');
page
.navigate()
.signup({
fName, lName, email, pass, passConf, ssn
});
loginPage.expect.element('@emailLoginPageInput').to.be.visible;
client.end();
}
};

View File

@@ -0,0 +1,32 @@
import globals from '../e2e-globals/globals';
export default {
'@tags': ['login', 'sanity'],
'User Logs in': (client) => {
const loginPage = client.page.loginPage();
const instancesPage = client.page.instancesPage();
const [email, pass] = '|'.split('|');
loginPage
.navigate()
.login({email, pass});
loginPage.expect.element('@formError').to.be.visible;
loginPage
.navigate()
.login(globals.userData);
instancesPage.expect.element('@signOutLink').to.be.visible;
instancesPage
.navigate()
.signOut();
client.assert.urlContains('/#/signin');
client.end();
}
};

View File

@@ -1,18 +0,0 @@
export default {
'@tags': ['login', 'sanity'],
'User Logs in': (client) => {
const loginPage = client.page.loginPage();
const instancesPage = client.page.instancesPage();
const [email, pass] = 'ar@gm.com|12345'.split('|');
loginPage
.navigate()
.login({email, pass});
instancesPage.expect.element('@instancesListDescription').to.be.visible;
client.end();
}
};

View File

@@ -0,0 +1,49 @@
/**
* Created by andrew on 9/28/16.
*/
import globals from '../e2e-globals/globals';
export default {
'@tags': ['create accounts', 'sanity'],
'User Creates Accounts': (client) => {
const loginPage = client.page.loginPage();
const instancesPage = client.page.instancesPage();
const [ title, amount, description ] = '||'.split('|');
loginPage
.navigate()
.login(globals.userData);
instancesPage
.navigate()
.createAccount({ title, amount, description }, false);
instancesPage.expect.element('@modalCreateAccountErrors').to.be.visible;
instancesPage
.createAccount(globals.accountOne, true);
instancesPage.expect.element('@modalCreateAccountErrors').to.not.be.present;
instancesPage.expect.element('@modalCreateAccountForm').to.not.be.present;
instancesPage.expect.element('@accountLink').to.be.visible;
instancesPage.expect.element('@firstAccountLink').to.be.visible;
instancesPage.expect.element('@secondAccountLink').to.not.be.present;
instancesPage.expect.element('@firstAccountLink').text.to.contain(globals.accountOne.title);
instancesPage
.createAccount(globals.accountTwo, true);
instancesPage.expect.element('@firstAccountLink').to.be.visible;
instancesPage.expect.element('@secondAccountLink').to.be.visible;
instancesPage.expect.element('@firstAccountLink').text.to.contain(globals.accountOne.title);
instancesPage.expect.element('@secondAccountLink').text.to.contain(globals.accountTwo.title);
client.end();
}
};

View File

@@ -0,0 +1,60 @@
/**
* Created by andrew on 9/28/16.
*/
import globals from '../e2e-globals/globals';
export default {
'@tags': ['create 3rd party accounts', 'sanity'],
'User Creates 3rd Party Accounts': (client) => {
const loginPage = client.page.loginPage();
const signupPage = client.page.signupPage();
const instancesPage = client.page.instancesPage();
// Step 1: Setup 3rd Party & Accounts
signupPage
.navigate();
client.assert.urlContains('/#/register');
signupPage
.signup(globals.otherUserData, true);
client.assert.urlContains('/#/signin');
loginPage
.navigate()
.login(globals.otherUserData);
const [ userQuery, accountQuery, title, description ] = '|||'.split('|');
instancesPage
.navigate()
.createRef({ userQuery, accountQuery, title, description }, false);
instancesPage.expect.element('@modalCreateRefErrors').to.be.visible;
instancesPage.expect.element('@modalCreateRefForm').to.be.visible;
const [ refAccountTitle, refAccountDescription ] = 'Johns`s Initial Account|Johns`s Initial Account'.split('|');;
instancesPage
.createRef({
userQuery: globals.userData.email,
accountQuery: globals.accountOne.title,
title: refAccountTitle,
description: refAccountDescription
}, true);
instancesPage.expect.element('@modalCreateRefErrors').to.not.be.present;
instancesPage.expect.element('@modalCreateRefForm').to.not.be.present;
instancesPage.expect.element('@accountLink').to.be.visible;
instancesPage.expect.element('@firstAccountLink').to.be.visible;
instancesPage.expect.element('@secondAccountLink').to.not.be.present;
instancesPage.expect.element('@firstAccountLink').text.to.contain(refAccountTitle);
client.end();
}
};