Skip to content

Commit

Permalink
Merge pull request #22 from Satellite-im/luis/tests
Browse files Browse the repository at this point in the history
test(add): add tests and increase timeout
  • Loading branch information
luisecm authored Jun 3, 2024
2 parents 73603a3 + 4ffedb5 commit e2235f0
Show file tree
Hide file tree
Showing 21 changed files with 762 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineConfig({
e2e: {
baseUrl: "http://localhost:5173",
video: true,
defaultCommandTimeout: 15000,
defaultCommandTimeout: 30000,
setupNodeEvents(on, config) {
on(
"after:spec",
Expand Down
68 changes: 66 additions & 2 deletions cypress/e2e/02-friends.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,79 @@ import { authNewAccount } from "./PageObjects/AuthNewAccount";
import { chatsMainPage } from "./PageObjects/ChatsMain";
import { loginPinPage } from "./PageObjects/LoginPin";

describe("Chat Page Tests", () => {
describe("Friends Tests", () => {
beforeEach(() => {
loginPinPage.loginWithPin("1234");
authNewAccount.createRandomUser();
chatsMainPage.validateChatsMainPageIsShown();
});

it("B1, B2 - Add Friends should navigate to Friends Page", () => {
it("H1 - Clicking All should take you to All page within Friends", () => {
chatsMainPage.buttonAddFriends.click();
cy.location("href").should("include", "/friends");
});

it.skip("H2 - Clicking Active should take you to Active page within Friends", () => {
// Test code for H2
});

it.skip("H3 - Clicking Blocked should take you to Blocked page within Friends", () => {
// Test code for H3
});

it.skip("H4 - Highlighted border should appear after clicking into Add Someone input box", () => {
// Test code for H4
});

it.skip("H5 - User should not be able to click Add until they have pasted did:key", () => {
// Test code for H5
});

it.skip("H7 - Checkmark with Request Dispatched! Your request is making its way should appear after adding a user", () => {
// Test code for H7
});

it.skip("H8 - Green border should appear around Add Someone textbox when user pastes a correct did:key into the input box", () => {
// Test code for H8
});

it.skip("H10 - Highlighted border should appear when clicking into the Search Friends input box", () => {
// Test code for H10
});

it.skip("H11 - Clicking the Copy button should copy your personal did:key", () => {
// Test code for H11
});

it.skip("H12 - Friends should be listed in alphabetical order", () => {
// Test code for H12
});

it.skip("H13 - Incoming friend requests should be listed by Newest to Oldest", () => {
// Test code for H13
});

it.skip("H14 - Outgoing friend requests should be listed by last sent", () => {
// Test code for H14
});

it.skip("H15 - Blocked users should be displayed alphabetically", () => {
// Test code for H15
});

it.skip("H16 - User should be removed from friends list after clicking unfriend", () => {
// Test code for H16
});

it.skip("H17 - Clicking block should block user", () => {
// Test code for H17
});

it.skip("H18 - User should be displayed under Blocked Users after you block them", () => {
// Test code for H18
});

it.skip("H19 - User should be cleared from Blocked Users after you unblock them", () => {
// Test code for H19
});
});
36 changes: 36 additions & 0 deletions cypress/e2e/04-marketplace.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,40 @@ describe("Marketplace Tests", () => {
chatsMainPage.buttonMarketplace.click();
cy.contains("Uplink Marketplace").should("exist");
});

it.skip("D2 - Clicking Blundles & Packs should navigate you to said page", () => {
// Test code for D2
});

it.skip("D3 - Clicking Staff Picks should navigate you to said page", () => {
// Test code for D3
});

it.skip("D4 - Clicking Recently Updated should navigate you to said page", () => {
// Test code for D4
});

it.skip("D5 - Clicking Most Downloaded should navigate you to said page", () => {
// Test code for D5
});

it.skip("D6 - Clicking Newly Added should navigate you to said page", () => {
// Test code for D6
});

it.skip("D7 - Clicking Community Upgrades should navigate you to said page", () => {
// Test code for D7
});

it.skip("D8 - Clicking Extensions should navigate you to said page", () => {
// Test code for D8
});

it.skip("D9 - Clicking Themes should navigate you to said page", () => {
// Test code for D9
});

it.skip("D10 - Clicking Stickers & Emotes should navigate you to said page", () => {
// Test code for D10
});
});
25 changes: 23 additions & 2 deletions cypress/e2e/05-settings-profile.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { chatsMainPage } from "./PageObjects/ChatsMain";
import { loginPinPage } from "./PageObjects/LoginPin";
import { authNewAccount } from "./PageObjects/AuthNewAccount";
import { settingsProfile } from "./PageObjects/Settings/SettingsProfile";
import { friendsPage } from "./PageObjects/Friends";

describe("Settings Profile Tests", () => {
beforeEach(() => {
Expand Down Expand Up @@ -59,6 +60,13 @@ describe("Settings Profile Tests", () => {
});

it("I7 - UsernameID should be displayed next to username", () => {
// Go to friends and copy short ID
chatsMainPage.buttonFriends.click();
cy.location("href").should("include", "/friends");
friendsPage.buttonCopyID.rightclick();
friendsPage.contextOptionCopyID.click();
chatsMainPage.goToSettings();

// Short ID button tooltip shows "Copy"
settingsProfile.inputSettingsProfileShortIDGroup.realHover();
settingsProfile.inputSettingsProfileShortIDGroup.should(
Expand All @@ -67,8 +75,21 @@ describe("Settings Profile Tests", () => {
"Copy",
);

// Value displayed on Short ID is hardcoded
settingsProfile.inputSettingsProfileShortID.should("have.value", "xxxxxx");
cy.window().then(async (win) => {
const text = await win.navigator.clipboard.readText();
const statusText = String(text);
// Extract the last 8 characters
const last8Chars = statusText.slice(-8);
// Store the last 8 characters in a Cypress alias
cy.wrap(last8Chars).as("last8Chars");
});

cy.get("@last8Chars").then((last8Chars) => {
settingsProfile.inputSettingsProfileShortID.should(
"have.value",
last8Chars,
);
});
});

xit("I9 - User should be able to click into username textbox and change username", () => {});
Expand Down
25 changes: 25 additions & 0 deletions cypress/e2e/06-settings-invetory.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
describe("Settings - Inventory", () => {
it.skip("J1 - Page should display items purchased from Marketplace", () => {
// Test code for J1
});

it.skip("J2 - After user selects Profile Picture Frame it should be properly displayed everywhere in the app where the user's profile picture appears", () => {
// Test code for J2
});

it.skip("J3 - Equip button should change to Equipped and highlighted after selection", () => {
// Test code for J3
});

it.skip("J4 - Equipped Frame should be displayed in Frame within the Equipped Items", () => {
// Test code for J4
});

it.skip("J5 - Clicking Unequip should unequip item", () => {
// Test code for J5
});

it.skip("J6 - After item is unequipped it should no longer be displayed in Equipped Items", () => {
// Test code for J6
});
});
57 changes: 57 additions & 0 deletions cypress/e2e/07-settings-customization.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
describe("Settings - Customization", () => {
it.skip("K1 - Language dropdown should display English", () => {
// Test code for K1
});

it.skip("K2 - Font dropdown should show: Poppins, SpaceMono, ChakraPetch, Confortaa, Dosis, IBMPlexMono, IndieFlower, JosefinSans, Noto, SourceCodePro, SpaceGrotesk, MajorMono, MerriWeather, PoiretOne, OpenDyslexic", () => {
// Test code for K2
});

it.skip("K3 - Selected Fonts should be applied everywhere throughout the app", () => {
// Test code for K3
});

it.skip("K4 - Clicking OpenFolder should open the Fonts folder", () => {
// Test code for K4
});

it.skip("K5 - Font size should have a minimum of .82", () => {
// Test code for K5
});

it.skip("K6 - Font size should have a maximum of 1.50", () => {
// Test code for K6
});

it.skip("K7 - Font size should be applied correctly everywhere through the app", () => {
// Test code for K7
});

it.skip("K8 - Clicking the moon button should change theme of the app from Dark to Light", () => {
// Test code for K8
});

it.skip("K9 - Themes dropdown should display Default", () => {
// Test code for K9
});

it.skip("K10 - Themes folder button should open the themes folder", () => {
// Test code for K10
});

it.skip("K11 - Primary Colors should display: Neo Orbit, Creamy Peach, Neon Sunflower, TV Character Purple, Traffic cone, Fire House, Purple Mountain Majesty, Rogue Pink, Squeaky, Apple Valley, Pencil Lead", () => {
// Test code for K11
});

it.skip("K12 - Clicking Pick should open up the finetune color selector", () => {
// Test code for K12
});

it.skip("K13 - Selected primary color should be applied throughout the entire app", () => {
// Test code for K13
});

it.skip("K14 - User should be able to add additional custom CSS to the application", () => {
// Test code for K14
});
});
13 changes: 13 additions & 0 deletions cypress/e2e/08-settings-messages.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
describe("Settings - Messages", () => {
it.skip("L1 - User should be able to toggle on and off emoji conversion", () => {
// Test code for L1
});

it.skip("L2 - User should be able to toggle on and off Markdown support", () => {
// Test code for L2
});

it.skip("L3 - User should be able to toggle on and off emoji Spam/Bot detection & rejection", () => {
// Test code for L3
});
});
37 changes: 37 additions & 0 deletions cypress/e2e/09-settings-audio-video.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
describe("Settings - Audio & Video", () => {
it.skip("M1 - Input dropdown should show available input devices", () => {
// Test code for M1
});

it.skip("M2 - Volume indicator should display volume level of microphone input when sound is detected", () => {
// Test code for M2
});

it.skip("M3 - Output device dropdown should show all available output devices", () => {
// Test code for M3
});

it.skip("M4 - Volume indicator should display volume level of speaker output when sound is played", () => {
// Test code for M4
});

it.skip("M5 - User should be able to toggle on and off Echo Cancellation", () => {
// Test code for M5
});

it.skip("M6 - User should be able to toggle on and off Interface Sounds", () => {
// Test code for M6
});

it.skip("M7 - User should be able to toggle on and off Control Sounds", () => {
// Test code for M7
});

it.skip("M8 - User should be able to toggle on and off Message Sounds", () => {
// Test code for M8
});

it.skip("M9 - User should be able to toggle on and off Call Timer", () => {
// Test code for M9
});
});
13 changes: 13 additions & 0 deletions cypress/e2e/10-settings-extensions.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
describe("Settings - Extensions", () => {
it.skip("N1 - User should land on Installed when navigating to this page", () => {
// Test code for N1
});

it.skip("N2 - Clicking Explore should take user to Explore page", () => {
// Test code for N2
});

it.skip("N3 - Clicking Settings should take user to Settings page", () => {
// Test code for N3
});
});
41 changes: 41 additions & 0 deletions cypress/e2e/11-settings-keybindings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
describe("Settings - Keybindings", () => {
it.skip('O1 - Message at top of page should display: "Global keybinds are disabled while on this page."', () => {
// Test code for O1
});

it.skip("O2 - Clicking a key should activate the Recorded Keys", () => {
// Test code for O2
});

it.skip("O3 - Action dropdown should display: Increase font size within Uplink, Decrease font size within Uplink, Mute & un-mute your microphone, Toggle turning off all sounds including your microphone and headphones, Open/Close Web Inspector, Toggle Developer Mode, Hide/Focus Uplink", () => {
// Test code for O3
});

it.skip("O4 - Clicking Save should save any custom keybinding user has", () => {
// Test code for O4
});

it.skip("O5 - Clicking Cancel should cancel any custom keybinding the user was trying to add", () => {
// Test code for O5
});

it.skip("O6 - Custom keybinding should be displayed next to assigned function", () => {
// Test code for O6
});

it.skip("O7 - Highlighted border should display when user clicks cancel", () => {
// Test code for O7
});

it.skip("O8 - Clicking Revert Keybindings should revert any custom keybindings the user has saved", () => {
// Test code for O8
});

it.skip("O9 - Highlighted border should be displayed when clicking Revert Keybindings", () => {
// Test code for O9
});

it.skip("O10 - Clicking the backwards arrow should revert specific custom keybinding", () => {
// Test code for O10
});
});
9 changes: 9 additions & 0 deletions cypress/e2e/12-settings-notifications.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe("Settings - Accessibility", () => {
it.skip("P1 - User should be able to toggle on/off Dyslexic mode", () => {
// Test code for P1
});

it.skip("P2 - If Dyslexic mode is toggled on, font should be applied everywhere throughout the app", () => {
// Test code for P2
});
});
Loading

0 comments on commit e2235f0

Please sign in to comment.