diff --git a/.github/workflows/ui-automated-tests.yml b/.github/workflows/ui-automated-tests.yml index d8ffaff23e..d2b1ebdb68 100644 --- a/.github/workflows/ui-automated-tests.yml +++ b/.github/workflows/ui-automated-tests.yml @@ -459,16 +459,6 @@ jobs: name: appium-log-macos-chats path: ./appium.log - - name: Upload Uplink Logs if test fails 📷 - uses: actions/upload-artifact@v3 - if: failure() - with: - name: uplink-logs - path: | - ~/.uplink/.user/debug.log - ~/.uplinkUserB/.user/debug.log - ~/.uplinkUserC/.user/debug.log - - name: Add label if any of test jobs failed if: failure() uses: buildsville/add-remove-label@v2.0.0 @@ -697,7 +687,7 @@ jobs: allure_results: testing-uplink/allure allure_report: allure-report allure_history: allure-history - keep_reports: 20 + keep_reports: 100 - name: Deploy report to Github Pages if: success() @@ -746,7 +736,6 @@ jobs: test-allure-mac-ci test-allure-mac-chats test-allure-windows-ci - uplink-logs - name: Remove label if all test jobs succeeded uses: buildsville/add-remove-label@v2.0.0 diff --git a/config/wdio.mac.app.conf.ts b/config/wdio.mac.app.conf.ts index 90f6bc354b..63b0983131 100644 --- a/config/wdio.mac.app.conf.ts +++ b/config/wdio.mac.app.conf.ts @@ -125,12 +125,16 @@ export const config: WebdriverIO.Config = { } }, - afterTest: async function (test, describe, { error }) { - if (error) { + afterTest: async function ( + test, + context, + { error, result, duration, passed, retries }, + ) { + if (!passed) { let imageFile = await driver.takeScreenshot(); const imageFolder = join( process.cwd(), - "./test-results/macos-app", + "./test-results/macos", test.parent, ); const imageTitle = test.title + " - Failed.png"; @@ -144,8 +148,10 @@ export const config: WebdriverIO.Config = { // Add to Screenshot to Allure Reporter const data = await readFileSync(`${imageFolder}/${imageTitle}`); allureReporter.addAttachment(imageTitle, data, "image/png"); + } - // Close application if still open + if (error) { + // Close applications if open await terminateApplication(MACOS_BUNDLE_ID); } }, diff --git a/config/wdio.mac.ci.conf.ts b/config/wdio.mac.ci.conf.ts index 506fa87362..a2b4d82d21 100644 --- a/config/wdio.mac.ci.conf.ts +++ b/config/wdio.mac.ci.conf.ts @@ -128,9 +128,12 @@ export const config: WebdriverIO.Config = { /** * Function to be executed after a test (in Mocha/Jasmine). */ - afterTest: async function (test, describe, { error }) { - if (error) { - // If test fails, take a screenshot, make a folder with the test name and save it there + afterTest: async function ( + test, + context, + { error, result, duration, passed, retries }, + ) { + if (!passed) { let imageFile = await driver.takeScreenshot(); const imageFolder = join( process.cwd(), @@ -146,10 +149,12 @@ export const config: WebdriverIO.Config = { ); // Add to Screenshot to Allure Reporter - const dataImage = await readFileSync(`${imageFolder}/${imageTitle}`); - allureReporter.addAttachment(imageTitle, dataImage, "image/png"); + const data = await readFileSync(`${imageFolder}/${imageTitle}`); + allureReporter.addAttachment(imageTitle, data, "image/png"); + } - // Close application if still open + if (error) { + // Close applications if open await terminateApplication(MACOS_BUNDLE_ID); } }, diff --git a/config/wdio.mac.multiremote.conf.ts b/config/wdio.mac.multiremote.conf.ts index 8302e5db06..abb44db62d 100644 --- a/config/wdio.mac.multiremote.conf.ts +++ b/config/wdio.mac.multiremote.conf.ts @@ -32,7 +32,7 @@ export const config: WebdriverIO.Config = { // then the current working directory is where your `package.json` resides, so `wdio` // will be called from there. // - specs: [join(process.cwd(), "./tests/suites/Chats/01-Chats.suite.ts")], + specs: [join(process.cwd(), "./tests/specs/reusable-accounts/*.spec.ts")], // Patterns to exclude. exclude: [ // 'path/to/excluded/files' @@ -92,6 +92,10 @@ export const config: WebdriverIO.Config = { ], ], maxInstances: 1, + // The number of times to retry the entire specfile when it fails as a whole + specFileRetries: 1, + // Delay in seconds between the spec file retry attempts + specFileRetriesDelay: 0, // // ===== // Hooks @@ -100,7 +104,10 @@ export const config: WebdriverIO.Config = { // it and to build services around it. You can either apply a single function or an array of // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got // resolved to continue. - onPrepare: async function () { + /** + * Function to be executed after a test (in Mocha/Jasmine). + */ + onPrepare: async function (config, capabilities) { const cacheFolderUserA = homedir() + "/.uplink/.user"; const cacheFolderUserB = homedir() + "/.uplinkUserB/.user"; const cacheFolderUserC = homedir() + "/.uplinkUserC/.user"; @@ -126,12 +133,14 @@ export const config: WebdriverIO.Config = { ); } }, - /** - * Function to be executed after a test (in Mocha/Jasmine). - */ - afterTest: async function (test, describe, { error }) { - if (error) { - let imageFile = await driver.takeScreenshot(); + + afterTest: async function ( + test, + context, + { error, result, duration, passed, retries }, + ) { + if (!passed) { + let imageFile = await browser.takeScreenshot(); const imageFolder = join( process.cwd(), "./test-results/macos-multiremote", @@ -148,19 +157,15 @@ export const config: WebdriverIO.Config = { // Add to Screenshot to Allure Reporter const data = await readFileSync(`${imageFolder}/${imageTitle}`); allureReporter.addAttachment(imageTitle, data, "image/png"); - - // Close applications if open - await terminateApplication(MACOS_USER_A_BUNDLE_ID); - await terminateApplication(MACOS_USER_B_BUNDLE_ID); - await terminateApplication(MACOS_USER_C_BUNDLE_ID); } }, - }, - afterSuite: async function (suite) { - // Close second and third applications if open - await terminateApplication(MACOS_USER_B_BUNDLE_ID); - await terminateApplication(MACOS_USER_C_BUNDLE_ID); + afterSuite: async function (suite) { + // Close applications if open + await terminateApplication(MACOS_USER_A_BUNDLE_ID); + await terminateApplication(MACOS_USER_B_BUNDLE_ID); + await terminateApplication(MACOS_USER_C_BUNDLE_ID); + }, }, }; diff --git a/config/wdio.windows.app.conf.ts b/config/wdio.windows.app.conf.ts index a3e4a4a12f..d598eca150 100644 --- a/config/wdio.windows.app.conf.ts +++ b/config/wdio.windows.app.conf.ts @@ -165,12 +165,16 @@ export const config: WebdriverIO.Config = { } }, - afterTest: async function (test, describe, { error }) { - if (error) { + afterTest: async function ( + test, + context, + { error, result, duration, passed, retries }, + ) { + if (!passed) { let imageFile = await driver.takeScreenshot(); - let imageFolder = join( + const imageFolder = join( process.cwd(), - "./test-results/windows-app", + "./test-results/windows", test.parent, ); const imageTitle = test.title + " - Failed.png"; diff --git a/config/wdio.windows.ci.conf.ts b/config/wdio.windows.ci.conf.ts index 1cdd071035..2ed2caf612 100644 --- a/config/wdio.windows.ci.conf.ts +++ b/config/wdio.windows.ci.conf.ts @@ -164,7 +164,11 @@ export const config: WebdriverIO.Config = { ]); }, - afterTest: async function (test, describe, { error }) { + afterTest: async function ( + test, + context, + { error, result, duration, passed, retries }, + ) { // Stop video recording and saved it into base64 format const base64Video = await driver.executeScript( "windows: stopRecordingScreen", @@ -174,21 +178,18 @@ export const config: WebdriverIO.Config = { }, ], ); - if (error) { - let imageFile = await driver.takeScreenshot(); - let imageFolder = join( + if (!passed) { + await driver.takeScreenshot(); + const imageFile = await driver.takeScreenshot(); + const imageFolder = join( process.cwd(), "./test-results/windows-ci", test.parent, ); + const imageTitle = test.title + " - Failed.png"; const videoTitle = test.title + " - Failed.mp4"; await fsp.mkdir(imageFolder, { recursive: true }); - await fsp.writeFile( - imageFolder + "/" + imageTitle, - imageFile, - "base64", - ); // Write Video File if test failure and add it to failed screenshots folder await fsp.writeFile( @@ -197,12 +198,20 @@ export const config: WebdriverIO.Config = { "base64", ); + await fsp.writeFile( + imageFolder + "/" + imageTitle, + imageFile, + "base64", + ); + // Add to Screenshot to Allure Reporter - const data = await readFileSync(`${imageFolder}/${imageTitle}`); const dataVideo = await readFileSync(`${imageFolder}/${videoTitle}`); - allureReporter.addAttachment(imageTitle, data, "image/png"); allureReporter.addAttachment(videoTitle, dataVideo, "video/mp4"); + // Add to Screenshot to Allure Reporter + const data = await readFileSync(`${imageFolder}/${imageTitle}`); + allureReporter.addAttachment(imageTitle, data, "image/png"); + // Close application if still open await driver.executeScript("windows: closeApp", [ { diff --git a/config/wdio.windows.onetime.conf.ts b/config/wdio.windows.onetime.conf.ts index 7c7294ef64..319e1d1c31 100644 --- a/config/wdio.windows.onetime.conf.ts +++ b/config/wdio.windows.onetime.conf.ts @@ -135,8 +135,12 @@ export const config: WebdriverIO.Config = { } }, - afterTest: async function (test, describe, { error }) { - if (error) { + afterTest: async function ( + test, + context, + { error, result, duration, passed, retries }, + ) { + if (!passed) { let imageFile = await driver.takeScreenshot(); let imageFolder = join( process.cwd(), diff --git a/tests/helpers/commands.ts b/tests/helpers/commands.ts index efccee816b..f84a7f65d9 100644 --- a/tests/helpers/commands.ts +++ b/tests/helpers/commands.ts @@ -17,8 +17,8 @@ const { clipboard, keyboard, mouse, Button } = require("@nut-tree/nut-js"); // Users cache helper functions -export async function deleteCache() { - const target = homedir() + "/.uplink/.user"; +export async function deleteCache(userPath: string = "/.uplink/.user") { + const target = homedir() + userPath; try { await rmSync(target, { recursive: true, force: true }); } catch (error) { @@ -28,8 +28,11 @@ export async function deleteCache() { } } -export async function grabCacheFolder(username: string) { - const source = homedir() + "/.uplink"; +export async function grabCacheFolder( + username: string, + userPath: string = "/.uplink", +) { + const source = homedir() + userPath; const currentDriver = process.env.DRIVER; const target = "./tests/fixtures/users/" + currentDriver + "/" + username; await fsp.mkdir(target, { recursive: true }); @@ -42,12 +45,15 @@ export async function grabCacheFolder(username: string) { } } -export async function loadTestUserData(user: string) { +export async function loadTestUserData( + user: string, + userPath: string = "/.uplink", +) { // Move files const currentDriver = process.env.DRIVER; let source, target; source = "./tests/fixtures/users/" + currentDriver + "/" + user; - target = homedir() + "/.uplink"; + target = homedir() + userPath; await deleteCache(); try { await fsp.cp(source, target, { recursive: true }, { force: true }); @@ -100,6 +106,25 @@ export async function resetAndLoginWithCache(user: string) { await launchApplication(MACOS_BUNDLE_ID, WINDOWS_APP); } +export async function resetAndLoginWithCacheFirstApp(user: string) { + await closeFirstApplication(); + await deleteCache(); + await loadTestUserData(user); + await launchFirstApplication(); +} + +export async function resetAndLoginWithCacheSecondApp(user: string) { + await deleteCache("/.uplinkUserB/.user"); + await loadTestUserData(user, "/.uplinkUserB"); + await launchSecondApplication(); +} + +export async function resetAndLoginWithCacheThirdApp(user: string) { + await deleteCache("/.uplinkUserC/.user"); + await loadTestUserData(user, "/.uplinkUserC"); + await launchThirdApplication(); +} + export async function saveUserRecoverySeed(username: string, data: string[]) { // Save JSON file with keys const currentDriver = process.env.DRIVER; @@ -142,30 +167,39 @@ export async function launchApplication( } export async function launchFirstApplication() { - await launchAppMacOS(MACOS_USER_A_BUNDLE_ID); + if (process.env.DRIVER === WINDOWS_DRIVER) { + await launchAppWindows(WINDOWS_APP); + } else if (process.env.DRIVER === MACOS_DRIVER) { + await launchAppMacOS(MACOS_USER_A_BUNDLE_ID); + } await browser.pause(5000); } export async function launchSecondApplication() { - const customPath = ".uplinkUserB"; + const customPath = "/.uplinkUserB"; if (process.env.DRIVER === WINDOWS_DRIVER) { await launchAppWindows(WINDOWS_APP, customPath); } else if (process.env.DRIVER === MACOS_DRIVER) { await launchAppMacOS( MACOS_USER_B_BUNDLE_ID, - "/" + customPath, "/Applications/Uplink2.app", + customPath, ); } await browser.pause(5000); } export async function launchThirdApplication() { - await launchAppMacOS( - MACOS_USER_C_BUNDLE_ID, - "/.uplinkUserC", - "/Applications/Uplink3.app", - ); + const customPath = "/.uplinkUserC"; + if (process.env.DRIVER === WINDOWS_DRIVER) { + await launchAppWindows(WINDOWS_APP, customPath); + } else if (process.env.DRIVER === MACOS_DRIVER) { + await launchAppMacOS( + MACOS_USER_C_BUNDLE_ID, + "/Applications/Uplink3.app", + customPath, + ); + } await browser.pause(5000); } @@ -173,12 +207,7 @@ export async function activateFirstApplication() { if (process.env.DRIVER === WINDOWS_DRIVER) { await activateAppWindows(WINDOWS_APP); } else if (process.env.DRIVER === MACOS_DRIVER) { - const appState = await queryAppStateMacOS(MACOS_USER_A_BUNDLE_ID); - if (appState === 1) { - await launchFirstApplication(); - } else { - await activateAppMacOS(MACOS_USER_A_BUNDLE_ID); - } + await activateAppMacOS(MACOS_USER_A_BUNDLE_ID); } } @@ -186,12 +215,7 @@ export async function activateSecondApplication() { if (process.env.DRIVER === WINDOWS_DRIVER) { await activateAppWindows(WINDOWS_APP); } else if (process.env.DRIVER === MACOS_DRIVER) { - const appState = await queryAppStateMacOS(MACOS_USER_B_BUNDLE_ID); - if (appState === 1) { - await launchSecondApplication(); - } else { - await activateAppMacOS(MACOS_USER_B_BUNDLE_ID); - } + await activateAppMacOS(MACOS_USER_B_BUNDLE_ID); } } @@ -199,12 +223,7 @@ export async function activateThirdApplication() { if (process.env.DRIVER === WINDOWS_DRIVER) { await activateAppWindows(WINDOWS_APP); } else if (process.env.DRIVER === MACOS_DRIVER) { - const appState = await queryAppStateMacOS(MACOS_USER_C_BUNDLE_ID); - if (appState === 1) { - await launchThirdApplication(); - } else { - await activateAppMacOS(MACOS_USER_C_BUNDLE_ID); - } + await activateAppMacOS(MACOS_USER_C_BUNDLE_ID); } } @@ -217,11 +236,11 @@ export async function closeApplication() { } export async function closeFirstApplication() { - await driver.executeScript("macos: terminateApp", [ - { - bundleId: MACOS_USER_A_BUNDLE_ID, - }, - ]); + if (process.env.DRIVER === WINDOWS_DRIVER) { + await closeAppWindows(WINDOWS_APP); + } else if (process.env.DRIVER === MACOS_DRIVER) { + await closeAppMacOS(MACOS_USER_A_BUNDLE_ID); + } } export async function closeSecondApplication() { @@ -233,7 +252,11 @@ export async function closeSecondApplication() { } export async function closeThirdApplication() { - await closeAppMacOS(MACOS_USER_C_BUNDLE_ID); + if (process.env.DRIVER === WINDOWS_DRIVER) { + await closeAppWindows(WINDOWS_APP); + } else if (process.env.DRIVER === MACOS_DRIVER) { + await closeAppMacOS(MACOS_USER_C_BUNDLE_ID); + } } export async function maximizeWindow() { @@ -278,8 +301,8 @@ export async function closeAppMacOS(bundle: string) { export async function launchAppMacOS( bundle: string, - relativePathUserData: string = "/.uplink", appPath: string = "/Applications/Uplink.app", + relativePathUserData: string = "/.uplink", ) { await driver.executeScript("macos: launchApp", [ { @@ -290,21 +313,16 @@ export async function launchAppMacOS( ]); } -export async function launchAppWindows(appLocation: string, path: string = "") { - if (path === "") { - await driver.executeScript("windows: launchApp", [ - { - app: join(process.cwd(), appLocation), - }, - ]); - } else { - await driver.executeScript("windows: launchApp", [ - { - app: join(process.cwd(), appLocation), - "appium:appArguments": "--path " + join(process.cwd(), path), - }, - ]); - } +export async function launchAppWindows( + appLocation: string, + userPath: string = "/.uplink", +) { + await driver.executeScript("windows: launchApp", [ + { + app: join(process.cwd(), appLocation), + "appium:appArguments": "--path " + homedir() + userPath, + }, + ]); } export async function queryAppStateMacOS(bundle: string) { diff --git a/tests/helpers/commandsNewUser.ts b/tests/helpers/commandsNewUser.ts index e170d7eee4..151da8f740 100644 --- a/tests/helpers/commandsNewUser.ts +++ b/tests/helpers/commandsNewUser.ts @@ -1,9 +1,20 @@ import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; import CreateOrImportScreen from "@screenobjects/account-creation/CreateOrImportScreen"; -import SaveRecoverySeedScreen from "@screenobjects/account-creation/SaveRecoverySeedScreen"; import CreateUserScreen from "@screenobjects/account-creation/CreateUserScreen"; +import FriendsScreen from "@screenobjects/friends/FriendsScreen"; +import SaveRecoverySeedScreen from "@screenobjects/account-creation/SaveRecoverySeedScreen"; +import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen"; import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; -import { saveUserRecoverySeed } from "./commands"; +import { + activateFirstApplication, + activateSecondApplication, + getUserKey, + launchSecondApplication, + launchThirdApplication, + saveTestKeys, + saveUserRecoverySeed, +} from "./commands"; +import SettingsNotificationsScreen from "@screenobjects/settings/SettingsNotificationsScreen"; // Login or Create Users Functions @@ -39,3 +50,93 @@ export async function createNewUser( // Ensure Main Screen is displayed await WelcomeScreen.welcomeLayout.waitForExist({ timeout: 60000 }); } + +export async function createUserAndSaveDidKey( + username: string, + appNumber: number = 1, +) { + if (appNumber === 2) { + await launchSecondApplication(); + } else if (appNumber === 3) { + await launchThirdApplication(); + } else { + await activateFirstApplication(); + } + // Launch first application and Create a new account to show Welcome Screen + await CreatePinScreen.waitForIsShown(true); + await createNewUser(username); + await WelcomeScreen.waitForIsShown(true); + + // Continue setting up first account created + await WelcomeScreen.goToSettings(); + await SettingsProfileScreen.validateSettingsProfileIsShown(); + + // Click on Copy ID button and assert Toast Notification is displayed + await SettingsProfileScreen.openCopyIDContextMenu(); + await SettingsProfileScreen.clickOnContextMenuCopyDidKey(); + + // Wait for toast notification to be closed + await SettingsProfileScreen.waitUntilNotificationIsClosed(); + + // Paste copied DID Key into Status Input + await SettingsProfileScreen.pasteUserKeyInStatus(); + + // Wait for toast notification of Profile Updated to not exist + await SettingsProfileScreen.waitUntilNotificationIsClosed(); + + // Grab cache folder and restart + const didkey = await SettingsProfileScreen.getCopiedDidFromStatusInput(); + await saveTestKeys(username, didkey); + await SettingsProfileScreen.deleteStatus(); + + // Go to Notifications Settings and disable all notifications + await SettingsProfileScreen.goToNotificationsSettings(); + await SettingsNotificationsScreen.validateSettingsNotificationsIsShown(); + await SettingsNotificationsScreen.clickOnFriendsNotifications(); + await SettingsNotificationsScreen.clickOnMessagesNotifications(); + + // Go to Friends Screen + await SettingsNotificationsScreen.goToProfileSettings(); + await SettingsProfileScreen.waitForIsShown(true); + await SettingsProfileScreen.goToFriends(); + await FriendsScreen.validateFriendsScreenIsShown(); +} + +export async function sendFriendRequestToUser(username: string) { + // Assumption - User is already in Friends Screen and did key from remote user is already saved + // Obtain did key from User + const friendDidKey = await getUserKey(username); + await FriendsScreen.sendFriendRequest(friendDidKey, username); + + // Go to All Friends List + await FriendsScreen.goToAllFriendsList(); + await FriendsScreen.validateAllFriendsListIsShown(); +} + +export async function acceptFriendRequest(username: string) { + // Assumption - User is already in Friends Screen + // Go to pending requests list, wait for receiving the friend request and accept it + await FriendsScreen.hoverOnPendingListButton(); + await FriendsScreen.goToPendingFriendsList(); + await FriendsScreen.validateIncomingListIsShown(); + await FriendsScreen.waitUntilFriendRequestIsReceived(); + await FriendsScreen.acceptIncomingRequest(username); + + // Validate friend is now on all friends list + await FriendsScreen.goToAllFriendsList(); + await FriendsScreen.validateAllFriendsListIsShown(); + await FriendsScreen.validateAllFriendsListIsNotEmpty(); + + // Go to Chat with User + await FriendsScreen.goToChatWithFriend(); +} + +export async function validateFriendRequestWasAccepted() { + // Assumption user is already in Friends Scree - Go to pending requests list, wait for receiving the friend request and accept it + await FriendsScreen.waitUntilUserAcceptedFriendRequest(); + + // Validate friend is now on all friends list + await FriendsScreen.goToAllFriendsList(); + await FriendsScreen.validateAllFriendsListIsShown(); + await FriendsScreen.validateAllFriendsListIsNotEmpty(); +} diff --git a/tests/helpers/debugging.ts b/tests/helpers/debugging.ts index fb6e7e2732..59cbc1385b 100644 --- a/tests/helpers/debugging.ts +++ b/tests/helpers/debugging.ts @@ -4,8 +4,7 @@ import { getUserKey, launchSecondApplication, saveTestKeys, - activateFirstApplication, - activateSecondApplication, + launchFirstApplication, } from "./commands"; import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; import FriendsScreen from "@screenobjects/friends/FriendsScreen"; @@ -112,7 +111,7 @@ export async function setupBeforeCreateGroupTests() { await FriendsScreen.validateAllFriendsListIsShown(); // Switch control to User A - await activateFirstApplication(); + await launchFirstApplication(); // With User A - Go to pending requests list, wait for receiving the friend request and accept it await FriendsScreen.hoverOnPendingListButton(); @@ -130,7 +129,7 @@ export async function setupBeforeCreateGroupTests() { await FriendsScreen.goToChatWithFriend(); // Switch control to User B - await activateSecondApplication(); + await launchSecondApplication(); // With User B - Go to pending requests list, wait for receiving the friend request and accept it await FriendsScreen.waitUntilUserAcceptedFriendRequest(); @@ -141,7 +140,7 @@ export async function setupBeforeCreateGroupTests() { await FriendsScreen.validateAllFriendsListIsNotEmpty(); // Switch control to User A - await activateFirstApplication(); + await launchFirstApplication(); await Topbar.validateTopbarExists(); } diff --git a/tests/specs/10-settings-accessibility.spec.ts b/tests/specs/10-settings-accessibility.spec.ts index 08864e422f..9e75a2d9b3 100644 --- a/tests/specs/10-settings-accessibility.spec.ts +++ b/tests/specs/10-settings-accessibility.spec.ts @@ -27,7 +27,8 @@ export default async function settingsAccessibilityTests() { ); }); - it("Settings Accessibility - Click on slider switch to enable Open Dyslexic option", async () => { + // Skip test that needs rework because it is clicking on a switch slider from MacOS configuration instead of Uplink - Settings Accessibility Screen + xit("Settings Accessibility - Click on slider switch to enable Open Dyslexic option", async () => { // Click on the Open Dyslexic switch slider from the Settings Accessibility Screen await SettingsAccessibilityScreen.clickOnOpenDyslexic(); @@ -35,7 +36,8 @@ export default async function settingsAccessibilityTests() { await SettingsAccessibilityScreen.validateOpenDyslexicIsEnabled(); }); - it("Settings Audio - Click on slider switches to disable the options", async () => { + // Skip test that needs rework because it is clicking on a switch slider from MacOS configuration instead of Uplink - Settings Accessibility Screen + xit("Settings Audio - Click on slider switches to disable the options", async () => { // Click again on the switch slider from Open Dyslexic option in Settings Accessibility Screen await SettingsAccessibilityScreen.clickOnOpenDyslexic(); diff --git a/tests/specs/reusable-accounts/00-create-three-instances.spec.ts b/tests/specs/reusable-accounts/00-create-three-instances.spec.ts index 232bfbd219..99674999e2 100644 --- a/tests/specs/reusable-accounts/00-create-three-instances.spec.ts +++ b/tests/specs/reusable-accounts/00-create-three-instances.spec.ts @@ -10,7 +10,7 @@ import { import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; -export default async function createChatAccountsTests() { +describe("MacOS Chats Tests - Open apps for the first time", function () { it("Chats Tests - Create account for first instance", async () => { // Launch first application and Create a new account to show Welcome Screen await CreatePinScreen.waitForIsShown(true); @@ -43,4 +43,4 @@ export default async function createChatAccountsTests() { // Close third application await closeThirdApplication(); }); -} +}); 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 6f8ba2a0ce..c7008d6e99 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 @@ -2,16 +2,9 @@ require("module-alias/register"); import { activateFirstApplication, activateSecondApplication, - closeFirstApplication, - closeSecondApplication, - getUserKey, - launchFirstApplication, - launchSecondApplication, - saveTestKeys, scrollDown, } from "@helpers/commands"; import ChatsLayout from "@screenobjects/chats/ChatsLayout"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; import EmojiSelector from "@screenobjects/chats/EmojiSelector"; import FavoritesSidebar from "@screenobjects/chats/FavoritesSidebar"; import FriendsScreen from "@screenobjects/friends/FriendsScreen"; @@ -21,198 +14,35 @@ import MessageGroupRemote from "@screenobjects/chats/MessageGroupRemote"; import MessageLocal from "@screenobjects/chats/MessageLocal"; import MessageRemote from "@screenobjects/chats/MessageRemote"; import Topbar from "@screenobjects/chats/Topbar"; -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 { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen"; -import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; - -export default async function chatsFriendsRequests() { - before(async () => { - await launchSecondApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); - }); - - it("Chat User A - Create Account", async () => { - // Continue setting up first account created - const username = "ChatUserA"; - await WelcomeScreen.goToSettings(); - await SettingsProfileScreen.validateSettingsProfileIsShown(); - - // Click on Copy ID button and assert Toast Notification is displayed - await SettingsProfileScreen.openCopyIDContextMenu(); - await SettingsProfileScreen.clickOnContextMenuCopyDidKey(); - - // Wait for toast notification to be closed - await SettingsProfileScreen.waitUntilNotificationIsClosed(); - - // Paste copied DID Key into Status Input - await SettingsProfileScreen.pasteUserKeyInStatus(); - - // Wait for toast notification of Profile Updated to not exist - await SettingsProfileScreen.waitUntilNotificationIsClosed(); - - // Grab cache folder and restart - const didkey = await SettingsProfileScreen.getCopiedDidFromStatusInput(); - await saveTestKeys(username, didkey); - await SettingsProfileScreen.deleteStatus(); - }); - - it("Chat User A - Settings General - Reduce font size", async () => { - // Go to General Settings and reduce Font Size by 0.5 - await SettingsProfileScreen.goToGeneralSettings(); - await SettingsGeneralScreen.waitForIsShown(true); - - // Click on font scaling minus button - await SettingsGeneralScreen.clickOnFontScalingMinus(); - }); - - it("Chat User A - 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 SettingsGeneralScreen.goToAboutSettings(); - await SettingsAboutScreen.waitForIsShown(true); - await SettingsAboutScreen.unlockDeveloperSettings(); - - // Validate Developer Settings button is unlocked - const developerSettingsButton = await SettingsAboutScreen.developerButton; - await developerSettingsButton.waitForDisplayed(); - - // Go to Menu from the left and Scroll Down - const settingsAboutButton = await SettingsAboutScreen.aboutButton; - await SettingsAboutScreen.hoverOnElement(settingsAboutButton); - await scrollDown(1000); - - // Go to Settings Developer and Enable Save Logs in a File - await SettingsAboutScreen.goToDeveloperSettings(); - await SettingsDeveloperScreen.waitForIsShown(true); - await SettingsDeveloperScreen.clickOnSaveLogs(); - await SettingsDeveloperScreen.validateSaveLogsIsEnabled(); - }); - - it("Chat User A - Settings Notifications - Disable notifications", async () => { - // Go to Notifications Settings and disable all notifications - await SettingsDeveloperScreen.goToNotificationsSettings(); - await SettingsNotificationsScreen.validateSettingsNotificationsIsShown(); - await SettingsNotificationsScreen.clickOnFriendsNotifications(); - await SettingsNotificationsScreen.clickOnMessagesNotifications(); - - // Go to Friends Screen - await SettingsNotificationsScreen.goToFriends(); - await FriendsScreen.validateFriendsScreenIsShown(); - }); - - it("Chat User B - Save Did Key from User", async () => { - // Activate second application and continue setting up second account - await activateSecondApplication(); - await WelcomeScreen.goToSettings(); - await SettingsProfileScreen.validateSettingsProfileIsShown(); - // Click on Copy ID button and assert Toast Notification is displayed - await SettingsProfileScreen.openCopyIDContextMenu(); - await SettingsProfileScreen.clickOnContextMenuCopyDidKey(); - - // Wait for toast notification of Copied To Clipboard to not exist - await SettingsProfileScreen.waitUntilNotificationIsClosed(); - - // Paste copied DID Key into Status Input - await SettingsProfileScreen.pasteUserKeyInStatus(); - - // Wait for toast notification of Profile Updated to not exist - await SettingsGeneralScreen.waitUntilNotificationIsClosed(); - - // Grab cache folder and restart - const didkey = await SettingsProfileScreen.getCopiedDidFromStatusInput(); - await saveTestKeys("ChatUserB", didkey); - await SettingsProfileScreen.deleteStatus(); - }); - - it("Chat User B - Settings General - Reduce font size", async () => { - // Go to General Settings and reduce Font Size by 0.5 - await SettingsProfileScreen.goToGeneralSettings(); - await SettingsGeneralScreen.waitForIsShown(true); - - // Click on font scaling minus - await SettingsGeneralScreen.clickOnFontScalingMinus(); +describe("MacOS Chats Tests - Chats Friend Requests", function () { + it("Chat Friend Requests - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); }); - it("Chat User B - 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 SettingsGeneralScreen.goToAboutSettings(); - await SettingsAboutScreen.waitForIsShown(true); - await SettingsAboutScreen.unlockDeveloperSettings(); - - // Validate Developer Settings button is unlocked - const developerSettingsButton = await SettingsAboutScreen.developerButton; - await developerSettingsButton.waitForDisplayed(); - - // Go to Menu from the left and Scroll Down - const settingsAboutButton = await SettingsAboutScreen.aboutButton; - await SettingsAboutScreen.hoverOnElement(settingsAboutButton); - await scrollDown(1000); - - // Go to Settings Developer and Enable Save Logs in a File - await SettingsAboutScreen.goToDeveloperSettings(); - await SettingsDeveloperScreen.waitForIsShown(true); - await SettingsDeveloperScreen.clickOnSaveLogs(); - await SettingsDeveloperScreen.validateSaveLogsIsEnabled(); + it("Chat Friend Requests - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); }); - it("Chat User B - Settings Notifications - Disable notifications", async () => { - // Go to Notifications Settings and disable all notifications - await SettingsDeveloperScreen.goToNotificationsSettings(); - await SettingsNotificationsScreen.validateSettingsNotificationsIsShown(); - await SettingsNotificationsScreen.clickOnFriendsNotifications(); - await SettingsNotificationsScreen.clickOnMessagesNotifications(); - - // Go to Friends Screen - await SettingsNotificationsScreen.goToFriends(); - await FriendsScreen.validateFriendsScreenIsShown(); + it("Chat Friend Requests - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); }); - it("Chat User B - Send friend request to User A", async () => { - // Obtain did key from Chat User B - const friendDidKey = await getUserKey("ChatUserA"); - await FriendsScreen.sendFriendRequest(friendDidKey, "ChatUserA"); - - // Go to All Friends List - await FriendsScreen.goToAllFriendsList(); - await FriendsScreen.validateAllFriendsListIsShown(); - }); - - it("Chat User A - Accept friend request from User A and go to chat button", async () => { - // Switch control to User A + it("Chat Friend Requests - Accept Friend Request from User A", async () => { await activateFirstApplication(); - - // With User A - Go to pending requests list, wait for receiving the friend request and accept it - await FriendsScreen.hoverOnPendingListButton(); - await FriendsScreen.goToPendingFriendsList(); - await FriendsScreen.validateIncomingListIsShown(); - await FriendsScreen.waitUntilFriendRequestIsReceived(); - await FriendsScreen.acceptIncomingRequest("ChatUserB"); - - // Validate friend is now on all friends list - await FriendsScreen.goToAllFriendsList(); - await FriendsScreen.validateAllFriendsListIsShown(); - await FriendsScreen.validateAllFriendsListIsNotEmpty(); - - // Go to Chat with User B - await FriendsScreen.goToChatWithFriend(); + await acceptFriendRequest("ChatUserB"); }); - it("Chat User B - Validate friend request was accepted", async () => { - // Switch control to User B + it("Chat Friend Requests - Validate User A accepted friend request", async () => { await activateSecondApplication(); - - // With User B - Go to pending requests list, wait for receiving the friend request and accept it - await FriendsScreen.waitUntilUserAcceptedFriendRequest(); - - // Validate friend is now on all friends list - await FriendsScreen.goToAllFriendsList(); - await FriendsScreen.validateAllFriendsListIsShown(); - await FriendsScreen.validateAllFriendsListIsNotEmpty(); + await validateFriendRequestWasAccepted(); }); it("Chat User A - Chat screen displays Messages secured text displayed on top of conversation", async () => { @@ -317,6 +147,28 @@ export default async function chatsFriendsRequests() { await Topbar.removeFromFavorites(); }); + it("Chat User A - Change user status to Idle", async () => { + // Change User A to Idle + await Topbar.goToSettings(); + await SettingsProfileScreen.waitForIsShown(true); + + // Maximize Window + await SettingsProfileScreen.clickOnStatusInput(); + await scrollDown(1000); + + // Change Status to Idle + await SettingsProfileScreen.selectIdleStatus(); + + // Validate status is Idle now + const currentOnlineStatus = + await SettingsProfileScreen.selectorCurrentValue; + await expect(currentOnlineStatus).toHaveText("Idle"); + + // Return to chat and validate Local User Status is Idle + await SettingsProfileScreen.goToMainScreen(); + await InputBar.waitForIsShown(true); + }); + it("Chat User B - Wait until the other user is connected", async () => { // Switch control to User B await activateSecondApplication(); @@ -354,34 +206,10 @@ export default async function chatsFriendsRequests() { await expect(timeAgo).toHaveText(expect.stringContaining("ChatUserA")); }); - it("Chat User A - Change user status to Idle", async () => { - // Switch control to User A - await activateFirstApplication(); - - // Change User A to Idle - await Topbar.goToSettings(); - await SettingsNotificationsScreen.goToProfileSettings(); - await SettingsProfileScreen.waitForIsShown(true); - - // Maximize Window - await SettingsProfileScreen.clickOnStatusInput(); - await scrollDown(1000); - - // Change Status to Idle - await SettingsProfileScreen.selectIdleStatus(); - - // Validate status is Idle now - const currentOnlineStatus = - await SettingsProfileScreen.selectorCurrentValue; - await expect(currentOnlineStatus).toHaveText("Idle"); - - // Return to chat and validate Local User Status is Idle - await SettingsProfileScreen.goToMainScreen(); - await InputBar.waitForIsShown(true); - }); - - after(async () => { - await closeFirstApplication(); - await closeSecondApplication(); + it("Chat User B - Validate User Status changes are seen in remote side", async () => { + // Validate Chat User B is now Idle + const firstRemoteStatus = + await MessageGroupRemote.getLastGroupWrapReceivedCurrentStatus(); + await expect(firstRemoteStatus).toEqual("indicator-idle"); }); -} +}); diff --git a/tests/specs/reusable-accounts/02-chat-replies.spec.ts b/tests/specs/reusable-accounts/02-chat-replies.spec.ts index 5ff7e6a9b7..7bc19e6538 100644 --- a/tests/specs/reusable-accounts/02-chat-replies.spec.ts +++ b/tests/specs/reusable-accounts/02-chat-replies.spec.ts @@ -8,36 +8,76 @@ import MessageRemote from "@screenobjects/chats/MessageRemote"; import ReplyPrompt from "@screenobjects/chats/ReplyPrompt"; import { activateFirstApplication, - closeFirstApplication, - closeSecondApplication, - launchFirstApplication, - launchSecondApplication, + activateSecondApplication, } from "@helpers/commands"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; - -export default async function repliesTests() { - before(async () => { - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchSecondApplication(); - await CreatePinScreen.loginWithTestUser(); +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; +import FriendsScreen from "@screenobjects/friends/FriendsScreen"; + +describe("MacOS Chats - Chat Replies Tests", function () { + it("Chat Replies - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); + }); + + it("Chat Replies - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); }); - it("Chat User B - Reply popup - Validate contents and close it", async () => { + it("Chat Replies - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); + }); + + it("Chat Replies - Accept Friend Request from User A", async () => { + await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); + + it("Chat Replies - Validate User A accepted friend request", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); + }); + + it("Chat User B - Send text message to User A", async () => { + // Go to the current list of All friends and then open a Chat conversation with ChatUserA + await FriendsScreen.chatWithFriendButton.waitForExist(); + await FriendsScreen.hoverOnChatWithFriendButton("ChatUserA"); + await FriendsScreen.chatWithFriendButton.click(); + await FriendsScreen.validateSpinnerIsNotShown(); + + // Send message to the other user + await InputBar.typeMessageOnInput("Testing..."); + + await InputBar.clickOnSendMessage(); + await MessageLocal.waitForMessageSentToExist("Testing..."); + }); + + it("Chat User A - Validate message from User A was received", async () => { + // Switch control to User A + await activateFirstApplication(); + + // Validate message received from Chat User A + await InputBar.clickOnInputBar(); + await MessageRemote.openContextMenuOnReceivedMessage("Testing..."); + }); + + it("Chat User A - Reply popup - Validate contents and close it", async () => { // Open Context Menu on Last Message Received and select Reply - await MessageRemote.openContextMenuOnReceivedMessage("Testing...😀"); await ContextMenu.validateContextMenuIsOpen(); await ContextMenu.selectContextOptionReply(); // Validate contents of Reply Pop Up and close it - await ReplyPrompt.validateReplyPromptElementsShown("Testing...😀"); + await ReplyPrompt.validateReplyPromptElementsShown("Testing..."); await ReplyPrompt.closeReplyModal(); await ReplyPrompt.waitForReplyModalToNotExist(); }); - it("Chat User B - Reply to a message", async () => { + it("Chat User A - Reply to a message", async () => { // Open Context Menu on Last Message Received and select Reply - await MessageRemote.openContextMenuOnReceivedMessage("Testing...😀"); + await MessageRemote.openContextMenuOnReceivedMessage("Testing..."); await ContextMenu.validateContextMenuIsOpen(); await ContextMenu.selectContextOptionReply(); @@ -48,41 +88,34 @@ export default async function repliesTests() { await ReplyPrompt.waitForReplyModalToNotExist(); }); - it("Chat User B - Validate reply message group reply and message replied", async () => { + it("Chat User A - Validate reply message group reply and message replied", async () => { // Validate message replied appears smaller above your reply const replySent = await MessageRemote.getLastReply(); const replySentText = await MessageRemote.getLastReplyText(); await replySent.waitForExist(); - await expect(replySentText).toHaveText("Testing...😀"); + await expect(replySentText).toHaveText("Testing..."); // Validate reply message sent appears as last message const message = await MessageLocal.getCustomMessageContents("Reply"); await expect(message).toHaveText("Reply"); }); - it("Chat User B - Validate reply message group contains timestamp and user image", async () => { + it("Chat User A - Validate reply message group contains timestamp and user image", async () => { //Timestamp from last message sent should be displayed const timeAgo = await MessageGroupLocal.getLastMessageSentTimeAgo(); await expect(timeAgo).toHaveText( expect.stringMatching(/- (?:\d{1,2}\s+(?:second|minute)s?\s+ago|now)$/), ); - await expect(timeAgo).toHaveText(expect.stringContaining("ChatUserB")); + await expect(timeAgo).toHaveText(expect.stringContaining("ChatUserA")); //Your user image should be displayed next to the message const userImage = await MessageGroupLocal.getLastGroupWrapSentImage(); await userImage.waitForExist(); }); - it("Chat User B - Validate User Status changes are seen in remote side", async () => { - // Validate Chat User B is now Idle - const firstRemoteStatus = - await MessageGroupRemote.getLastGroupWrapReceivedCurrentStatus(); - await expect(firstRemoteStatus).toEqual("indicator-idle"); - }); - - it("Chat User A - Validate reply message contents", async () => { + it("Chat User B - Validate reply message contents", async () => { // Switch control to User A - await activateFirstApplication(); + await activateSecondApplication(); // With User A - Validate that reply message is received await MessageRemote.chatMessageReply.waitForExist(); @@ -91,7 +124,7 @@ export default async function repliesTests() { const replyReceived = await MessageRemote.getLastReply(); const replyReceivedText = await MessageRemote.getLastReplyText(); await replyReceived.waitForExist(); - await expect(replyReceivedText).toHaveText("Testing...😀"); + await expect(replyReceivedText).toHaveText("Testing..."); // Validate reply message sent appears as last message const textFromMessage = @@ -99,24 +132,24 @@ export default async function repliesTests() { await expect(textFromMessage).toHaveText("Reply"); }); - it("Chat User A - Validate reply message group contains timestamp", async () => { + it("Chat User B - Validate reply message group contains timestamp", async () => { //Timestamp from last message sent should be displayed const timeAgo = await MessageGroupRemote.getLastMessageReceivedTimeAgo(); await expect(timeAgo).toHaveText( expect.stringMatching(/- (?:\d{1,2}\s+(?:second|minute)s?\s+ago|now)$/), ); - await expect(timeAgo).toHaveText(expect.stringContaining("ChatUserB")); + await expect(timeAgo).toHaveText(expect.stringContaining("ChatUserA")); }); - it("Chat User A - Validate reply message group contains user image", async () => { + it("Chat User B - Validate reply message group contains user image", async () => { //Your user image should be displayed next to the message const userImage = await MessageGroupRemote.getLastGroupWrapReceivedImage(); await userImage.waitForExist(); }); - it("Chat User A - Reply to yourself", async () => { + it("Chat User B - Reply to yourself", async () => { // Open Context Menu on Last Message Sent - await MessageLocal.openContextMenuOnSentMessage("Testing...😀"); + await MessageLocal.openContextMenuOnSentMessage("Testing..."); await ContextMenu.validateContextMenuIsOpen(); await ContextMenu.selectContextOptionReply(); @@ -130,15 +163,10 @@ export default async function repliesTests() { const repliedMessage = await MessageLocal.getLastReply(); const repliedMessageText = await MessageLocal.getLastReplyText(); await repliedMessage.waitForExist(); - await expect(repliedMessageText).toHaveText("Testing...😀"); + await expect(repliedMessageText).toHaveText("Testing..."); // Validate reply message sent appears as last message const message = await MessageLocal.getCustomMessageContents("SelfReply"); await expect(message).toHaveText("SelfReply"); }); - - after(async () => { - await closeFirstApplication(); - await closeSecondApplication(); - }); -} +}); diff --git a/tests/specs/reusable-accounts/03-message-context-menu.spec.ts b/tests/specs/reusable-accounts/03-message-context-menu.spec.ts index 638191f5a0..d81c1dafe1 100644 --- a/tests/specs/reusable-accounts/03-message-context-menu.spec.ts +++ b/tests/specs/reusable-accounts/03-message-context-menu.spec.ts @@ -1,42 +1,65 @@ require("module-alias/register"); import { - getClipboardValue, activateFirstApplication, activateSecondApplication, - launchSecondApplication, - launchFirstApplication, - closeFirstApplication, - closeSecondApplication, + getClipboardValue, } from "@helpers/commands"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; import ContextMenu from "@screenobjects/chats/ContextMenu"; import InputBar from "@screenobjects/chats/InputBar"; import MessageGroupLocal from "@screenobjects/chats/MessageGroupLocal"; import MessageGroupRemote from "@screenobjects/chats/MessageGroupRemote"; import MessageLocal from "@screenobjects/chats/MessageLocal"; import MessageRemote from "@screenobjects/chats/MessageRemote"; +import FriendsScreen from "@screenobjects/friends/FriendsScreen"; + +describe("MacOS Chats - Message Context Menu Tests", function () { + it("Messages Context Menu - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); + }); + + it("Messages Context Menu - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); + }); -export default async function messageContextMenuTests() { - before(async () => { - await launchSecondApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); + it("Messages Context Menu - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); }); - it("Chat User A - Send two messages to Chat User B", async () => { - // Send a message to Chat User B + it("Messages Context Menu - Accept Friend Request from User A", async () => { + await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); + + it("Messages Context Menu - Validate User A accepted friend request", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); + }); + + it("Chat User B - Send two messages to Chat User A", async () => { + // Go to the current list of All friends and then open a Chat conversation with ChatUserA + await FriendsScreen.chatWithFriendButton.waitForExist(); + await FriendsScreen.hoverOnChatWithFriendButton("ChatUserA"); + await FriendsScreen.chatWithFriendButton.click(); + await FriendsScreen.validateSpinnerIsNotShown(); + + // Send a message to Chat User A await InputBar.typeMessageOnInput("Two..."); await InputBar.clickOnSendMessage(); await MessageLocal.waitForMessageSentToExist("Two..."); - // Send a message to Chat User B + // Send a message to Chat User A await InputBar.typeMessageOnInput("Three..."); await InputBar.clickOnSendMessage(); await MessageLocal.waitForMessageSentToExist("Three..."); }); - it("Chat User A - Context Menu - Copy Text from Message Sent", async () => { + it("Chat User B - Context Menu - Copy Text from Message Sent", async () => { await MessageLocal.openContextMenuOnSentMessage("Three..."); await ContextMenu.validateContextMenuIsOpen(); await ContextMenu.selectContextOptionCopy(); @@ -46,14 +69,17 @@ export default async function messageContextMenuTests() { await expect(clipboardText).toEqual("Three..."); }); - it("Chat User B - Receive two messages from Chat User B", async () => { - // Assert messages received from Chat User B - await activateSecondApplication(); + it("Chat User A - Receive two messages from Chat User B", async () => { + // Switch control to User A + await activateFirstApplication(); + + // Validate messages received from Chat User B + await InputBar.clickOnInputBar(); await MessageRemote.waitForReceivingMessage("Two..."); await MessageRemote.waitForReceivingMessage("Three..."); }); - it("Chat User B - Context Menu - Copy Text from Message Received", async () => { + it("Chat User A - Context Menu - Copy Text from Message Received", async () => { await MessageRemote.openContextMenuOnReceivedMessage("Three..."); await ContextMenu.validateContextMenuIsOpen(); await ContextMenu.selectContextOptionCopy(); @@ -63,9 +89,9 @@ export default async function messageContextMenuTests() { await expect(clipboardText).toEqual("Three..."); }); - it("Chat User A - Context Menu - Delete Message", async () => { + it("Chat User B - Context Menu - Delete Message", async () => { // Open context menu on last message sent and select option for deleting - await activateFirstApplication(); + await activateSecondApplication(); await MessageLocal.openContextMenuOnSentMessage("Three..."); await ContextMenu.validateContextMenuIsOpen(); await ContextMenu.selectContextOptionDelete(); @@ -74,20 +100,25 @@ export default async function messageContextMenuTests() { await MessageLocal.waitForMessageToBeDeleted("Three..."); }); - it("Chat User B - Validate Message was deleted and is no longer visible in remote chat", async () => { - // Switch to Chat User B window - await activateSecondApplication(); + it("Chat User A - Validate Message was deleted and is no longer visible in remote chat", async () => { + // Switch to Chat User A window + await activateFirstApplication(); - // With User B - Validate that last message is "Two..." + // With User A - Validate that last message is "Two..." await MessageRemote.waitForReceivingMessage("Two..."); - // With User B - Ensure that message "three.." was deleted + // With User A - Ensure that message "three.." was deleted await MessageRemote.waitForMessageToBeDeleted("Three..."); + + // Send a message to Chat User A + await InputBar.typeMessageOnInput("Four..."); + await InputBar.clickOnSendMessage(); + await MessageLocal.waitForMessageSentToExist("Four..."); }); - it("Chat User A - React to sent message and multiple reactions in a message", async () => { + it("Chat User B - React to sent message and multiple reactions in a message", async () => { // React with 😂 emoji - await activateFirstApplication(); + await activateSecondApplication(); await MessageLocal.openContextMenuOnSentMessage("Two..."); await ContextMenu.validateContextMenuIsOpen(); await ContextMenu.clickOnFirstReaction(); @@ -105,12 +136,12 @@ export default async function messageContextMenuTests() { await expect(reactions.includes("😂 1")).toEqual(true); }); - it("Chat User A - React to received message", async () => { - // Validate message received from Chat User A - await MessageRemote.waitForReceivingMessage("Reply"); + it("Chat User B - React to received message", async () => { + // Validate message received from Chat User B + await MessageRemote.waitForReceivingMessage("Four..."); // React with 👎 emoji - await MessageRemote.openContextMenuOnReceivedMessage("Reply"); + await MessageRemote.openContextMenuOnReceivedMessage("Four..."); await ContextMenu.validateContextMenuIsOpen(); await ContextMenu.clickOnThirdReaction(); await MessageGroupRemote.waitUntilEmojiReactionSelfExists("👎"); @@ -121,9 +152,9 @@ export default async function messageContextMenuTests() { await expect(reaction.includes("👎 1")).toEqual(true); }); - it("Chat User B - Receive reaction in sent message", async () => { - // Return to Chat User B window - await activateSecondApplication(); + it("Chat User A - Receive reaction in sent message", async () => { + // Return to Chat User A window + await activateFirstApplication(); await InputBar.clickOnInputBar(); await InputBar.typeMessageOnInput("Hello"); await InputBar.clearInputBar(); @@ -135,7 +166,7 @@ export default async function messageContextMenuTests() { await expect(reaction.includes("👎 1")).toEqual(true); }); - it("Chat User B - Receive reaction in received message", async () => { + it("Chat User A - Receive reaction in received message", async () => { // Validate reactions received on sent message await MessageGroupRemote.waitUntilEmojiReactionRemoteExists("🖖"); const reactions = @@ -144,9 +175,9 @@ export default async function messageContextMenuTests() { await expect(reactions.includes("😂 1")).toEqual(true); }); - it("Chat User B - Both users can react with the same emoji to a message", async () => { + it("Chat User A - Both users can react with the same emoji to a message", async () => { // React with 👎 emoji - await MessageLocal.openContextMenuOnSentMessage("Reply"); + await MessageLocal.openContextMenuOnSentMessage("Four..."); await ContextMenu.validateContextMenuIsOpen(); await ContextMenu.clickOnThirdReaction(); @@ -156,9 +187,9 @@ export default async function messageContextMenuTests() { await expect(reaction.includes("👎 2")).toEqual(true); }); - it("Chat User B - Users can add a new reaction to a message already containing reactions", async () => { + it("Chat User A - Users can add a new reaction to a message already containing reactions", async () => { // React with 👍 emoji - await MessageLocal.openContextMenuOnSentMessage("Reply"); + await MessageLocal.openContextMenuOnSentMessage("Four..."); await ContextMenu.validateContextMenuIsOpen(); await ContextMenu.clickOnFourthReaction(); @@ -167,9 +198,4 @@ export default async function messageContextMenuTests() { const reaction = await MessageGroupLocal.getLastMessageSentSelfReactions(); await expect(reaction.includes("👍 1")).toEqual(true); }); - - after(async () => { - await closeFirstApplication(); - await closeSecondApplication(); - }); -} +}); diff --git a/tests/specs/reusable-accounts/04-message-input.spec.ts b/tests/specs/reusable-accounts/04-message-input.spec.ts index 1e7ec6e1b9..8b5fef647e 100644 --- a/tests/specs/reusable-accounts/04-message-input.spec.ts +++ b/tests/specs/reusable-accounts/04-message-input.spec.ts @@ -8,27 +8,55 @@ import MessageRemote from "@screenobjects/chats/MessageRemote"; import { activateFirstApplication, activateSecondApplication, - closeFirstApplication, - closeSecondApplication, keyboardShortcutPaste, - launchFirstApplication, - launchSecondApplication, pressEnterKey, setClipboardValue, } from "@helpers/commands"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; - -export default async function messageInputTests() { - before(async () => { - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchSecondApplication(); - await CreatePinScreen.loginWithTestUser(); +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; +import FriendsScreen from "@screenobjects/friends/FriendsScreen"; + +describe("MacOS Chats - Message Input Tests", function () { + it("Message Input - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); }); - it("Chat User A - Message Input - User cannot send empty messages", async () => { - // Ensure that input bar is empty and click on send message button + it("Message Input - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); + }); + + it("Message Input - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); + }); + + it("Message Input - Accept Friend Request from User A", async () => { await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); + + it("Message Input - Validate User A accepted friend request", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); + }); + + it("Chat User B - Message Input - User cannot send empty messages", async () => { + // Go to the current list of All friends and then open a Chat conversation with ChatUserA + await FriendsScreen.chatWithFriendButton.waitForExist(); + await FriendsScreen.hoverOnChatWithFriendButton("ChatUserA"); + await FriendsScreen.chatWithFriendButton.click(); + await FriendsScreen.validateSpinnerIsNotShown(); + + // Send message to the other user + await InputBar.typeMessageOnInput("Testing..."); + + await InputBar.clickOnSendMessage(); + await MessageLocal.waitForMessageSentToExist("Testing..."); + + // Ensure that input bar is empty and click on send message button await InputBar.waitForIsShown(true); await InputBar.clearInputBar(); await InputBar.clickOnInputBar(); @@ -39,12 +67,13 @@ export default async function messageInputTests() { await InputBar.clickOnInputBar(); await InputBar.pressEnterKeyOnInputBar(); - // Validate latest message sent displayed on Chat Conversation is still "Two..." - const textMessage = await MessageLocal.getCustomMessageContents("Two..."); - await expect(textMessage).toHaveText("Two..."); + // Validate latest message sent displayed on Chat Conversation is still "Testing..." + const textMessage = + await MessageLocal.getCustomMessageContents("Testing..."); + await expect(textMessage).toHaveText("Testing..."); }); - it("Chat User A - Message Input - User can type up to 1024 chars on input bar", async () => { + it("Chat User B - Message Input - User can type up to 1024 chars on input bar", async () => { // Generate a random text with 1024 chars and set this to clipboard const longText = await InputBar.generateRandomText(); await setClipboardValue(longText); @@ -110,7 +139,7 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate texts with ** markdown are sent in bolds", async () => { - // With Chat User A, send a message with ** markdown + // With Chat User B, send a message with ** markdown await InputBar.typeMessageOnInput("**Bolds1**"); await InputBar.clickOnSendMessage(); await InputBar.goToFiles(); @@ -124,7 +153,7 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate texts with __ markdown are sent in bolds", async () => { - // With Chat User A, send a message with __ markdown + // With Chat User B, send a message with __ markdown await InputBar.typeMessageOnInput("__Bolds2__"); await InputBar.clickOnSendMessage(); await MessageLocal.waitForMessageSentToExist("__Bolds2__"); @@ -134,7 +163,7 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate texts with * and _ markdown are sent in italic", async () => { - // With Chat User A, send a message with _ markdown + // With Chat User B, send a message with _ markdown await InputBar.typeMessageOnInput("_Italic1_"); await InputBar.clickOnSendMessage(); await MessageLocal.waitForMessageSentToExist("_Italic1_"); @@ -152,7 +181,7 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate texts with ~ and ~~ markdown are sent in strikethrough", async () => { - // With Chat User A, send a message with ~ markdown + // With Chat User B, send a message with ~ markdown await InputBar.typeMessageOnInput("~Strikethrough1~"); await InputBar.clickOnSendMessage(); await MessageLocal.waitForMessageSentToExist("~Strikethrough1~"); @@ -160,7 +189,7 @@ export default async function messageInputTests() { await MessageLocal.getCustomMessageContents("~Strikethrough1~"); await expect(messageContentsStrikethroughOne).toHaveText("Strikethrough1"); - // With Chat User A, send a message with ~~ markdown + // With Chat User B, send a message with ~~ markdown await InputBar.typeMessageOnInput("~~Strikethrough2~~"); await InputBar.clickOnSendMessage(); await MessageLocal.waitForMessageSentToExist("~~Strikethrough2~~"); @@ -170,7 +199,7 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate users can send messages using the code language markdown", async () => { - // With Chat User A, send a code snippet with JavaScript language + // With Chat User B, send a code snippet with JavaScript language await InputBar.typeCodeOnInputBar("JavaScript", "let a = 1;"); await InputBar.clickOnSendMessage(); @@ -182,7 +211,7 @@ export default async function messageInputTests() { }); it("Chat Input Text - Code Markdown - User can copy the message from the code block", async () => { - // With Chat User A, click on the copy button from code block of last chat message sent + // With Chat User B, click on the copy button from code block of last chat message sent await MessageLocal.clickOnCopyCodeOfCustomMessageSent("JavaScript"); // Then, paste it into the input bar and assert the text contents on input bar @@ -196,8 +225,9 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate messages with bold markdowns were received in expected format", async () => { - // With Chat User B, validate message with with ** markdown was received in bolds - await activateSecondApplication(); + // With Chat User A, validate message with with ** markdown was received in bolds + await activateFirstApplication(); + await InputBar.waitForIsShown(true); await MessageRemote.waitForReceivingMessage("**Bolds1**"); const messageContentsBoldsOne = @@ -212,13 +242,13 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate messages with italic markdowns were received in expected format", async () => { - // With Chat User B, validate message with with _ markdown was received in italic + // With Chat User A, validate message with with _ markdown was received in italic await MessageRemote.waitForReceivingMessage("_Italic1_"); const messageContentsItalicOne = await MessageRemote.getCustomMessageContents("_Italic1_"); await expect(messageContentsItalicOne).toHaveText("Italic1"); - // With Chat User B, validate message with with * markdown was received in italic + // With Chat User A, validate message with with * markdown was received in italic await MessageRemote.waitForReceivingMessage("*Italic2*"); const messageContentsItalicTwo = await MessageRemote.getCustomMessageContents("*Italic2*"); @@ -226,14 +256,14 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate messages with strikethrough markdowns were received in expected format", async () => { - // With Chat User B, validate message with with ~ markdown was received in Strikethrough + // With Chat User A, validate message with with ~ markdown was received in Strikethrough await InputBar.waitForIsShown(true); await MessageRemote.waitForReceivingMessage("~Strikethrough1~"); const messageContentsStrikethroughOne = await MessageRemote.getCustomMessageContents("~Strikethrough1~"); await expect(messageContentsStrikethroughOne).toHaveText("Strikethrough1"); - // With Chat User B, validate message with with ~~ markdown was received in Strikethrough + // With Chat User A, validate message with with ~~ markdown was received in Strikethrough await MessageRemote.waitForReceivingMessage("~~Strikethrough2~~"); const messageContentsStrikethroughTwo = await MessageRemote.getCustomMessageContents("~~Strikethrough2~~"); @@ -241,7 +271,7 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate message with code markdown is received in expected format", async () => { - // With Chat User B, validate code message was received and is displayed correctly + // With Chat User A, validate code message was received and is displayed correctly await MessageRemote.waitForReceivingCodeMessage("JavaScript"); const codeMessageTextReceived = await MessageRemote.getCustomMessageReceivedCodeMessage("JavaScript"); @@ -249,15 +279,15 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate text starting with https:// is sent as link", async () => { - // With Chat User A - await activateFirstApplication(); + // With Chat User B + await activateSecondApplication(); await InputBar.waitForIsShown(true); await InputBar.typeMessageOnInput("https://www.google.com"); await InputBar.clickOnSendMessage(); }); it("Chat Input Text - Validate text starting with www. is sent as link", async () => { - // With Chat User A + // With Chat User B await InputBar.typeMessageOnInput("www.apple.com"); await InputBar.clickOnSendMessage(); }); @@ -288,12 +318,12 @@ export default async function messageInputTests() { }); it("Chat Input Text - Validate messages with links were received correctly", async () => { - // With Chat User B, validate message with URL starting with https:// was received as link - await activateSecondApplication(); + // With Chat User A, validate message with URL starting with https:// was received as link + await activateFirstApplication(); await InputBar.waitForIsShown(true); await MessageRemote.waitForReceivingLink("https://www.google.com"); - // With Chat User B, validate message with URL starting with www. was received as link + // With Chat User A, validate message with URL starting with www. was received as link await MessageRemote.waitForReceivingLink("www.apple.com"); }); @@ -334,7 +364,7 @@ export default async function messageInputTests() { // Skipping this test since the time spent between switching windows to validate, the typing indicator is already gone xit("Validate Typing Indicator is displayed if remote user is typing", async () => { // Switch to second user and validate that Typing Indicator is displayed - await activateFirstApplication(); + await activateSecondApplication(); await InputBar.waitForIsShown(true); await ChatsLayout.typingIndicator.waitForExist({ timeout: 30000, @@ -343,9 +373,4 @@ export default async function messageInputTests() { "ChatUserB is typing", ); }); - - after(async () => { - await closeFirstApplication(); - await closeSecondApplication(); - }); -} +}); diff --git a/tests/specs/reusable-accounts/05-message-attachments.spec.ts b/tests/specs/reusable-accounts/05-message-attachments.spec.ts index 9e2b5d01b5..060f9b6911 100644 --- a/tests/specs/reusable-accounts/05-message-attachments.spec.ts +++ b/tests/specs/reusable-accounts/05-message-attachments.spec.ts @@ -10,20 +10,49 @@ import Topbar from "@screenobjects/chats/Topbar"; import { activateFirstApplication, activateSecondApplication, - closeFirstApplication, - closeSecondApplication, - launchFirstApplication, - launchSecondApplication, scrollUp, } from "@helpers/commands"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; - -export default async function messageAttachmentsTests() { - before(async () => { - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchSecondApplication(); - await CreatePinScreen.loginWithTestUser(); +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; +import FriendsScreen from "@screenobjects/friends/FriendsScreen"; + +describe("MacOS Chats - Message Attachments Tests", function () { + it("Message Attachments - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); + }); + + it("Message Attachments - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); + }); + + it("Message Attachments - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); + }); + + it("Message Attachments - Accept Friend Request from User A", async () => { + await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); + + it("Message Attachments - Validate User A accepted friend request", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); + }); + + it("Chat User B - Go to chat with User A", async () => { + // Go to the current list of All friends and then open a Chat conversation with ChatUserA + await FriendsScreen.chatWithFriendButton.waitForExist(); + await FriendsScreen.hoverOnChatWithFriendButton("ChatUserA"); + await FriendsScreen.chatWithFriendButton.click(); + await FriendsScreen.validateSpinnerIsNotShown(); + + // Type on input bar and clear message + await InputBar.typeMessageOnInput("Testing..."); + await InputBar.clearInputBar(); }); it("Send files from Browse Files - No files are displayed on modal and user can close modal", async () => { @@ -147,8 +176,9 @@ export default async function messageAttachmentsTests() { it("Send files from Browse Files - Message sent with attachments is shown on remote side", async () => { // Ensure that message sent with attached file is displayed on remote side - // With User A- Validate that message with attachment was received + // With User A - Validate that message with attachment was received await activateFirstApplication(); + await InputBar.clickOnInputBar(); await MessageRemote.chatMessageFileEmbedRemote.waitForExist(); @@ -193,9 +223,22 @@ export default async function messageAttachmentsTests() { await timestamp.click(); }); - it("User can scroll to bottom of chat conversation", async () => { - // Scroll up 1000 px to ensure that the scroll to bottom button is displayed - await scrollUp(1000); + // Skipping test that needs rework + xit("User can send several messages to scroll up on conversation", async () => { + // Send several messages to the other user + for (let i = 0; i < 10; i++) { + await InputBar.clickOnInputBar(); + await InputBar.typeMessageOnInput("one"); + + await InputBar.clickOnSendMessage(); + await MessageLocal.waitForMessageSentToExist("one"); + } + }); + + // Skipping test that needs rework + xit("User can scroll to bottom of chat conversation", async () => { + // Scroll up 2500 px to ensure that the scroll to bottom button is displayed + await scrollUp(2500); // Click on Scroll to Bottom button await ChatsLayout.clickOnScrollToBottom(); @@ -264,9 +307,4 @@ export default async function messageAttachmentsTests() { // Download latest image file received await MessageRemote.downloadReceivedFile(".txt", "Attached2"); }); - - after(async () => { - await closeFirstApplication(); - await closeSecondApplication(); - }); -} +}); diff --git a/tests/specs/reusable-accounts/06-chat-topbar.spec.ts b/tests/specs/reusable-accounts/06-chat-topbar.spec.ts index 87306c14b4..69e87d09ea 100644 --- a/tests/specs/reusable-accounts/06-chat-topbar.spec.ts +++ b/tests/specs/reusable-accounts/06-chat-topbar.spec.ts @@ -5,22 +5,64 @@ import MessageLocal from "@screenobjects/chats/MessageLocal"; import MessageGroupLocal from "@screenobjects/chats/MessageGroupLocal"; import PinnedMessages from "@screenobjects/chats/PinnedMessages"; import Topbar from "@screenobjects/chats/Topbar"; +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; import { activateFirstApplication, - closeFirstApplication, - launchFirstApplication, + activateSecondApplication, } from "@helpers/commands"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; +import ComposeAttachment from "@screenobjects/chats/ComposeAttachment"; + +describe("MacOS Chats - Chat Topbar Tests", function () { + it("Chat Topbar - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); + }); + + it("Chat Topbar - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); + }); + + it("Chat Topbar - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); + }); + + it("Chat Topbar - Accept Friend Request from User A", async () => { + await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); -export default async function chatTopbarTests() { - before(async () => { - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); + it("Chat Topbar - Validate User A accepted friend request", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); + }); + + it("Send files from Browse Files - Upload an image on Files to run tests", async () => { + // Switch control to User A + await activateFirstApplication(); + + // Continue with test execution and clear input bar + await InputBar.clearInputBar(); + + // Click on upload button and attach a file to compose attachment + await InputBar.uploadFileFromLocalDisk("./tests/fixtures/testfile.txt"); + + // Validate contents on Compose Attachments are displayed + await ComposeAttachment.composeAttachmentsFileEmbed.waitForExist(); + await ComposeAttachment.composeAttachmentsFileIcon.waitForExist(); + await ComposeAttachment.composeAttachmentsFileNameText.waitForExist(); + + // Type a text message and send it + await InputBar.typeMessageOnInput("Attached2"); + await InputBar.pressEnterKeyOnInputBar(); + await MessageLocal.waitForMessageSentToExist("Attached2"); }); it("Chat User A - Validate Chat Screen tooltips are displayed", async () => { // Validate Favorites button tooltip - await activateFirstApplication(); await Topbar.hoverOnFavoritesButton(); const favoritesAddTooltipText = await Topbar.topbarAddToFavoritesTooltipText; @@ -117,8 +159,4 @@ export default async function chatTopbarTests() { // Close pinned messages await Topbar.clickOnTopbar(); }); - - after(async () => { - await closeFirstApplication(); - }); -} +}); diff --git a/tests/specs/reusable-accounts/07-quick-profile.spec.ts b/tests/specs/reusable-accounts/07-quick-profile.spec.ts index 1186d59d41..c2c6bfa07b 100644 --- a/tests/specs/reusable-accounts/07-quick-profile.spec.ts +++ b/tests/specs/reusable-accounts/07-quick-profile.spec.ts @@ -1,12 +1,8 @@ require("module-alias/register"); import { getUserKey, - closeFirstApplication, - closeSecondApplication, activateFirstApplication, activateSecondApplication, - launchSecondApplication, - launchFirstApplication, } from "@helpers/commands"; import FriendsScreen from "@screenobjects/friends/FriendsScreen"; import InputBar from "@screenobjects/chats/InputBar"; @@ -15,17 +11,74 @@ import MessageGroupRemote from "@screenobjects/chats/MessageGroupRemote"; import QuickProfile from "@screenobjects/chats/QuickProfile"; import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen"; import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; +import MessageLocal from "@screenobjects/chats/MessageLocal"; +import MessageRemote from "@screenobjects/chats/MessageRemote"; + +describe("MacOS Chats - Quick Profile Tests", function () { + it("Chat Quick Profile - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); + }); + + it("Chat Quick Profile - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); + }); + + it("Chat Quick Profile - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); + }); + + it("Chat Quick Profile - Accept Friend Request from User A", async () => { + await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); + + it("Chat Quick Profile - Validate User A accepted friend request", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); + }); + + it("Chat User B - Send text message to User A", async () => { + // Go to the current list of All friends and then open a Chat conversation with ChatUserA + await FriendsScreen.chatWithFriendButton.waitForExist(); + await FriendsScreen.hoverOnChatWithFriendButton("ChatUserA"); + await FriendsScreen.chatWithFriendButton.click(); + await FriendsScreen.validateSpinnerIsNotShown(); + + // Send message to the other user + await InputBar.typeMessageOnInput("Two..."); + + await InputBar.clickOnSendMessage(); + await MessageLocal.waitForMessageSentToExist("Two..."); + }); + + it("Chat User A - Validate message from User B was received", async () => { + // Switch control to User A + await activateFirstApplication(); + + // Validate message received from Chat User B + await MessageRemote.waitForReceivingMessage("Two..."); + }); -export default async function quickProfileTests() { - before(async () => { - await launchSecondApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); + it("Chat User A - Send one message to Chat User B", async () => { + // Send a message to Chat User B + await InputBar.typeMessageOnInput("Three..."); + await InputBar.clickOnSendMessage(); + await MessageLocal.waitForMessageSentToExist("Three..."); }); - it("Chat User A - Validate contents from local quick profile", async () => { + it("Chat User B - Validate contents from local quick profile", async () => { + // Switch control to User B + await activateSecondApplication(); + + // Validate message received from Chat User B + await MessageRemote.waitForReceivingMessage("Three..."); + // Open quick profile from remote user await MessageGroupLocal.openLocalQuickProfile(); await QuickProfile.quickProfile.waitForExist(); @@ -36,19 +89,19 @@ export default async function quickProfileTests() { await QuickProfile.quickProfileEditProfile.waitForExist(); const quickProfileUsername = await QuickProfile.quickProfileUserNameValueText; - await expect(quickProfileUsername).toHaveText("ChatUserA"); + await expect(quickProfileUsername).toHaveText("ChatUserB"); }); - it("Chat User A - Click on Edit Profile", async () => { + it("Chat User B - Click on Edit Profile", async () => { // Click on Edit Profile from Quick Profile await QuickProfile.clickOnEditProfile(); await SettingsProfileScreen.waitForIsShown(true); await SettingsProfileScreen.goToMainScreen(); }); - it("Chat User B - Validate contents from remote quick profile", async () => { - // With User B - Validate that message was received - await activateSecondApplication(); + it("Chat User A - Validate contents from remote quick profile", async () => { + // With User A - Validate that message was received + await activateFirstApplication(); await InputBar.waitForIsShown(true); await InputBar.clickOnInputBar(); @@ -67,15 +120,15 @@ export default async function quickProfileTests() { // Validate username from quick profile const quickProfileUsername = await QuickProfile.quickProfileUserNameValueText; - await expect(quickProfileUsername).toHaveText("ChatUserA"); + await expect(quickProfileUsername).toHaveText("ChatUserB"); // Click outside to close quick profile await InputBar.clickOnInputBar(); }); - it("Chat User A - Remove Friend", async () => { + it("Chat User B - Remove Friend", async () => { // Open quick profile from remote user - await activateFirstApplication(); + await activateSecondApplication(); await WelcomeScreen.goToMainScreen(); await InputBar.waitForIsShown(true); await MessageGroupRemote.openRemoteQuickProfile(); @@ -88,32 +141,32 @@ export default async function quickProfileTests() { await WelcomeScreen.validateWelcomeScreenIsShown(30000); }); - it("Chat User A - Ensure that Chat User B is not in friends list now", async () => { + it("Chat User B - Ensure that Chat User B is not in friends list now", async () => { // Get current list of All friends and ensure that it does not include the removed user await WelcomeScreen.goToFriends(); const allFriendsList = await FriendsScreen.getAllFriendsList(); - const includesFriend = await allFriendsList.includes("ChatUserB"); + const includesFriend = await allFriendsList.includes("ChatUserA"); await expect(includesFriend).toEqual(false); }); - it("Chat User B - Validate friendship was removed", async () => { - // Switch control to User B - await activateSecondApplication(); + it("Chat User A - Validate friendship was removed", async () => { + // Switch control to User A + await activateFirstApplication(); await WelcomeScreen.waitForIsShown(true); - // With User B - Go to Friends and wait for User A to remove friendship with User B + // With User A - Go to Friends and wait for User B to remove friendship with User A await WelcomeScreen.goToFriends(); await FriendsScreen.validateFriendsScreenIsShown(); }); - it("Chat User A - Send friend request again to User B", async () => { - // Obtain did key from Chat User B - await activateFirstApplication(); + it("Chat User B - Send friend request again to User B", async () => { + // Obtain did key from Chat User A + await activateSecondApplication(); await FriendsScreen.waitForIsShown(true); - const friendDidKey = await getUserKey("ChatUserB"); + const friendDidKey = await getUserKey("ChatUserA"); - // Send friend request to Chat User B - await FriendsScreen.sendFriendRequest(friendDidKey, "ChatUserB"); + // Send friend request to Chat User A + await FriendsScreen.sendFriendRequest(friendDidKey, "ChatUserA"); // Go to Pending Friends List await FriendsScreen.hoverOnPendingListButton(); @@ -125,14 +178,15 @@ export default async function quickProfileTests() { await FriendsScreen.validateAllFriendsListIsShown(); }); - it("Chat User B - Validate button badge displays the number of incoming requests", async () => { - // Switch to Chat User B window - await activateSecondApplication(); + it("Chat User A - Validate button badge displays the number of incoming requests", async () => { + // Switch to Chat User A window + await activateFirstApplication(); await FriendsScreen.waitForIsShown(true); // Go to pending requests list, wait for receiving the friend request and accept it await FriendsScreen.goToFriends(); await FriendsScreen.validateFriendsScreenIsShown(); + await FriendsScreen.validateFriendsButtonBadgeIsShown(); await FriendsScreen.hoverOnPendingListButton(); await FriendsScreen.goToPendingFriendsList(); await FriendsScreen.validateIncomingListIsShown(); @@ -145,9 +199,9 @@ export default async function quickProfileTests() { await expect(friendsButtonBadgeText).toEqual("1"); }); - it("Chat User B - Validate that User A is now a friend", async () => { - // With User B - Accept incoming request - await FriendsScreen.acceptIncomingRequest("ChatUserA"); + it("Chat User A - Validate that User B is now a friend", async () => { + // With User A - Accept incoming request + await FriendsScreen.acceptIncomingRequest("ChatUserB"); // Return to Friends List await FriendsScreen.goToAllFriendsList(); @@ -157,17 +211,12 @@ export default async function quickProfileTests() { await FriendsScreen.validateAllFriendsListIsNotEmpty(); }); - it("Chat User A - Wait until friend request is accepted again", async () => { + it("Chat User B - Wait until friend request is accepted again", async () => { // Validate friend is now on all friends list - await activateFirstApplication(); + await activateSecondApplication(); await FriendsScreen.waitForIsShown(true); // Validate friend is now on all friends list await FriendsScreen.waitUntilUserAcceptedFriendRequest(); }); - - after(async () => { - await closeFirstApplication(); - await closeSecondApplication(); - }); -} +}); diff --git a/tests/specs/reusable-accounts/08-sidebar-chats.spec.ts b/tests/specs/reusable-accounts/08-sidebar-chats.spec.ts index 0e9961b778..455c03fef0 100644 --- a/tests/specs/reusable-accounts/08-sidebar-chats.spec.ts +++ b/tests/specs/reusable-accounts/08-sidebar-chats.spec.ts @@ -2,10 +2,6 @@ require("module-alias/register"); import { activateFirstApplication, activateSecondApplication, - closeFirstApplication, - closeSecondApplication, - launchFirstApplication, - launchSecondApplication, } from "@helpers/commands"; import ChatsLayout from "@screenobjects/chats/ChatsLayout"; import ChatsSidebar from "@screenobjects/chats/ChatsSidebar"; @@ -19,24 +15,39 @@ import MessageRemote from "@screenobjects/chats/MessageRemote"; import Topbar from "@screenobjects/chats/Topbar"; import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen"; import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; -export default async function sidebarChatsTests() { - before(async () => { - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchSecondApplication(); - await CreatePinScreen.loginWithTestUser(); +describe("MacOS Chats - Sidebar Chats Tests", function () { + it("Chats Sidebar - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); }); - it("Chat User B - Send message with markdown to User A", async () => { - // Go to the current list of All friends and then open a Chat conversation with ChatUserA - await WelcomeScreen.goToFriends(); - await FriendsScreen.waitForIsShown(true); - await FriendsScreen.validateChatWithFriendButtonIsShown(); - await FriendsScreen.hoverOnChatWithFriendButton("ChatUserA"); - await FriendsScreen.clickOnChatWithFriend(); - await ChatsLayout.validateChatLayoutIsShown(); + it("Chats Sidebar - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); + }); + + it("Chats Sidebar - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); + }); + + it("Chats Sidebar - Accept Friend Request from User A", async () => { + await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); + + it("Chats Sidebar - Validate User A accepted friend request", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); + }); + + it("Chat User A - Send message with markdown to User B", async () => { + // Switch control to User A + await activateFirstApplication(); // Send message with markdown to Chat User B await InputBar.typeMessageOnInput("__hello__"); @@ -46,86 +57,79 @@ export default async function sidebarChatsTests() { await MessageLocal.waitForMessageSentToExist("__hello__"); // Validate last message on Sidebar is not formatted with markdown - await ChatsSidebar.validateLastMessageDisplayed("__hello__", "ChatUserA"); + await ChatsSidebar.validateLastMessageDisplayed("__hello__", "ChatUserB"); }); - it("Chat User A - Wait until Chat User B accepts friend request and sends a message", async () => { - // With User A - Wait until user B accepts the friend request - await activateFirstApplication(); - await WelcomeScreen.goToFriends(); - await FriendsScreen.waitForIsShown(true); - await FriendsScreen.goToAllFriendsList(); - await FriendsScreen.validateAllFriendsListIsShown(); - await FriendsScreen.validateAllFriendsListIsShown(); - await FriendsScreen.waitUntilUserAcceptedFriendRequest(); + it("Chat User B - Wait until Chat User A sends a message", async () => { + // With User B - Wait until user B sends a message + await activateSecondApplication(); - // Go to another part of the app - await FriendsScreen.goToMainScreen(); + // Go to the current list of All friends and then open a Chat conversation with ChatUserA + await FriendsScreen.validateChatWithFriendButtonIsShown(); // Wait until message is received await ChatsSidebar.waitForReceivingMessageOnSidebar(); }); - it("Chat User A - Sidebar - Any active chats user has created should appear in Sidebar", async () => { + it("Chat User B - Sidebar - Any active chats user has created should appear in Sidebar", async () => { // Validate Sidebar shows Username - await ChatsSidebar.validateUsernameIsDisplayed("ChatUserB"); + await ChatsSidebar.validateUsernameIsDisplayed("ChatUserA"); // Validate number of unread messages is displayed on sidebar - await ChatsSidebar.validateNumberOfUnreadMessages("1", "ChatUserB"); + await ChatsSidebar.validateNumberOfUnreadMessages("1", "ChatUserA"); // Validate time ago displayed on sidebar - await ChatsSidebar.validateLastMessageTimeAgo("ChatUserB"); + await ChatsSidebar.validateLastMessageTimeAgo("ChatUserA"); }); it("Sidebar - Message preview on Sidebar should not display the message with markdown", async () => { // Validate last message contents on Sidebar displays hello __hello__ without applying the markdown - await ChatsSidebar.validateLastMessageDisplayed("__hello__", "ChatUserB"); + await ChatsSidebar.validateLastMessageDisplayed("__hello__", "ChatUserA"); }); - it("Chat User A - Sidebar - Context Menu - Clear Unreads", async () => { + it("Chat User B - Sidebar - Context Menu - Clear Unreads", async () => { // Open context menu and right click on Clear Unreads - await ChatsSidebar.openContextMenuOnSidebar("ChatUserB"); + await ChatsSidebar.openContextMenuOnSidebar("ChatUserA"); await ContextMenuSidebar.selectChatsClearUnreads(); - await ChatsSidebar.validateNoUnreadMessages("ChatUserB"); + await ChatsSidebar.validateNoUnreadMessages("ChatUserA"); }); - it("Chat User A - Sidebar - Context Menu - Hide chat", async () => { + it("Chat User B - Sidebar - Context Menu - Hide chat", async () => { // Open context menu and right click on Hide chat - await ChatsSidebar.openContextMenuOnSidebar("ChatUserB"); + await ChatsSidebar.openContextMenuOnSidebar("ChatUserA"); await ContextMenuSidebar.selectChatsHideChat(); - await ChatsSidebar.validateSidebarChatIsNotDisplayed("ChatUserB"); + await ChatsSidebar.validateSidebarChatIsNotDisplayed("ChatUserA"); }); - it("Chat User A - Sidebar - Send a message to User B", async () => { + it("Chat User B - Sidebar - Send a message to User A", async () => { // Go to the current list of All friends and then open a Chat conversation with ChatUserA - await WelcomeScreen.goToFriends(); await FriendsScreen.validateChatWithFriendButtonIsShown(); - await FriendsScreen.hoverOnChatWithFriendButton("ChatUserB"); + await FriendsScreen.hoverOnChatWithFriendButton("ChatUserA"); await FriendsScreen.clickOnChatWithFriend(); await ChatsLayout.validateChatLayoutIsShown(); - // Send message to Chat User B + // Send message to Chat User A await InputBar.typeMessageOnInput("Hi..."); await InputBar.clickOnSendMessage(); }); - it("Chat User B - Validate message was received", async () => { - // With User B - Wait until message is received - await activateSecondApplication(); + it("Chat User A - Validate message was received", async () => { + // With User A - Wait until message is received + await activateFirstApplication(); await ChatsSidebar.waitForIsShown(true); await MessageRemote.waitForReceivingMessage("Hi..."); }); - it("Chat User A - Sidebar - Persists between different sections of the app - Files Screen", async () => { + it("Chat User B - Sidebar - Persists between different sections of the app - Files Screen", async () => { // Validate on Files Screen that sidebar is displayed - await activateFirstApplication(); + await activateSecondApplication(); await ChatsLayout.waitForIsShown(true); await ChatsLayout.goToFiles(); await FilesScreen.validateFilesScreenIsShown(); await ChatsSidebar.validateSidebarChatsIsShown(); }); - it("Chat User A - Chats Sidebar is hidden when entering to Settings Screen", async () => { + it("Chat User B - Chats Sidebar is hidden when entering to Settings Screen", async () => { // Go to Settings Profile Screen await FilesScreen.goToSettings(); await SettingsProfileScreen.validateSettingsProfileIsShown(); @@ -136,7 +140,7 @@ export default async function sidebarChatsTests() { }); }); - it("Chat User A - Chats Sidebar is displayed again when opening Friends Screen", async () => { + it("Chat User B - Chats Sidebar is displayed again when opening Friends Screen", async () => { // Validate on Friends Screen that sidebar is displayed await SettingsProfileScreen.goToFriends(); await FriendsScreen.validateFriendsScreenIsShown(); @@ -146,7 +150,7 @@ export default async function sidebarChatsTests() { await ChatsSidebar.goToSidebarFirstChat(); }); - it("Chat User A - Sidebar - Validate Hamburger button and back buttons can hide or display the sidebar", async () => { + it("Chat User B - Sidebar - Validate Hamburger button and back buttons can hide or display the sidebar", async () => { // Click on hamburger button and validate that Sidebar is hidden await ChatsLayout.clickOnHamburgerButton(); @@ -155,9 +159,9 @@ export default async function sidebarChatsTests() { await ChatsSidebar.validateSidebarChatsIsShown(); }); - it("Chat User B - Sidebar - Wait for receiving a a new message", async () => { - // Switch to Chat User B window - await activateSecondApplication(); + it("Chat User A - Sidebar - Wait for receiving a a new message", async () => { + // Switch to Chat User A window + await activateFirstApplication(); await InputBar.waitForIsShown(true); // With User B - Wait until message is received @@ -166,39 +170,39 @@ export default async function sidebarChatsTests() { await expect(latestMessage).toHaveText("Hi..."); }); - it("Chat User A - Sidebar - Context Menu - Delete chat", async () => { - // Switch to Chat User A window - await activateFirstApplication(); + it("Chat User B - Sidebar - Context Menu - Delete chat", async () => { + // Switch to Chat User B window + await activateSecondApplication(); await ChatsSidebar.waitForIsShown(true); // Open context menu and right click on Delete chat - await ChatsSidebar.openContextMenuOnSidebar("ChatUserB"); + await ChatsSidebar.openContextMenuOnSidebar("ChatUserA"); await ContextMenuSidebar.selectChatsDeleteConversation(); await WelcomeScreen.validateWelcomeScreenIsShown(30000); }); - it("Chat User B - Sidebar - If user deletes chat on remote side, it will be removed on local side as well", async () => { - // Switch to Chat User B window - await activateSecondApplication(); + it("Chat User A - Sidebar - If user deletes chat on remote side, it will be removed on local side as well", async () => { + // Switch to Chat User A window + await activateFirstApplication(); // After user deletes chat conversation on remote side, chat is deleted on local side and Welcome Image displayed again await WelcomeScreen.waitForIsShown(true); }); - it("Chat User A - Sidebar without messages sent displays No messages yet, sent one", async () => { - // Switch to Chat User A window - await activateFirstApplication(); + it("Chat User B - Sidebar without messages sent displays No messages yet, sent one", async () => { + // Switch to Chat User B window + await activateSecondApplication(); await WelcomeScreen.waitForIsShown(true); // Go to the current list of All friends and then open a Chat conversation with ChatUserA await WelcomeScreen.goToFriends(); await FriendsScreen.validateChatWithFriendButtonIsShown(); - await FriendsScreen.hoverOnChatWithFriendButton("ChatUserB"); + await FriendsScreen.hoverOnChatWithFriendButton("ChatUserA"); await FriendsScreen.clickOnChatWithFriend(); await ChatsLayout.validateChatLayoutIsShown(); // Validate that sidebar record is displayed with correct username and status const sidebarChatUsername = await ChatsSidebar.sidebarChatsUserNameValue; - await expect(sidebarChatUsername).toHaveText("ChatUserB"); + await expect(sidebarChatUsername).toHaveText("ChatUserA"); const sidebarChatStatus = await ChatsSidebar.sidebarChatsUserStatusValue; await expect(sidebarChatStatus).toHaveText( @@ -212,14 +216,14 @@ export default async function sidebarChatsTests() { await FavoritesSidebar.validateFavoritesAreShown(); // Favorites Sidebar User bubble should be displayed with image - await FavoritesSidebar.validateFavoritesUserImage("ChatUserB"); + await FavoritesSidebar.validateFavoritesUserImage("ChatUserA"); }); it("Sidebar - Favorites - Context Menu - Chat with user", async () => { // Open context menu and right click on Chat with user await FavoritesSidebar.goToFiles(); await FilesScreen.validateFilesScreenIsShown(); - await FavoritesSidebar.openContextMenuOnFavoritesUser("ChatUserB"); + await FavoritesSidebar.openContextMenuOnFavoritesUser("ChatUserA"); await FavoritesSidebar.clickOnContextMenuFavoritesChat(); await ChatsLayout.validateChatLayoutIsShown(); await InputBar.typeMessageOnInput("Hi..."); @@ -228,12 +232,7 @@ export default async function sidebarChatsTests() { it("Sidebar - Favorites - Context Menu - Remove user from Favorites", async () => { // Open context menu and right click on Remove user from Favorites - await FavoritesSidebar.openContextMenuOnFavoritesUser("ChatUserB"); + await FavoritesSidebar.openContextMenuOnFavoritesUser("ChatUserA"); await FavoritesSidebar.clickOnContextMenuFavoriteRemove(); }); - - after(async () => { - await closeFirstApplication(); - await closeSecondApplication(); - }); -} +}); diff --git a/tests/specs/reusable-accounts/09-group-chats.spec.ts b/tests/specs/reusable-accounts/09-group-chats.spec.ts index 32723bd407..65a47f9ec2 100644 --- a/tests/specs/reusable-accounts/09-group-chats.spec.ts +++ b/tests/specs/reusable-accounts/09-group-chats.spec.ts @@ -10,22 +10,58 @@ import Topbar from "@screenobjects/chats/Topbar"; import { activateFirstApplication, activateSecondApplication, - closeFirstApplication, - closeSecondApplication, - launchFirstApplication, - launchSecondApplication, } from "@helpers/commands"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; +import FriendsScreen from "@screenobjects/friends/FriendsScreen"; + +describe("MacOS Chats - Group Chats Tests", function () { + it("Group Chats Main - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); + }); -export default async function groupChatTests() { - before(async () => { - await launchSecondApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); + it("Group Chats Main - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); + }); + + it("Group Chats Main - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); + }); + + it("Group Chats Main - Accept Friend Request from User A", async () => { + await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); + + it("Group Chats Main - Validate User A accepted friend request", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); + }); + + it("Chat User B - Send text message to User A", async () => { + // Go to the current list of All friends and then open a Chat conversation with ChatUserA + await FriendsScreen.chatWithFriendButton.waitForExist(); + await FriendsScreen.hoverOnChatWithFriendButton("ChatUserA"); + await FriendsScreen.chatWithFriendButton.click(); + await FriendsScreen.validateSpinnerIsNotShown(); + + // Send message to the other user + await InputBar.typeMessageOnInput("Testing..."); + + await InputBar.clickOnSendMessage(); + await MessageLocal.waitForMessageSentToExist("Testing..."); }); it("Chat User A - Create Group Chat button tooltip", async () => { + // Switch control to User A + await activateFirstApplication(); + + await ChatsSidebar.goToSidebarChat("ChatUserB"); + // Hover on create group chat button and validate tooltip is shown await ChatsSidebar.hoverOnCreateGroupButton(); }); @@ -106,7 +142,7 @@ export default async function groupChatTests() { await expect(topbarUserStatus).toHaveText("Members (2)"); }); - it("User B - Group Chat is displayed on remote participant users sidebar", async () => { + it("Chat User B - Group Chat is displayed on remote participant users sidebar", async () => { // Switch to user B and validate group chat is displayed on remote participant users sidebar and then go to group chat await activateSecondApplication(); await ChatsSidebar.waitForGroupToBeCreated("Test"); @@ -189,9 +225,4 @@ export default async function groupChatTests() { const topbarUserName = await Topbar.topbarUserNameValue; await expect(topbarUserName).toHaveText("Test"); }); - - after(async () => { - await closeFirstApplication(); - await closeSecondApplication(); - }); -} +}); diff --git a/tests/specs/reusable-accounts/10-group-chats-edit.spec.ts b/tests/specs/reusable-accounts/10-group-chats-edit.spec.ts index 265d8bba27..3c70604860 100644 --- a/tests/specs/reusable-accounts/10-group-chats-edit.spec.ts +++ b/tests/specs/reusable-accounts/10-group-chats-edit.spec.ts @@ -8,22 +8,66 @@ import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; import { activateFirstApplication, activateSecondApplication, - closeFirstApplication, - closeSecondApplication, - launchFirstApplication, - launchSecondApplication, } from "@helpers/commands"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; +import CreateGroupChat from "@screenobjects/chats/CreateGroupChat"; + +describe("MacOS Chats - Group Chats Edit Tests", function () { + it("Group Chats Edit - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); + }); + + it("Group Chats Edit - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); + }); + + it("Group Chats Edit - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); + }); -export default async function groupChatEditTests() { - before(async () => { - await launchSecondApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); + it("Group Chats Edit - Accept Friend Request from User A", async () => { + await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); + + it("Group Chats Edit - Validate User A accepted friend request", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); + }); + + it("Chat User A - Create a group chat with User B", async () => { + // Switch control to User + await activateFirstApplication(); + + // Open modal to create group chat + await ChatsSidebar.clickOnCreateGroupChat(); + await CreateGroupChat.validateCreateGroupChatsIsShown(); + + // Open modal to create group chat and type valid participant and then create group chat + await CreateGroupChat.validateCreateGroupChatButtonIsShown(); + await CreateGroupChat.typeOnGroupName("Test"); + await CreateGroupChat.typeOnUsersSearchInput("Ch"); + await CreateGroupChat.selectUserFromList("ChatUserB"); + await CreateGroupChat.clickOnCreateGroupChat(); + await ChatsSidebar.waitForGroupToBeCreated("Test"); + }); + + it("User B - Group Chat is displayed on remote participant users sidebar", async () => { + // Switch to user B and validate group chat is displayed on remote participant users sidebar and then go to group chat + await activateSecondApplication(); + await ChatsSidebar.waitForGroupToBeCreated("Test"); }); it("Group Chat Creator - Manage Members button tooltip", async () => { + // Switch to user A + await activateFirstApplication(); + await ChatsSidebar.goToSidebarGroupChat("Test"); + // Hover on Manage Members button and validate tooltip is shown await Topbar.hoverOnManageMembersButton(); @@ -87,6 +131,8 @@ export default async function groupChatEditTests() { // Validate group name was changed correctly on remote side await ChatsSidebar.waitForGroupToBeCreated("X"); + await ChatsSidebar.goToSidebarGroupChat("X"); + await Topbar.validateTopbarExists(); const topbarFirstUserName = await Topbar.topbarUserNameValue; await expect(topbarFirstUserName).toHaveText("X"); }); @@ -241,9 +287,4 @@ export default async function groupChatEditTests() { const topbarFirstUserName = await Topbar.topbarUserNameValue; await expect(topbarFirstUserName).toHaveText("renamed"); }); - - after(async () => { - await closeFirstApplication(); - await closeSecondApplication(); - }); -} +}); diff --git a/tests/specs/reusable-accounts/11-group-chats-sidebar.spec.ts b/tests/specs/reusable-accounts/11-group-chats-sidebar.spec.ts index feaa642dbc..8fd474b151 100644 --- a/tests/specs/reusable-accounts/11-group-chats-sidebar.spec.ts +++ b/tests/specs/reusable-accounts/11-group-chats-sidebar.spec.ts @@ -4,32 +4,71 @@ import ContextMenuSidebar from "@screenobjects/chats/ContextMenuSidebar"; import ManageMembers from "@screenobjects/chats/ManageMembers"; import FavoritesSidebar from "@screenobjects/chats/FavoritesSidebar"; import FilesScreen from "@screenobjects/files/FilesScreen"; -import FriendsScreen from "@screenobjects/friends/FriendsScreen"; import InputBar from "@screenobjects/chats/InputBar"; import MessageLocal from "@screenobjects/chats/MessageLocal"; import Topbar from "@screenobjects/chats/Topbar"; import { activateFirstApplication, activateSecondApplication, - closeFirstApplication, - closeSecondApplication, - launchFirstApplication, - launchSecondApplication, } from "@helpers/commands"; -import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; -import chatsTests from "@specs/02-chats.spec"; +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; +import CreateGroupChat from "@screenobjects/chats/CreateGroupChat"; + +describe("MacOS Chats - Group Chats Favorites and Sidebar Tests", function () { + it("Group Chats Sidebar - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); + }); + + it("Group Chats Sidebar - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); + }); + + it("Group Chats Sidebar - Send Friend Request to User A", async () => { + await sendFriendRequestToUser("ChatUserA"); + }); + + it("Group Chats Sidebar - Accept Friend Request from User A", async () => { + await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); + + it("Group Chats Sidebar - Validate User A accepted friend request", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); + }); + + it("Chat User A - Create a group chat with User B", async () => { + // Switch control to User + await activateFirstApplication(); + + // Open modal to create group chat + await ChatsSidebar.clickOnCreateGroupChat(); + await CreateGroupChat.validateCreateGroupChatsIsShown(); -export default async function groupChatSidebarTests() { - before(async () => { - await launchSecondApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); + // Open modal to create group chat and type valid participant and then create group chat + await CreateGroupChat.validateCreateGroupChatButtonIsShown(); + await CreateGroupChat.typeOnGroupName("Test"); + await CreateGroupChat.typeOnUsersSearchInput("Ch"); + await CreateGroupChat.selectUserFromList("ChatUserB"); + await CreateGroupChat.clickOnCreateGroupChat(); + await ChatsSidebar.waitForGroupToBeCreated("Test"); + }); + + it("User B - Group Chat is displayed on remote participant users sidebar", async () => { + // Switch to user B and validate group chat is displayed on remote participant users sidebar and then go to group chat + await activateSecondApplication(); + await ChatsSidebar.waitForGroupToBeCreated("Test"); }); it("Group Chat - Add group to favorites", async () => { - // Return control of execution to User A and leave Participants List screen - await ChatsSidebar.goToSidebarGroupChat("renamed"); + // Switch to user A + await activateFirstApplication(); + await ChatsSidebar.goToSidebarGroupChat("Test"); await Topbar.clickOnTopbar(); // Click on Favorites button for Group Chat @@ -38,7 +77,7 @@ export default async function groupChatSidebarTests() { // Favorites Sidebar should be displayed and showing the name of the group added to Favorites // Favorites Sidebar User bubble should be displayed - await FavoritesSidebar.validateFavoritesUserImage("renamed"); + await FavoritesSidebar.validateFavoritesUserImage("Test"); }); it("Group Chat - Remove group from favorites", async () => { @@ -55,7 +94,7 @@ export default async function groupChatSidebarTests() { it("Group Chat - Send message to the group with User B", async () => { // Switch test execution control to User B and send message to the group await activateSecondApplication(); - await ChatsSidebar.goToSidebarGroupChat("renamed"); + await ChatsSidebar.goToSidebarGroupChat("Test"); await InputBar.typeMessageOnInput("HelloGroup"); await InputBar.clickOnSendMessage(); await MessageLocal.waitForMessageSentToExist("HelloGroup"); @@ -66,30 +105,30 @@ export default async function groupChatSidebarTests() { await activateFirstApplication(); // Validate Sidebar shows Group Name - await ChatsSidebar.validateUsernameIsDisplayed("renamed"); + await ChatsSidebar.validateUsernameIsDisplayed("Test"); // Validate last message content from group is displayed on sidebar - await ChatsSidebar.validateLastMessageDisplayed("HelloGroup", "renamed"); + await ChatsSidebar.validateLastMessageDisplayed("HelloGroup", "Test"); // Validate number of unread messages from the group is displayed on sidebar - await ChatsSidebar.validateNumberOfUnreadMessages("1", "renamed"); + await ChatsSidebar.validateNumberOfUnreadMessages("1", "Test"); // Validate time ago is displayed on sidebar for group chat - await ChatsSidebar.validateLastMessageTimeAgo("renamed"); + await ChatsSidebar.validateLastMessageTimeAgo("Test"); }); it("Group Chat - Sidebar - Context Menu - Clear Unreads", async () => { // Open context menu on group chat and select Clear Unreads - await ChatsSidebar.openContextMenuOnGroupChat("renamed"); + await ChatsSidebar.openContextMenuOnGroupChat("Test"); await ContextMenuSidebar.selectChatsClearUnreads(); - await ChatsSidebar.validateNoUnreadMessages("renamed"); + await ChatsSidebar.validateNoUnreadMessages("Test"); }); it("Group Chat - Sidebar - Context Menu - Hide chat", async () => { // Open context menu on group chat and select Hide Chat - await ChatsSidebar.openContextMenuOnGroupChat("renamed"); + await ChatsSidebar.openContextMenuOnGroupChat("Test"); await ContextMenuSidebar.selectChatsHideChat(); - await ChatsSidebar.validateSidebarChatIsNotDisplayed("renamed"); + await ChatsSidebar.validateSidebarChatIsNotDisplayed("Test"); }); it("Group Chat - Send another message to show again the group chat", async () => { @@ -103,17 +142,17 @@ export default async function groupChatSidebarTests() { it("Group Chat - Validate remote user received the message", async () => { // Switch control to User A and validate that message was received await activateFirstApplication(); - await ChatsSidebar.waitForGroupToBeCreated("renamed"); - await ChatsSidebar.goToSidebarGroupChat("renamed"); + await ChatsSidebar.waitForGroupToBeCreated("Test"); + await ChatsSidebar.goToSidebarGroupChat("Test"); await Topbar.validateTopbarExists(); }); it("Group Chat - Sidebar - Leave group", async () => { // Switch control to User B and leave group chat await activateSecondApplication(); - await ChatsSidebar.openContextMenuOnGroupChat("renamed"); + await ChatsSidebar.openContextMenuOnGroupChat("Test"); await ContextMenuSidebar.selectChatsLeaveGroup(); - await ChatsSidebar.validateSidebarChatIsNotDisplayed("renamed"); + await ChatsSidebar.validateSidebarChatIsNotDisplayed("Test"); }); it("Group Chat - Sidebar - If a user leaves a group, remote user will see the number of group members decreased", async () => { @@ -125,7 +164,7 @@ export default async function groupChatSidebarTests() { // Validate topbar contents has correct name const topbarUserName = await Topbar.topbarUserNameValue; - await expect(topbarUserName).toHaveText("renamed"); + await expect(topbarUserName).toHaveText("Test"); // Validate topbar contents has correct number of participants const topbarUserStatus = await Topbar.topbarUserStatusValue; @@ -160,33 +199,28 @@ export default async function groupChatSidebarTests() { await FilesScreen.validateFilesScreenIsShown(); await FilesScreen.goToMainScreen(); await ChatsSidebar.validateSidebarChatsIsShown(); - await ChatsSidebar.waitForGroupToBeCreated("renamed"); - await ChatsSidebar.goToSidebarGroupChat("renamed"); + await ChatsSidebar.waitForGroupToBeCreated("Test"); + await ChatsSidebar.goToSidebarGroupChat("Test"); await Topbar.validateTopbarExists(); // Validate topbar contents has correct name const topbarUserName = await Topbar.topbarUserNameValue; - await expect(topbarUserName).toHaveText("renamed"); + await expect(topbarUserName).toHaveText("Test"); }); it("Group Chat - Sidebar - Delete group", async () => { // Switch execution to User A and delete the group await activateFirstApplication(); - await ChatsSidebar.openContextMenuOnGroupChat("renamed"); + await ChatsSidebar.openContextMenuOnGroupChat("Test"); await ContextMenuSidebar.selectChatsDeleteGroup(); // Ensure that group was removed on local side - await ChatsSidebar.validateSidebarChatIsNotDisplayed("renamed"); + await ChatsSidebar.validateSidebarChatIsNotDisplayed("Test"); }); it("Group Chat - Sidebar - Deleted group is not shown on remote side", async () => { // Switch execution to remote user and ensure that group was removed on this side too await activateSecondApplication(); - await ChatsSidebar.validateSidebarChatIsNotDisplayed("renamed"); - }); - - after(async () => { - await closeFirstApplication(); - await closeSecondApplication(); + await ChatsSidebar.validateSidebarChatIsNotDisplayed("Test"); }); -} +}); 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 082315030a..c7cbea504d 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,152 +1,61 @@ 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, + activateSecondApplication, activateThirdApplication, - closeFirstApplication, - closeThirdApplication, - getUserKey, - saveTestKeys, - scrollDown, - launchFirstApplication, - launchThirdApplication, } from "@helpers/commands"; +import { + acceptFriendRequest, + createUserAndSaveDidKey, + sendFriendRequestToUser, + validateFriendRequestWasAccepted, +} from "@helpers/commandsNewUser"; +import InputBar from "@screenobjects/chats/InputBar"; +import FriendsScreen from "@screenobjects/friends/FriendsScreen"; -export default async function groupChatMultipleUsersTests() { - before(async () => { - await launchFirstApplication(); - await CreatePinScreen.loginWithTestUser(); - await launchThirdApplication(); - await CreatePinScreen.loginWithTestUser(); - }); - - it("Chat User C - Create Account", async () => { - // Continue setting up third account - await WelcomeScreen.goToSettings(); - await SettingsProfileScreen.validateSettingsProfileIsShown(); - - // Click on Copy ID button and assert Toast Notification is displayed - await SettingsProfileScreen.openCopyIDContextMenu(); - await SettingsProfileScreen.clickOnContextMenuCopyDidKey(); - - // Wait for toast notification of Copied To Clipboard to not exist - await SettingsProfileScreen.waitUntilNotificationIsClosed(); - - // Paste copied DID Key into Status Input - await SettingsProfileScreen.pasteUserKeyInStatus(); - - // Wait for toast notification of Profile Updated to not exist - await SettingsGeneralScreen.waitUntilNotificationIsClosed(); - - // Grab cache folder and restart - const didkey = await SettingsProfileScreen.getCopiedDidFromStatusInput(); - await saveTestKeys("ChatUserC", didkey); - await SettingsProfileScreen.deleteStatus(); +xdescribe("MacOS Chats - Group Chats Multiple Users Tests", function () { + it("Chat Friend Requests - Create First Account", async () => { + await createUserAndSaveDidKey("ChatUserA", 1); }); - it("Chat User C - Settings General - Reduce font size", async () => { - // Go to General Settings and reduce Font Size by 0.5 - await SettingsProfileScreen.goToGeneralSettings(); - await SettingsGeneralScreen.waitForIsShown(true); - - // Click on font scaling minus - await SettingsGeneralScreen.clickOnFontScalingMinus(); + it("Chat Friend Requests - Create Second Account", async () => { + await createUserAndSaveDidKey("ChatUserB", 2); }); - 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 SettingsGeneralScreen.goToAboutSettings(); - await SettingsAboutScreen.waitForIsShown(true); - await SettingsAboutScreen.unlockDeveloperSettings(); - - // Validate Developer Settings button is unlocked - const developerSettingsButton = await SettingsAboutScreen.developerButton; - await developerSettingsButton.waitForDisplayed(); - - // Go to Menu from the left and Scroll Down - const settingsAboutButton = await SettingsAboutScreen.aboutButton; - await SettingsAboutScreen.hoverOnElement(settingsAboutButton); - await scrollDown(1000); - - // Go to Settings Developer and Enable Save Logs in a File - await SettingsAboutScreen.goToDeveloperSettings(); - await SettingsDeveloperScreen.waitForIsShown(true); - await SettingsDeveloperScreen.clickOnSaveLogs(); - await SettingsDeveloperScreen.validateSaveLogsIsEnabled(); + it("Chat Friend Requests - Create Third Account", async () => { + await createUserAndSaveDidKey("ChatUserC", 3); }); - it("Chat User C - Settings Notifications - Disable notifications", async () => { - // Go to Notifications Settings and disable all notifications - await SettingsDeveloperScreen.goToNotificationsSettings(); - await SettingsNotificationsScreen.validateSettingsNotificationsIsShown(); - await SettingsNotificationsScreen.clickOnFriendsNotifications(); - await SettingsNotificationsScreen.clickOnMessagesNotifications(); - - // Go to Friends Screen - await SettingsNotificationsScreen.goToFriends(); - await FriendsScreen.validateFriendsScreenIsShown(); + it("Group Chats Sidebar - User B sends Friend Request to User A", async () => { + await activateSecondApplication(); + await sendFriendRequestToUser("ChatUserA"); }); - it("Chat User C - Send friend request to User A", async () => { - await WelcomeScreen.goToFriends(); - await FriendsScreen.waitForIsShown(true); - - // Obtain did key from Chat User A - const friendDidKey = await getUserKey("ChatUserA"); - await FriendsScreen.sendFriendRequest(friendDidKey, "ChatUserA"); - - // Go to All Friends List - await FriendsScreen.goToAllFriendsList(); - await FriendsScreen.validateAllFriendsListIsShown(); - }); - - it("Chat User A - Accept friend request from User C and go to chat button", async () => { - // Switch control to User A + it("Group Chats Sidebar - User A accepts Friend Request from User B", async () => { await activateFirstApplication(); + await acceptFriendRequest("ChatUserB"); + }); - // Go to Friends List - await ChatsSidebar.goToFriends(); - await FriendsScreen.validateFriendsScreenIsShown(); - - // With User A - Go to pending requests list, wait for receiving the friend request and accept it - await FriendsScreen.hoverOnPendingListButton(); - await FriendsScreen.goToPendingFriendsList(); - await FriendsScreen.validateIncomingListIsShown(); - await FriendsScreen.waitUntilFriendRequestIsReceived(); - await FriendsScreen.acceptIncomingRequest("ChatUserC"); - - // Validate friend is now on all friends list - await FriendsScreen.goToAllFriendsList(); - await FriendsScreen.validateAllFriendsListIsShown(); - await FriendsScreen.validateAllFriendsListIsNotEmpty(); - - // Go to Chat with User C - await FriendsScreen.goToChatWithFriend(); + it("Group Chats Sidebar - Validate User A accepted friend request from User B", async () => { + await activateSecondApplication(); + await validateFriendRequestWasAccepted(); }); - it("Chat User C - Validate friend request was accepted", async () => { + it("Group Chats Sidebar - User C sends Friend Request to User A", async () => { // Switch control to User C await activateThirdApplication(); + await sendFriendRequestToUser("ChatUserA"); + }); - // With User C - Go to pending requests list, wait for receiving the friend request and accept it - await FriendsScreen.waitUntilUserAcceptedFriendRequest(); - - // Validate friend is now on all friends list - await FriendsScreen.goToAllFriendsList(); - await FriendsScreen.validateAllFriendsListIsShown(); - await FriendsScreen.validateAllFriendsListIsNotEmpty(); + it("Group Chats Sidebar - User A accepts Friend Request from User C", async () => { + await activateFirstApplication(); + await InputBar.goToFriends(); + await FriendsScreen.waitForIsShown(true); + await acceptFriendRequest("ChatUserC"); }); - after(async () => { - await closeFirstApplication(); - await closeThirdApplication(); + it("Group Chats Sidebar - Validate User A accepted friend request from User C", async () => { + await activateThirdApplication(); + await validateFriendRequestWasAccepted(); }); -} +}); diff --git a/tests/suites/Chats/01-Chats.suite.ts b/tests/suites/Chats/01-Chats.suite.ts index 331bb0cdb6..e69de29bb2 100644 --- a/tests/suites/Chats/01-Chats.suite.ts +++ b/tests/suites/Chats/01-Chats.suite.ts @@ -1,34 +0,0 @@ -require("module-alias/register"); -import createChatAccountsTests from "@specs/reusable-accounts/00-create-three-instances.spec"; -import chatsFriendsRequests from "@specs/reusable-accounts/01-create-accounts-and-friends.spec"; -import repliesTests from "@specs/reusable-accounts/02-chat-replies.spec"; -import messageContextMenuTests from "@specs/reusable-accounts/03-message-context-menu.spec"; -import messageInputTests from "@specs/reusable-accounts/04-message-input.spec"; -import messageAttachmentsTests from "@specs/reusable-accounts/05-message-attachments.spec"; -import chatTopbarTests from "@specs/reusable-accounts/06-chat-topbar.spec"; -import quickProfileTests from "@specs/reusable-accounts/07-quick-profile.spec"; -import sidebarChatsTests from "@specs/reusable-accounts/08-sidebar-chats.spec"; -import groupChatTests from "@specs/reusable-accounts/09-group-chats.spec"; -import groupChatEditTests from "@specs/reusable-accounts/10-group-chats-edit.spec"; -import groupChatSidebarTests from "@specs/reusable-accounts/11-group-chats-sidebar.spec"; -import groupChatMultipleUsersTests from "@specs/reusable-accounts/12-group-chats-multiple-users.spec"; - -describe("Create Accounts for Chats Tests", createChatAccountsTests.bind(this)); -describe("Friend Requests and Messages Tests", chatsFriendsRequests.bind(this)); -describe("Chat Replies Tests", repliesTests.bind(this)); -describe("Message Context Menu Tests", messageContextMenuTests.bind(this)); -describe("Message Input Tests", messageInputTests.bind(this)); -describe("Message Attachments Tests", messageAttachmentsTests.bind(this)); -describe("Chat Topbar Tests", chatTopbarTests.bind(this)); -describe("Quick Profile Tests", quickProfileTests.bind(this)); -describe("Sidebar Chats Tests", sidebarChatsTests.bind(this)); -describe("Group Chats Tests", groupChatTests.bind(this)); -describe("Group Chats Edit Tests", groupChatEditTests.bind(this)); -describe( - "Group Chats Favorites and Sidebar Tests", - groupChatSidebarTests.bind(this), -); -describe( - "Group Chats Multiple Users Tests", - groupChatMultipleUsersTests.bind(this), -);