TwoToc code
[YouAndWeb_TwoToc] / e2e / account / signup / signup.po.js
1 /**
2  * This file uses the Page Object pattern to define the main page for tests
3  * https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
4  */
5
6 'use strict';
7
8 var SignupPage = function() {
9   this.form = element(by.css('.form'));
10   this.form.name = this.form.element(by.model('user.name'));
11   this.form.email = this.form.element(by.model('user.email'));
12   this.form.password = this.form.element(by.model('user.password'));
13   this.form.submit = this.form.element(by.css('.btn-register'));
14
15   this.signup = function(data) {
16     for (var prop in data) {
17       var formElem = this.form[prop];
18       if (data.hasOwnProperty(prop) && formElem && typeof formElem.sendKeys === 'function') {
19         formElem.sendKeys(data[prop]);
20       }
21     }
22
23     this.form.submit.click();
24   };
25 };
26
27 module.exports = new SignupPage();
28