Skip to content

Commit

Permalink
test(update): move launch third app to end of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Mar 19, 2024
1 parent d0ba280 commit ecac804
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import {
activateSecondApplication,
closeFirstApplication,
closeSecondApplication,
closeThirdApplication,
createNewUser,
getUserKey,
launchSecondApplication,
launchThirdApplication,
saveTestKeys,
scrollDown,
} from "@helpers/commands";
Expand Down Expand Up @@ -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();
});
}
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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);
Expand Down

0 comments on commit ecac804

Please sign in to comment.