TwoToc code
[YouAndWeb_TwoToc] / e2e / account / signup / signup.po.js
diff --git a/e2e/account/signup/signup.po.js b/e2e/account/signup/signup.po.js
new file mode 100755 (executable)
index 0000000..3a496c6
--- /dev/null
@@ -0,0 +1,28 @@
+/**
+ * This file uses the Page Object pattern to define the main page for tests
+ * https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
+ */
+
+'use strict';
+
+var SignupPage = function() {
+  this.form = element(by.css('.form'));
+  this.form.name = this.form.element(by.model('user.name'));
+  this.form.email = this.form.element(by.model('user.email'));
+  this.form.password = this.form.element(by.model('user.password'));
+  this.form.submit = this.form.element(by.css('.btn-register'));
+
+  this.signup = function(data) {
+    for (var prop in data) {
+      var formElem = this.form[prop];
+      if (data.hasOwnProperty(prop) && formElem && typeof formElem.sendKeys === 'function') {
+        formElem.sendKeys(data[prop]);
+      }
+    }
+
+    this.form.submit.click();
+  };
+};
+
+module.exports = new SignupPage();
+