From ecac804a2d9a3372917727e77f09b552900ad5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:08:47 -0600 Subject: [PATCH] test(update): move launch third app to end of tests --- .../01-create-accounts-and-friends.spec.ts | 80 +---------------- .../12-group-chats-multiple-users.spec.ts | 88 +++++++++++++++++++ 2 files changed, 90 insertions(+), 78 deletions(-) diff --git a/tests/specs/reusable-accounts/01-create-accounts-and-friends.spec.ts b/tests/specs/reusable-accounts/01-create-accounts-and-friends.spec.ts index edc1792973..c66ce75926 100644 --- a/tests/specs/reusable-accounts/01-create-accounts-and-friends.spec.ts +++ b/tests/specs/reusable-accounts/01-create-accounts-and-friends.spec.ts @@ -4,11 +4,9 @@ import { activateSecondApplication, closeFirstApplication, closeSecondApplication, - closeThirdApplication, createNewUser, getUserKey, launchSecondApplication, - launchThirdApplication, saveTestKeys, scrollDown, } from "@helpers/commands"; @@ -396,84 +394,10 @@ export default async function createChatAccountsTests() { // Return to chat and validate Local User Status is Idle await settingsProfile.goToMainScreen(); await chatsInput.waitForIsShown(true); - await closeFirstApplication(); - await closeSecondApplication(); - }); - - it("Chat User C - Create Account", async () => { - // Launch third application - await launchThirdApplication(false); - - // Create a new account and go to Settings Profile - await createPin.waitForIsShown(true); - const username = "ChatUserC"; - await createNewUser(username); - await welcomeScreen.goToSettings(); - await settingsProfile.validateSettingsProfileIsShown(); - - // Click on Copy ID button and assert Toast Notification is displayed - await settingsProfile.openCopyIDContextMenu(); - await settingsProfile.clickOnContextMenuCopyDidKey(); - - // Wait for toast notification of Copied To Clipboard to not exist - await settingsProfile.waitUntilNotificationIsClosed(); - - // Paste copied DID Key into Status Input - await settingsProfile.pasteUserKeyInStatus(); - - // Wait for toast notification of Profile Updated to not exist - await settingsGeneral.waitUntilNotificationIsClosed(); - - // Grab cache folder and restart - const didkey = await settingsProfile.getCopiedDidFromStatusInput(); - await saveTestKeys(username, didkey); - await settingsProfile.deleteStatus(); - }); - - it("Chat User C - Settings General - Reduce font size", async () => { - // Go to General Settings and reduce Font Size by 0.5 - await settingsProfile.goToGeneralSettings(); - await settingsGeneral.waitForIsShown(true); - - // Click on font scaling minus - await settingsGeneral.clickOnFontScalingMinus(); - }); - - it("Chat User C - Settings Developer - Enable Save Logs In A File", async () => { - // Go to Settings About and click 10 times on Version Number to Unlock Developer Settings - await settingsGeneral.goToAboutSettings(); - await settingsAbout.waitForIsShown(true); - await settingsAbout.unlockDeveloperSettings(); - - // Validate Developer Settings button is unlocked - const developerSettingsButton = await settingsAbout.developerButton; - await developerSettingsButton.waitForDisplayed(); - - // Go to Menu from the left and Scroll Down - const settingsAboutButton = await settingsAbout.aboutButton; - await settingsAbout.hoverOnElement(settingsAboutButton); - await scrollDown(1000); - - // Go to Settings Developer and Enable Save Logs in a File - await settingsAbout.goToDeveloperSettings(); - await settingsDeveloper.waitForIsShown(true); - await settingsDeveloper.clickOnSaveLogs(); - await settingsDeveloper.validateSaveLogsIsEnabled(); - }); - - it("Chat User C - Settings Notifications - Disable notifications", async () => { - // Go to Notifications Settings and disable all notifications - await settingsDeveloper.goToNotificationsSettings(); - await settingsNotifications.validateSettingsNotificationsIsShown(); - await settingsNotifications.clickOnFriendsNotifications(); - await settingsNotifications.clickOnMessagesNotifications(); - - // Go to Friends Screen - await settingsNotifications.goToFriends(); - await friendsScreen.validateFriendsScreenIsShown(); }); after(async () => { - await closeThirdApplication(); + await closeFirstApplication(); + await closeSecondApplication(); }); } diff --git a/tests/specs/reusable-accounts/12-group-chats-multiple-users.spec.ts b/tests/specs/reusable-accounts/12-group-chats-multiple-users.spec.ts index 5c99262844..dcf405626f 100644 --- a/tests/specs/reusable-accounts/12-group-chats-multiple-users.spec.ts +++ b/tests/specs/reusable-accounts/12-group-chats-multiple-users.spec.ts @@ -1,18 +1,33 @@ require("module-alias/register"); +import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; import ChatsSidebar from "@screenobjects/chats/ChatsSidebar"; import FriendsScreen from "@screenobjects/friends/FriendsScreen"; +import SettingsAboutScreen from "@screenobjects/settings/SettingsAboutScreen"; +import SettingsDeveloperScreen from "@screenobjects/settings/SettingsDeveloperScreen"; +import SettingsGeneralScreen from "@screenobjects/settings/SettingsGeneralScreen"; +import SettingsNotificationsScreen from "@screenobjects/settings/SettingsNotificationsScreen"; +import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen"; import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; import { activateFirstApplication, activateThirdApplication, closeFirstApplication, closeThirdApplication, + createNewUser, getUserKey, + saveTestKeys, + scrollDown, launchFirstApplication, launchThirdApplication, } from "@helpers/commands"; const chatsSidebar = new ChatsSidebar(); +const createPin = new CreatePinScreen(); const friendsScreen = new FriendsScreen(); +const settingsAbout = new SettingsAboutScreen(); +const settingsDeveloper = new SettingsDeveloperScreen(); +const settingsGeneral = new SettingsGeneralScreen(); +const settingsNotifications = new SettingsNotificationsScreen(); +const settingsProfile = new SettingsProfileScreen(); const welcomeScreen = new WelcomeScreen(); export default async function groupChatMultipleUsersTests() { @@ -21,6 +36,79 @@ export default async function groupChatMultipleUsersTests() { await launchThirdApplication(); }); + it("Chat User C - Create Account", async () => { + // Launch third application + await launchThirdApplication(false); + + // Create a new account and go to Settings Profile + await createPin.waitForIsShown(true); + const username = "ChatUserC"; + await createNewUser(username); + await welcomeScreen.goToSettings(); + await settingsProfile.validateSettingsProfileIsShown(); + + // Click on Copy ID button and assert Toast Notification is displayed + await settingsProfile.openCopyIDContextMenu(); + await settingsProfile.clickOnContextMenuCopyDidKey(); + + // Wait for toast notification of Copied To Clipboard to not exist + await settingsProfile.waitUntilNotificationIsClosed(); + + // Paste copied DID Key into Status Input + await settingsProfile.pasteUserKeyInStatus(); + + // Wait for toast notification of Profile Updated to not exist + await settingsGeneral.waitUntilNotificationIsClosed(); + + // Grab cache folder and restart + const didkey = await settingsProfile.getCopiedDidFromStatusInput(); + await saveTestKeys(username, didkey); + await settingsProfile.deleteStatus(); + }); + + it("Chat User C - Settings General - Reduce font size", async () => { + // Go to General Settings and reduce Font Size by 0.5 + await settingsProfile.goToGeneralSettings(); + await settingsGeneral.waitForIsShown(true); + + // Click on font scaling minus + await settingsGeneral.clickOnFontScalingMinus(); + }); + + it("Chat User C - Settings Developer - Enable Save Logs In A File", async () => { + // Go to Settings About and click 10 times on Version Number to Unlock Developer Settings + await settingsGeneral.goToAboutSettings(); + await settingsAbout.waitForIsShown(true); + await settingsAbout.unlockDeveloperSettings(); + + // Validate Developer Settings button is unlocked + const developerSettingsButton = await settingsAbout.developerButton; + await developerSettingsButton.waitForDisplayed(); + + // Go to Menu from the left and Scroll Down + const settingsAboutButton = await settingsAbout.aboutButton; + await settingsAbout.hoverOnElement(settingsAboutButton); + await scrollDown(1000); + + // Go to Settings Developer and Enable Save Logs in a File + await settingsAbout.goToDeveloperSettings(); + await settingsDeveloper.waitForIsShown(true); + await settingsDeveloper.clickOnSaveLogs(); + await settingsDeveloper.validateSaveLogsIsEnabled(); + }); + + it("Chat User C - Settings Notifications - Disable notifications", async () => { + // Go to Notifications Settings and disable all notifications + await settingsDeveloper.goToNotificationsSettings(); + await settingsNotifications.validateSettingsNotificationsIsShown(); + await settingsNotifications.clickOnFriendsNotifications(); + await settingsNotifications.clickOnMessagesNotifications(); + + // Go to Friends Screen + await settingsNotifications.goToFriends(); + await friendsScreen.validateFriendsScreenIsShown(); + }); + it("Chat User C - Send friend request to User A", async () => { await welcomeScreen.goToFriends(); await friendsScreen.waitForIsShown(true);