Skip to content

Commit

Permalink
Merge branch 'main' into luis/playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm authored May 25, 2024
2 parents afdea0b + b671f98 commit 3fef1aa
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 6 deletions.
35 changes: 31 additions & 4 deletions cypress/e2e/01-pin-input.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { chatsMainPage } from "./PageObjects/ChatsMain";
import { loginPinPage } from "./PageObjects/LoginPin";
import { preLoadingPage } from "./PageObjects/PreLoading";

describe("Pin Screen", () => {
describe("Create Account and Login Tests", () => {
beforeEach(() => {
loginPinPage.launchApplication();
});

it("Enter Pin Screen - Enter valid PIN", () => {
it("Enter valid PIN redirects to Main Page", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.enterPin("1234");
Expand All @@ -19,14 +19,41 @@ describe("Pin Screen", () => {
chatsMainPage.validateURL();
});

it("Enter Pin Screen - Enter PIN with 3 digits", () => {
it("Pin should have at least 4 digits", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.enterPin("123");
loginPinPage.validateConfirmButtonIsDisabled();
});

it("Enter Pin Screen - Scramble Keypad", () => {
it("Pin cannot have more than 8 digits", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.enterPin("12345678901234");
loginPinPage.pinDotFilled.should("have.length", 8);
});

it("Clicking red reset button should erase any inputs made", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.enterPin("12345678");
loginPinPage.clickClearPin();
loginPinPage.pinDotFilled.should("have.length", 0);
});

it("Settings dropdown should show option to Scramble numberpad and option to stay unlocked", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.goToSettings();
loginPinPage.scrambleKeypadLabel
.should("exist")
.and("contain", "Scramble keypad?");
loginPinPage.stayUnlockedLabel
.should("exist")
.and("contain", "Stay unlocked?");
});

it("Scramble Keypad will change the order of pin input buttons", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.goToSettings();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/PageObjects/ChatsMain.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ChatsMainPage {
get addSomeone() {
return cy.get(".add-someone");
return cy.get(".add-someone", { timeout: 30000 });
}

public validateAddSomeoneIsShown() {
Expand Down
24 changes: 24 additions & 0 deletions cypress/e2e/PageObjects/LoginPin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
class LoginPinPage {
get clearInputButton() {
return cy.getByTestAttr("button-clear-input");
}

get labelChooseEnterPin() {
return cy.getByTestAttr("label-choose-enter-pin");
}

get pinButton0() {
return cy.getByTestAttr("button-pin-0");
}
Expand Down Expand Up @@ -43,6 +51,18 @@ class LoginPinPage {
return cy.getByTestAttr("button-confirm-pin");
}

get pinDisplay() {
return cy.getByTestAttr("pin-display");
}

get pinDot() {
return cy.getByTestAttr("pin-dot-filled");
}

get pinDotFilled() {
return cy.getByTestAttr("pin-dot-filled");
}

get pinKeypad() {
return cy.getByTestAttr("pin-keypad", { timeout: 30000 });
}
Expand All @@ -67,6 +87,10 @@ class LoginPinPage {
return cy.getByTestAttr("button-settings");
}

public clickClearPin() {
this.clearInputButton.click();
}

public clickConfirm() {
this.pinButtonConfirm.click();
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/PageObjects/PreLoading.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class PreLoadingPage {
get loadingHeader() {
return cy.get(".small");
return cy.get(".small", { timeout: 30000 });
}

get loadingMessage() {
Expand Down

0 comments on commit 3fef1aa

Please sign in to comment.