Skip to content

Commit

Permalink
test(add): add chats sidebar and marketplace tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed May 28, 2024
1 parent 886ec56 commit 74b2730
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 299 deletions.
31 changes: 17 additions & 14 deletions cypress/e2e/01-pin-input.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,41 @@ describe("Create Account and Login Tests", () => {
loginPinPage.launchApplication();
});

it("Enter valid PIN redirects to Main Page", () => {
it("A1, A9, A11 - Enter valid PIN redirects to Main Page", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.enterPin("1234");
loginPinPage.clickConfirm();
loginPinPage.pinButtonConfirm.click();
preLoadingPage.validateLoadingHeader();
preLoadingPage.validateLoadingMessage();
preLoadingPage.validateURL();
chatsMainPage.validateAddSomeoneIsShown();
chatsMainPage.validateURL();
cy.location("href").should("include", "/pre");
chatsMainPage.addSomeone.should("exist");
cy.location("href").should("include", "/chat");
});

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

it("Pin cannot have more than 8 digits", () => {
it("A3 - 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", () => {
it("A4 - Clicking red reset button should erase any inputs made", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.enterPin("12345678");
loginPinPage.clickClearPin();
loginPinPage.clearInputButton.click();
loginPinPage.pinDotFilled.should("have.length", 0);
});

it("Settings dropdown should show option to Scramble numberpad and option to stay unlocked", () => {
it("A5 - Settings dropdown should show option to Scramble numberpad and option to stay unlocked", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.goToSettings();
Expand All @@ -53,7 +53,7 @@ describe("Create Account and Login Tests", () => {
.and("contain", "Stay unlocked?");
});

it("Scramble Keypad will change the order of pin input buttons", () => {
it("A6, A7 - Scramble Keypad will change the order of pin input buttons", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.goToSettings();
Expand All @@ -70,16 +70,19 @@ describe("Create Account and Login Tests", () => {
.should("not.eq", "1,2,3,4,5,6,7,8,9,0");
});

it("User can see menu to switch to a different profile", () => {
// Cannot be automated at this moment
xit("A8 - If Stay Unlocked is toggled on, user should bypass PIN page when logging in", () => {});

it("A10 - User can see menu to switch to a different profile", () => {
loginPinPage.launchApplication();
loginPinPage.waitUntilPageIsLoaded();
loginPinPage.clickChangeUser();
loginPinPage.changeUserButton.click();
loginPinPage.selectProfileModal.should("be.visible");
loginPinPage.selectProfileLabel.should("have.text", "Profiles");
loginPinPage.selectProfileUserName.eq(0).should("have.text", "Space Kev");
loginPinPage.selectProfileUserName.eq(1).should("have.text", "Sara Saturn");
});

// Cannot be automated at this moment
xit("If Stay Unlocked is toggled on, user should bypass PIN page when logging in", () => {});
xit("A12 - If incorrect pin is entered, error message should be displayed", () => {});
});
169 changes: 2 additions & 167 deletions cypress/e2e/02-friends.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,173 +9,8 @@ describe("Chat Page Tests", () => {
chatsMainPage.validateChatsMainPageIsShown();
});

it("Add Friends should navigate to Friends Page", () => {
chatsMainPage.clickAddFriends();
it("B1, B2 - Add Friends should navigate to Friends Page", () => {
chatsMainPage.buttonAddFriends.click();
cy.location("href").should("include", "/friends");
});

// Cannot be automated at this moment
xit("User should land on this page after logging in", () => {});

// Cannot be automated at this moment
xit("Clicking Add Friends should navigate you to Friends page", () => {});

// Cannot be automated at this moment
xit("Messages are secured by end-to-end encryption, sent over a peer-to-peer network should be displayed at the top of every chat", () => {});

// Cannot be automated at this moment
xit("Amount of coin should be displayed at top right toolbar", () => {});

// Cannot be automated at this moment
xit("Highlighted border should appear around call button when clicked", () => {});

// Cannot be automated at this moment
xit("Highlighted border should appear around Video button when clicked", () => {});

// Cannot be automated at this moment
xit("Favorite button should should be highlighted after clicked and grey when unclicked", () => {});

// Cannot be automated at this moment
xit("Clicking Profile button in 1on1 chat should display the friends profile", () => {});

// Cannot be automated at this moment
xit("Friends profile should display friends profile picture", () => {});

// Cannot be automated at this moment
xit("Friends profile should display friends status (wether you are friends or not)", () => {});

// Cannot be automated at this moment
xit("Friends profile should display friends Username", () => {});

// Cannot be automated at this moment
xit("Friends profile should display friends profile Status", () => {});

// Cannot be automated at this moment
xit("User should be able to write a note on friends profile", () => {});

// Cannot be automated at this moment
xit("Highlighted border should appear when user clicks into Notes textbox", () => {});

// Cannot be automated at this moment
xit("Clicking Groups button should display group members of the chat", () => {});

// Cannot be automated at this moment
xit("Timestamp appears after most recent message sent", () => {});

// Cannot be automated at this moment
xit("Users profile picture appears next to messages sent", () => {});

// Cannot be automated at this moment
xit("Context menu appears when user right clicks a message", () => {});

// Cannot be automated at this moment
xit("When user clicks their own message context menu should display Top 5 Most Used Emojis, Pin Message, Reply, React, Copy, Edit, Delete", () => {});

// Cannot be automated at this moment
xit("Clicking Pin Message should pin message in chat", () => {});

// Cannot be automated at this moment
xit("Clicking Reply should open reply modal", () => {});

// Cannot be automated at this moment
xit("Clicking React should open up emoji menu", () => {});

// Cannot be automated at this moment
xit("Clicking Copy should copy text to users clipboard", () => {});

// Cannot be automated at this moment
xit("Clicking Edit should open up the edit message modal", () => {});

// Cannot be automated at this moment
xit("Clicking Delete should delete message from chat", () => {});

// Cannot be automated at this moment
xit("Clicking the X next to a friend in the GroupMembers Modal should remove friend from groupchat", () => {});

// Cannot be automated at this moment
xit("Clicking the Settings button should open the Group Chat Settings", () => {});

// Cannot be automated at this moment
xit("Highlighted border should appear after clicking into the GroupName input box in GroupChat Settings", () => {});

// Cannot be automated at this moment
xit("User can change name off the group", () => {});

// Cannot be automated at this moment
xit("Highlighted border should appear after clicking into the GroupDescription input box in GroupChat Settings", () => {});

// Cannot be automated at this moment
xit("User should be able to edit the description of the group", () => {});

// Cannot be automated at this moment
xit("User can toggle on/off Add Members", () => {});

// Cannot be automated at this moment
xit("User can toggle on/off ChangePhoto", () => {});

// Cannot be automated at this moment
xit("User can toggle on/off Change Details", () => {});

// Cannot be automated at this moment
xit("Highlighted border should appear around textbox in chat when user clicks into it", () => {});

// Cannot be automated at this moment
xit("User should already be clicked into textbox when they enter a chat", () => {});

// Cannot be automated at this moment
xit("User should not be able to send a blank message (Send button should be greyed out until any text is added into the textbox)", () => {});

// Cannot be automated at this moment
xit("Clicking Send Coin should open the modal", () => {});

// Cannot be automated at this moment
xit("Amount should be displayed at the top of Send Coin modal and user should be able to click into it and change amount", () => {});

// Cannot be automated at this moment
xit("Only numbers should be able to be inputed in Send Coin modal", () => {});

// Cannot be automated at this moment
xit("Highlighted border should appear when user clicks into Notes textbox in the Send Coin modal", () => {});

// Cannot be automated at this moment
xit("Recipients should appear in recipients box as they are added in Send Coin Modal", () => {});

// Cannot be automated at this moment
xit("Clicking the X should clear user from recipients box in Send Coin Modal", () => {});

// Cannot be automated at this moment
xit("Highlited border should appear around selected user", () => {});

// Cannot be automated at this moment
xit("Scrollbar should appear if uesr has enough friends for it in Send Coin Modal", () => {});

// Cannot be automated at this moment
xit("User should have to hold confirm for 3 seconds to send payment in Send Coin Modal", () => {});

// Cannot be automated at this moment
xit("Clicking Cancel should close Send Coin modal", () => {});

// Cannot be automated at this moment
xit("The chat typing indicator should be displayed when user is typing", () => {});

// Cannot be automated at this moment
xit("Scroll to bottom button should appear after scrolling up 2 messages", () => {});

// Cannot be automated at this moment
xit("Number of reactions should be displayed underneath message", () => {});

// Cannot be automated at this moment
xit("Markdown should show when typing in chatbar", () => {});

// Cannot be automated at this moment
xit("User should be able to click on image in chat to see image preview", () => {});

// Cannot be automated at this moment
xit("Uesr can download media from chat by clicking download", () => {});

// Cannot be automated at this moment
xit("User should be able to view a video through the embedded video player", () => {});

// Cannot be automated at this moment
xit("Messages should be limited to 2048 chars", () => {});
});
88 changes: 41 additions & 47 deletions cypress/e2e/03-chats-sidebar.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,78 +9,72 @@ describe("Chats Sidebar Tests", () => {
chatsMainPage.validateChatsMainPageIsShown();
});

// To be automated
xit("Clicking Create Chat should open modal with option for Group Name and Group Members", () => {});
it("C1 - Clicking Create Chat should open modal with option for Group Name and Group Members", () => {
chatsMainPage.buttonCreateGroupChat.click();
chatsMainPage.createGroupModal.should("be.visible");
chatsMainPage.createGroupLabelGroupName.should("have.text", "Group Name:");
chatsMainPage.createGroupInputGroupName.should("be.visible");
chatsMainPage.createGroupLabelGroupMembers.should(
"have.text",
"Group Members:",
);
chatsMainPage.createGroupLabelSelectMembers.should(
"have.text",
"Select member(s)",
);
chatsMainPage.createGroupButton.should("be.visible");
});

it("Hovering over Create Chat should show tooltips", () => {
chatsMainPage.hoverCreateGroupChatButton();
it("C2 - Hovering over Create Chat should show tooltips", () => {
chatsMainPage.buttonCreateGroupChat.realHover();
chatsMainPage.buttonCreateGroupChat.should(
"have.attr",
"data-tooltip",
"Create Chat",
);
});

it("Hovering over Nav buttons should show tooltips", () => {
chatsMainPage.hoverWalletButton();
it("C3 - Hovering over Nav buttons should show tooltips", () => {
chatsMainPage.buttonWallet.realHover();
chatsMainPage.buttonWallet.should("have.attr", "data-tooltip", "Wallet");
chatsMainPage.hoverFilesButton();
chatsMainPage.buttonFiles.realHover();
chatsMainPage.buttonFiles.should("have.attr", "data-tooltip", "Files");
chatsMainPage.hoverChatsButton();
chatsMainPage.buttonChat.realHover();
chatsMainPage.buttonChat.should("have.attr", "data-tooltip", "Chat");
chatsMainPage.hoverFriendsButton();
chatsMainPage.buttonFriends.realHover();
chatsMainPage.buttonFriends.should("have.attr", "data-tooltip", "Friends");
chatsMainPage.hoverSettingsButton();
chatsMainPage.buttonSettings.realHover();
chatsMainPage.buttonSettings.should(
"have.attr",
"data-tooltip",
"Settings",
);
});

// To be automated
xit("Clicking hamburger button should collapse sidebar", () => {});
it("C4 - Clicking hamburger button should collapse sidebar", () => {
chatsMainPage.buttonHideSidebar.click();
chatsMainPage.sidebar.should("not.be.visible");
chatsMainPage.buttonShowSidebar.click();
chatsMainPage.sidebar.should("be.visible");
});

it("Nav bar buttons should redirect to correct page", () => {
chatsMainPage.clickWallet();
it("C5, C6, C7, C8, C9 - Nav bar buttons should redirect to correct page", () => {
chatsMainPage.buttonWallet.click();
cy.url().should("include", "/wallet");
chatsMainPage.clickFiles();
chatsMainPage.buttonFiles.click();
cy.url().should("include", "/files");
chatsMainPage.clickChat();
chatsMainPage.buttonChat.click();
cy.url().should("include", "/chat");
chatsMainPage.clickFriends();
chatsMainPage.buttonFriends.click();
cy.url().should("include", "/friends");
chatsMainPage.clickSettings();
chatsMainPage.buttonSettings.click();
cy.url().should("include", "/settings/profile");
});

// To be automated
xit("Textbox should have highlighted border when clicking into Chat Search", () => {});

// Cannot be automated at this moment
xit("ProfilePicFrame should display for any friends that have one", () => {});

// Cannot be automated at this moment
xit("Favorites should appear on left side of Sidebar", () => {});

// Cannot be automated at this moment
xit("Number of members in group should appear on that chat in both Sidebar and Favorites", () => {});

// Cannot be automated at this moment
xit("Clicking a favorite should take you to that chat ", () => {});

// Cannot be automated at this moment
xit("Right clicking a chat in sidebar should open context menu", () => {});

// Cannot be automated at this moment
xit("Context menu should display: Favorite, Hide, Mark as read", () => {});

// Cannot be automated at this moment
xit("Timestamp of most recent message sent or received in chat should be displayed in the sidebar", () => {});

// Cannot be automated at this moment
xit("Typing indicator should be displayed around users profile picture when they are typing (this applys to favorites as well)", () => {});

// Cannot be automated at this moment
xit("After selecting Hide chat chat should no longer be displayed in sidebar", () => {});
it("C10 - Textbox should have highlighted border when clicking into Chat Search", () => {
chatsMainPage.inputSidebarSearch.click().type("test");
chatsMainPage.inputSidebarSearch
.parents(".input-group")
.should("have.css", "border-color", "rgb(215, 226, 255)");
});
});
16 changes: 16 additions & 0 deletions cypress/e2e/04-marketplace.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { chatsMainPage } from "./PageObjects/ChatsMain";
import { loginPinPage } from "./PageObjects/LoginPin";
import { preLoadingPage } from "./PageObjects/PreLoading";

describe("Marketplace Tests", () => {
beforeEach(() => {
loginPinPage.loginWithPin("1234");
preLoadingPage.validatePreLoadingPage();
chatsMainPage.validateChatsMainPageIsShown();
});

it("D1 - Marketplace modal should appear when user clicks Marketplace", () => {
chatsMainPage.buttonMarketplace.click();
cy.contains("Uplink Marketplace").should("exist");
});
});
Loading

0 comments on commit 74b2730

Please sign in to comment.