diff --git a/packages/e2e-tests/src/tests/backwardsCompatibility.test.ts b/packages/e2e-tests/src/tests/backwardsCompatibility.test.ts index b0bf1ea85d..a37641213c 100644 --- a/packages/e2e-tests/src/tests/backwardsCompatibility.test.ts +++ b/packages/e2e-tests/src/tests/backwardsCompatibility.test.ts @@ -9,7 +9,7 @@ import { Sidebar, } from '../selectors' import { MessageIds } from '../types' -import { BACKWARD_COMPATIBILITY_BASE_VERSION, BuildSetup, copyInstallerFile, downloadInstaller } from '../utils' +import { BACKWARD_COMPATIBILITY_BASE_VERSION, BuildSetup, copyInstallerFile, downloadInstaller, sleep } from '../utils' import { createLogger } from '../logger' const logger = createLogger('backwardsCompatibility') @@ -45,16 +45,18 @@ describe('Backwards Compatibility', () => { }) beforeEach(async () => { - await new Promise(resolve => setTimeout(() => resolve(), 1000)) + logger.info(`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ${expect.getState().currentTestName}`) + await sleep(1_000) }) afterAll(async () => { - await new Promise(resolve => setTimeout(() => resolve(), 5000)) + await sleep(5_000) await ownerAppNewVersion?.close() await ownerAppNewVersion?.cleanup() await ownerAppOldVersion?.close() await ownerAppOldVersion?.cleanup() }) + describe('User opens app for the first time', () => { itif(process.platform == 'linux')('Owner opens the app', async () => { await ownerAppOldVersion.open() @@ -159,7 +161,7 @@ describe('Backwards Compatibility', () => { ) itif(process.platform == 'linux')('User closes the old app', async () => { await ownerAppOldVersion.close() - await new Promise(resolve => setTimeout(() => resolve(), 5000)) + await sleep(5_000) }) // ________________________________ @@ -189,7 +191,7 @@ describe('Backwards Compatibility', () => { itif(process.platform == 'linux')('Confirm that the opened app is the latest version', async () => { logger.info('New version', 4) - await new Promise(resolve => setTimeout(() => resolve(), 10000)) + await sleep(10_000) const settingsModal = await new Sidebar(ownerAppNewVersion.driver).openSettings() const isSettingsModal = await settingsModal.element.isDisplayed() expect(isSettingsModal).toBeTruthy() @@ -201,10 +203,10 @@ describe('Backwards Compatibility', () => { itif(process.platform == 'linux')('Check number of messages on second channel', async () => { logger.info('New version', 5) - await new Promise(resolve => setTimeout(() => resolve(), 2000)) + await sleep(2_000) sidebar = new Sidebar(ownerAppNewVersion.driver) await sidebar.switchChannel(newChannelName) - await new Promise(resolve => setTimeout(() => resolve(), 5000)) + await sleep(5_000) secondChannel = new Channel(ownerAppNewVersion.driver, newChannelName) const currentMessages = await secondChannel.getUserMessages(ownerUsername) expect(currentMessages.length).toEqual(messagesToCompare.length) diff --git a/packages/e2e-tests/src/tests/invitationLink.test.ts b/packages/e2e-tests/src/tests/invitationLink.test.ts index fb348270f3..63ca2d58f3 100644 --- a/packages/e2e-tests/src/tests/invitationLink.test.ts +++ b/packages/e2e-tests/src/tests/invitationLink.test.ts @@ -36,6 +36,7 @@ describe('New user joins using invitation link while having app opened', () => { }) beforeEach(async () => { + logger.info(`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ${expect.getState().currentTestName}`) await sleep(1000) }) diff --git a/packages/e2e-tests/src/tests/joiningWithQSS.test.ts b/packages/e2e-tests/src/tests/joiningWithQSS.test.ts index ec9fcd5a96..5984ce6069 100644 --- a/packages/e2e-tests/src/tests/joiningWithQSS.test.ts +++ b/packages/e2e-tests/src/tests/joiningWithQSS.test.ts @@ -9,7 +9,7 @@ import { createLogger } from '../logger' const logger = createLogger('joiningWithQSS') -jest.setTimeout(1200000) // 20 minutes +jest.setTimeout(1_200_000) // 20 minutes // Run QSS locally before this test const serverAddress = 'http://127.0.0.1:3000' @@ -41,6 +41,11 @@ describe('User joining with storage server', () => { await users.user1.app.close() }) + beforeEach(async () => { + logger.info(`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ${expect.getState().currentTestName}`) + await sleep(1_000) + }) + describe('Owner creates the community', () => { it('Owner opens the app', async () => { await users.owner.app.open() diff --git a/packages/e2e-tests/src/tests/multipleClients.test.ts b/packages/e2e-tests/src/tests/multipleClients.test.ts index 1062106933..af014f0d71 100644 --- a/packages/e2e-tests/src/tests/multipleClients.test.ts +++ b/packages/e2e-tests/src/tests/multipleClients.test.ts @@ -1,3 +1,5 @@ +import { jest } from '@jest/globals' + import { App, Channel, @@ -40,14 +42,6 @@ describe('Multiple Clients', () => { const generalChannelName = 'general' const thirdChannelName = 'delete-this' - const sleep = async (time = 1000) => { - await new Promise(resolve => - setTimeout(() => { - resolve() - }, time) - ) - } - beforeAll(async () => { const commonApp = new App() users = { @@ -82,6 +76,7 @@ describe('Multiple Clients', () => { }) beforeEach(async () => { + logger.info(`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ${expect.getState().currentTestName}`) await sleep(1000) }) diff --git a/packages/e2e-tests/src/tests/oneClient.test.ts b/packages/e2e-tests/src/tests/oneClient.test.ts index bbf5e08009..c02c20e6ae 100644 --- a/packages/e2e-tests/src/tests/oneClient.test.ts +++ b/packages/e2e-tests/src/tests/oneClient.test.ts @@ -10,6 +10,7 @@ import getPort from 'get-port' import { fork } from 'child_process' import path from 'path' import { createLogger } from '../logger' +import { sleep } from '../utils' const logger = createLogger('oneClient') @@ -32,6 +33,12 @@ describe('One Client', () => { await app.close() await app.cleanup() }) + + beforeEach(async () => { + logger.info(`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ${expect.getState().currentTestName}`) + await sleep(200) + }) + describe('User opens app for the first time', () => { it('Get opened app process data', () => { const processData = app.buildSetup.getProcessData() diff --git a/packages/e2e-tests/src/tests/userProfile.test.ts b/packages/e2e-tests/src/tests/userProfile.test.ts index d8696cf379..f240e715b0 100644 --- a/packages/e2e-tests/src/tests/userProfile.test.ts +++ b/packages/e2e-tests/src/tests/userProfile.test.ts @@ -50,7 +50,8 @@ describe('User Profile Feature', () => { }) beforeEach(async () => { - await sleep(1000) + logger.info(`░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ${expect.getState().currentTestName}`) + await sleep(1_000) }) it('Owner opens the app', async () => {