Skip to content
Snippets Groups Projects
Commit 141510b0 authored by Håvard Farestveit's avatar Håvard Farestveit
Browse files

Refactored boundary test for user registration

Refactored boundary tests
parent 36d70178
No related branches found
No related tags found
No related merge requests found
Pipeline #114759 failed
......@@ -119,63 +119,63 @@ describe("Register new user", () => {
cy.get(".alert").contains("Registration failed!");
});
it("Checking for boundary error with country", () => {
it("Valid max length country", () => {
cy.register();
cy.get("#form-register-user").within(($form) => {
cy.get('input[name="username"]').type("testUser" + Date.now());
cy.get('input[name="email"]').type("test@mail.it");
cy.get('input[name="password"]').type("123456789");
cy.get('input[name="password1"]').type("123456789");
cy.get('input[name="country"]').type("x".repeat(51));
cy.get('input[name="country"]').type("x".repeat(50));
cy.get('input[name="city"]').type("Testheim");
cy.get('input[name="street_address"]').type("Testing street");
});
cy.get("#btn-create-account").click();
cy.contains("Registration failed!");
cy.url().should("include", "/workouts.html");
});
it("Checking for boundry error with street", () => {
it("Too long country", () => {
cy.register();
cy.get("#form-register-user").within(($form) => {
cy.get('input[name="username"]').type("testUser" + Date.now());
cy.get('input[name="email"]').type("test@mail.it");
cy.get('input[name="password"]').type("123456789");
cy.get('input[name="password1"]').type("123456789");
cy.get('input[name="street_address"]').type("x".repeat(51));
cy.get('input[name="country"]').type("x".repeat(51));
cy.get('input[name="city"]').type("Testheim");
cy.get('input[name="street_address"]').type("Testing street");
});
cy.get("#btn-create-account").click();
cy.contains("Registration failed!");
});
it("Checking for max length boundary for country", () => {
it("Valid Max lenth street", () => {
cy.register();
cy.get("#form-register-user").within(($form) => {
cy.get('input[name="username"]').type("testUser" + Date.now());
cy.get('input[name="email"]').type("test@mail.it");
cy.get('input[name="password"]').type("123456789");
cy.get('input[name="password1"]').type("123456789");
cy.get('input[name="country"]').type("x".repeat(50));
cy.get('input[name="city"]').type("Testheim");
cy.get('input[name="street_address"]').type("Testing street");
cy.get('input[name="street_address"]').type("x".repeat(50));
});
cy.get("#btn-create-account").click();
cy.contains("View Workouts");
cy.url().should("include", "/workouts.html");
});
it("Checking for max boundary with street", () => {
it("Too long street", () => {
cy.register();
cy.get("#form-register-user").within(($form) => {
cy.get('input[name="username"]').type("testUser" + Date.now());
cy.get('input[name="email"]').type("test@mail.it");
cy.get('input[name="password"]').type("123456789");
cy.get('input[name="password1"]').type("123456789");
cy.get('input[name="street_address"]').type("x".repeat(50));
cy.get('input[name="street_address"]').type("x".repeat(51));
});
cy.get("#btn-create-account").click();
cy.contains("View Workouts");
cy.contains("Registration failed!");
});
it("Checking for boundry error with phone number", () => {
it("Too long phone number", () => {
cy.register();
cy.get("#form-register-user").within(($form) => {
cy.get('input[name="username"]').type("testUser" + Date.now());
......@@ -188,7 +188,7 @@ describe("Register new user", () => {
cy.contains("Registration failed!");
});
it("Checking for max length boundary with phone number", () => {
it("Valid max length phone number", () => {
cy.register();
cy.get("#form-register-user").within(($form) => {
cy.get('input[name="username"]').type("testUser" + Date.now());
......@@ -198,6 +198,6 @@ describe("Register new user", () => {
cy.get('input[name="street_address"]').type("x".repeat(50));
});
cy.get("#btn-create-account").click();
cy.contains("View Workouts");
cy.url().should("include", "/workouts.html");
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment