diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 3d6aacfa32..d9b4719b32 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -2,6 +2,7 @@ name: Backend unit tests on: pull_request: + workflow_dispatch: jobs: unit-tests: @@ -19,26 +20,21 @@ jobs: backend: - 'packages/backend/**' - name: "Skip tests" - if: steps.filter.outputs.backend == 'false' run: | - echo "Skipping test run" - exit 0 + echo "Skipping test run" + - name: "Print OS" - if: steps.filter.outputs.backend == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - if: steps.filter.outputs.backend == 'true' - name: "Setup environment" - if: steps.filter.outputs.backend == 'true' uses: ./.github/actions/setup-env with: bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,backend-bundle" - name: "Unit tests" - if: steps.filter.outputs.backend == 'true' run: lerna run test-ci --scope @quiet/backend --stream long-running-tests: @@ -56,26 +52,21 @@ jobs: backend: - 'packages/backend/**' - name: "Skip tests" - if: steps.filter.outputs.backend == 'false' run: | - echo "Skipping test run" - exit 0 + echo "Skipping test run" + - name: "Print OS" - if: steps.filter.outputs.backend == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - if: steps.filter.outputs.backend == 'true' - name: "Setup environment" - if: steps.filter.outputs.backend == 'true' uses: ./.github/actions/setup-env with: bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,backend-bundle" - name: "Unit tests" - if: steps.filter.outputs.backend == 'true' run: lerna run test-ci-long-running --scope @quiet/backend --stream unit-tests-with-tor: @@ -93,24 +84,19 @@ jobs: backend: - 'packages/backend/**' - name: "Skip tests" - if: steps.filter.outputs.backend == 'false' run: | - echo "Skipping test run" - exit 0 + echo "Skipping test run" + - name: "Print OS" - if: steps.filter.outputs.backend == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - if: steps.filter.outputs.backend == 'true' - name: "Setup environment" - if: steps.filter.outputs.backend == 'true' uses: ./.github/actions/setup-env with: bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,backend-bundle" - name: "Unit tests" - if: steps.filter.outputs.backend == 'true' run: lerna run test-ci-tor --scope @quiet/backend --stream diff --git a/.github/workflows/check-desktop-visual-regression.yml b/.github/workflows/check-desktop-visual-regression.yml index 7ecc4123e0..0137b07a05 100644 --- a/.github/workflows/check-desktop-visual-regression.yml +++ b/.github/workflows/check-desktop-visual-regression.yml @@ -2,6 +2,7 @@ name: Desktop visual regressions on: pull_request: + workflow_dispatch: jobs: chromatic-deployment: @@ -19,29 +20,24 @@ jobs: desktop: - 'packages/desktop/**' - name: "Skip tests" - if: steps.filter.outputs.desktop == 'false' run: | - echo "Skipping test run" - exit 0 + echo "Skipping test run" + # - name: "Print OS" - if: steps.filter.outputs.desktop == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - if: steps.filter.outputs.desktop == 'true' with: fetch-depth: 0 # Required to retrieve git history - name: Setup environment uses: ./.github/actions/setup-env - if: steps.filter.outputs.desktop == 'true' with: bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle" - name: "Publish to Chromatic" uses: chromaui/action@355e2a05a179e9e89c2b237dcd55adbeb89e577e # v1 - if: steps.filter.outputs.desktop == 'true' with: workingDir: ./packages/desktop token: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index db87a13727..9f5fead72c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,6 +2,7 @@ name: Check on: pull_request: + workflow_dispatch: jobs: check: diff --git a/.github/workflows/desktop-rtl-tests.yml b/.github/workflows/desktop-rtl-tests.yml index 02232b9c95..4d1a20e398 100644 --- a/.github/workflows/desktop-rtl-tests.yml +++ b/.github/workflows/desktop-rtl-tests.yml @@ -2,6 +2,7 @@ name: Desktop - state-manager bracket tests (RTL) on: pull_request: + workflow_dispatch: jobs: desktop-tests: @@ -21,25 +22,20 @@ jobs: - 'packages/desktop/**' - 'packages/state-manger/**' - name: "Skip tests" - if: steps.filter.outputs.validFiles == 'false' run: | - echo "Skipping test run" - exit 0 + echo "Skipping test run" + - name: "Print OS" - if: steps.filter.outputs.validFiles == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@v3 - if: steps.filter.outputs.validFiles == 'true' - name: "Setup environment" uses: ./.github/actions/setup-env - if: steps.filter.outputs.validFiles == 'true' with: cachePrefix: "desktop-tests" bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle" - name: "Desktop - state-manager bracket tests" - if: steps.filter.outputs.validFiles == 'true' run: lerna run rtl-test --scope @quiet/desktop --stream diff --git a/.github/workflows/desktop-test-scroll.yml b/.github/workflows/desktop-test-scroll.yml index 9f1c0b9ee0..795942d368 100644 --- a/.github/workflows/desktop-test-scroll.yml +++ b/.github/workflows/desktop-test-scroll.yml @@ -2,6 +2,7 @@ name: Desktop scroll regression tests on: pull_request: + workflow_dispatch: jobs: regression-tests: @@ -20,41 +21,33 @@ jobs: desktop: - 'packages/desktop/**' - name: "Skip tests" - if: steps.filter.outputs.desktop == 'false' run: | - echo "Skipping test run" - exit 0 + echo "!Skipping test run" + - name: "Print OS" - if: steps.filter.outputs.desktop == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - if: steps.filter.outputs.desktop == 'true' - name: Setup environment uses: ./.github/actions/setup-env - if: steps.filter.outputs.desktop == 'true' with: bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle" - name: "Install libs" - if: steps.filter.outputs.desktop == 'true' run: sudo apt-get update && sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb - name: "Remove test files workaround" - if: steps.filter.outputs.desktop == 'true' run: find packages/desktop/src -name '*.test.*' -delete && find packages/backend/src -name '*.test.*' -delete - uses: cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a # v6.6.1 - if: steps.filter.outputs.desktop == 'true' with: install: false command: npm run regression-test:ci working-directory: packages/desktop - name: Archive test screenshots - if: steps.filter.outputs.desktop == 'true' uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: test-screenshots-linux diff --git a/.github/workflows/desktop-tests.yml b/.github/workflows/desktop-tests.yml index 9acb5f1ec8..ca6e8d437f 100644 --- a/.github/workflows/desktop-tests.yml +++ b/.github/workflows/desktop-tests.yml @@ -2,6 +2,7 @@ name: Desktop tests on: pull_request: + workflow_dispatch: jobs: desktop-tests: @@ -20,25 +21,20 @@ jobs: desktop: - 'packages/desktop/**' - name: "Skip tests" - if: steps.filter.outputs.desktop == 'false' run: | - echo "Skipping test run" - exit 0 + echo "Skipping test run" + - name: "Print OS" - if: steps.filter.outputs.desktop == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - if: steps.filter.outputs.desktop == 'true' - name: "Setup environment" uses: ./.github/actions/setup-env - if: steps.filter.outputs.desktop == 'true' with: cachePrefix: "desktop-tests" bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle" - name: "Unit tests" - if: steps.filter.outputs.desktop == 'true' run: lerna run test --scope @quiet/desktop --stream diff --git a/.github/workflows/e2e-ios-self.yml b/.github/workflows/e2e-ios-self.yml index 7b47db414b..a840c184d0 100644 --- a/.github/workflows/e2e-ios-self.yml +++ b/.github/workflows/e2e-ios-self.yml @@ -1,12 +1,12 @@ name: Detox E2E iOS (self-hosted) on: - # push: - # paths: - # - packages/mobile/** - # - packages/backend/** - # - packages/state-manager/** - # - .github/workflows/e2e-ios-self.yml + push: + paths: + - packages/mobile/** + - packages/backend/** + - packages/state-manager/** + - .github/workflows/e2e-ios-self.yml jobs: detox-ios-self-hosted: @@ -47,5 +47,5 @@ jobs: detox test starter -c ios.sim.debug.ci - name: Stop metro - if: always() + if: always() run: pm2 stop METRO diff --git a/.github/workflows/e2e-linux.yml b/.github/workflows/e2e-linux.yml index ccdc268300..79cf0f93bd 100644 --- a/.github/workflows/e2e-linux.yml +++ b/.github/workflows/e2e-linux.yml @@ -51,21 +51,21 @@ jobs: uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 with: timeout_minutes: 15 - max_attempts: 3 + max_attempts: 1 command: cd packages/e2e-tests && npm run test oneClient.test.ts - name: Run multiple clients test uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 with: timeout_minutes: 25 - max_attempts: 3 + max_attempts: 1 command: cd packages/e2e-tests && npm run test multipleClients.test.ts - name: Run user profile test uses: nick-fields/retry@v2 with: timeout_minutes: 25 - max_attempts: 3 + max_attempts: 1 command: cd packages/e2e-tests && npm run test userProfile.test.ts - name: Run invitation link test - Includes 2 separate application clients @@ -78,6 +78,6 @@ jobs: - name: Run Backwards Compatibility test uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 with: - timeout_minutes: 15 - max_attempts: 3 + timeout_minutes: 30 + max_attempts: 1 command: cd packages/e2e-tests && npm run test backwardsCompatibility.test.ts diff --git a/.github/workflows/e2e-mac.yml b/.github/workflows/e2e-mac.yml index ff9002b06b..6abeaed191 100644 --- a/.github/workflows/e2e-mac.yml +++ b/.github/workflows/e2e-mac.yml @@ -55,27 +55,27 @@ jobs: - name: Run invitation link test - Includes 2 separate application clients uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 with: - timeout_minutes: 25 - max_attempts: 3 + timeout_minutes: 180 + max_attempts: 1 command: cd packages/e2e-tests && npm run test invitationLink.test.ts - name: Run one client test uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 with: - timeout_minutes: 15 - max_attempts: 3 + timeout_minutes: 180 + max_attempts: 1 command: cd packages/e2e-tests && npm run test oneClient.test.ts - name: Run multiple clients test uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 with: - timeout_minutes: 25 - max_attempts: 3 + timeout_minutes: 180 + max_attempts: 1 command: cd packages/e2e-tests && npm run test multipleClients.test.ts - name: Run user profile test uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 with: timeout_minutes: 25 - max_attempts: 3 + max_attempts: 1 command: cd packages/e2e-tests && npm run test userProfile.test.ts diff --git a/.github/workflows/e2e-win.yml b/.github/workflows/e2e-win.yml index 541f73edb7..01c4fd8ba8 100644 --- a/.github/workflows/e2e-win.yml +++ b/.github/workflows/e2e-win.yml @@ -89,31 +89,31 @@ jobs: uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 with: timeout_minutes: 15 - max_attempts: 3 + max_attempts: 1 shell: bash command: cd packages/e2e-tests && npm run test oneClient.test.ts - + - name: Run user profile test uses: nick-fields/retry@v2 with: timeout_minutes: 25 - max_attempts: 3 + max_attempts: 1 shell: bash command: cd packages/e2e-tests && npm run test userProfile.test.ts - + - name: Run invitation link test - Includes 2 separate application clients uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 with: timeout_minutes: 10 - max_attempts: 3 + max_attempts: 1 shell: bash command: cd packages/e2e-tests && npm run test invitationLink.test.ts - + - name: Run multiple clients test uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 with: timeout_minutes: 30 - max_attempts: 3 + max_attempts: 1 shell: bash - command: cd packages/e2e-tests && npm run test multipleClients.test.ts \ No newline at end of file + command: cd packages/e2e-tests && npm run test multipleClients.test.ts diff --git a/.github/workflows/identity-tests.yml b/.github/workflows/identity-tests.yml index e2562a47a3..0cd03702c6 100644 --- a/.github/workflows/identity-tests.yml +++ b/.github/workflows/identity-tests.yml @@ -2,6 +2,7 @@ name: Identity tests on: pull_request: + workflow_dispatch: jobs: identity-tests: @@ -20,24 +21,19 @@ jobs: identity: - 'packages/identity/**' - name: "Skip tests" - if: steps.filter.outputs.identity == 'false' run: | - echo "Skipping test run" - exit 0 + echo "Skipping test run" + - name: "Print OS" - if: steps.filter.outputs.identity == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - if: steps.filter.outputs.identity == 'true' - name: "Setup environment" uses: ./.github/actions/setup-env - if: steps.filter.outputs.identity == 'true' with: bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/types,@quiet/identity,backend-bundle" - name: "Unit tests" - if: steps.filter.outputs.identity == 'true' run: lerna run test --scope @quiet/identity --stream diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 6d01483059..31f22d6594 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -2,6 +2,7 @@ name: Integration tests on: pull_request: + workflow_dispatch: paths: - packages/state-manager/** - packages/backend/** diff --git a/.github/workflows/mobile-tests.yml b/.github/workflows/mobile-tests.yml index 8e70c92bfd..da004165e2 100644 --- a/.github/workflows/mobile-tests.yml +++ b/.github/workflows/mobile-tests.yml @@ -2,6 +2,7 @@ name: Mobile tests on: pull_request: + workflow_dispatch: paths: - packages/mobile/** diff --git a/.github/workflows/state-manager-tests.yml b/.github/workflows/state-manager-tests.yml index 51f204c276..e1c59b35be 100644 --- a/.github/workflows/state-manager-tests.yml +++ b/.github/workflows/state-manager-tests.yml @@ -2,6 +2,7 @@ name: State-manager tests on: pull_request: + workflow_dispatch: jobs: state-manager-tests: @@ -20,24 +21,19 @@ jobs: stateManager: - 'packages/state-manager/**' - name: "Skip tests" - if: steps.filter.outputs.stateManager == 'false' run: | - echo "Skipping test run" - exit 0 + echo "Skipping test run" + - name: "Print OS" - if: steps.filter.outputs.stateManager == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - if: steps.filter.outputs.stateManager == 'true' - name: "Setup environment" uses: ./.github/actions/setup-env - if: steps.filter.outputs.stateManager == 'true' with: bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle" - name: "Unit tests" - if: steps.filter.outputs.stateManager == 'true' run: lerna run test --scope @quiet/state-manager --stream diff --git a/.github/workflows/utils-tests.yml b/.github/workflows/utils-tests.yml index b002c21ee3..e939532537 100644 --- a/.github/workflows/utils-tests.yml +++ b/.github/workflows/utils-tests.yml @@ -2,6 +2,7 @@ name: Common package tests on: pull_request: + workflow_dispatch: paths: - packages/common/** diff --git a/packages/backend/src/nest/websocketOverTor/index.ts b/packages/backend/src/nest/websocketOverTor/index.ts index 00ea1bd075..5219ff8517 100644 --- a/packages/backend/src/nest/websocketOverTor/index.ts +++ b/packages/backend/src/nest/websocketOverTor/index.ts @@ -67,7 +67,7 @@ export class WebSockets extends EventEmitter { this.createServer = createServer } - readonly [Symbol.toStringTag] = '@libp2p/websockets'; + readonly [Symbol.toStringTag] = '@libp2p/websockets' readonly [symbol] = true diff --git a/packages/desktop/src/renderer/theme.ts b/packages/desktop/src/renderer/theme.ts index 9f5d3fbd85..78118cf555 100644 --- a/packages/desktop/src/renderer/theme.ts +++ b/packages/desktop/src/renderer/theme.ts @@ -449,7 +449,7 @@ const darkTheme = createTheme({ }, }) -const defaultTheme = darkTheme +const defaultTheme = lightTheme const getCurrentTheme = (useDarkTheme: boolean | undefined): Theme => { if (useDarkTheme == null) { return defaultTheme diff --git a/packages/e2e-tests/src/tests/invitationLink.test.ts b/packages/e2e-tests/src/tests/invitationLink.test.ts index 16508607e9..3476909037 100644 --- a/packages/e2e-tests/src/tests/invitationLink.test.ts +++ b/packages/e2e-tests/src/tests/invitationLink.test.ts @@ -28,10 +28,14 @@ describe('New user joins using invitation link while having app opened', () => { let guestApp: App beforeAll(async () => { - ownerApp = new App() - guestApp = new App({ defaultDataDir: true }) + ownerApp = new App({ dataDir: 'owner' }) + guestApp = new App({ dataDir: 'guest' }) + // Cleanup before starting if (process.platform === 'win32') { await guestApp.cleanup(true) + } else { + await ownerApp.cleanup(true) + await guestApp.cleanup(true) } }) @@ -161,9 +165,10 @@ describe('New user joins using invitation link while having app opened', () => { it('Guest is redirected to UsernameModal', async () => { logger.info('Invitation Link', 15) - logger.info('Guest sees username modal') const registerModal = new RegisterUsernameModal(guestApp.driver) + logger.info('Waiting for username modal to be displayed') const isRegisterModalDisplayed = await registerModal.element.isDisplayed() + logger.info('Guest sees username modal') expect(isRegisterModalDisplayed).toBeTruthy() }) diff --git a/packages/e2e-tests/src/tests/multipleClients.test.ts b/packages/e2e-tests/src/tests/multipleClients.test.ts index 193b5556ee..cc5c044151 100644 --- a/packages/e2e-tests/src/tests/multipleClients.test.ts +++ b/packages/e2e-tests/src/tests/multipleClients.test.ts @@ -12,6 +12,28 @@ import { createLogger } from '../logger' import { UserTestData } from '../types' const logger = createLogger('multipleClients') +function waitForElementToBeDisplayed(element: any, timeout = 5000) { + return new Promise((resolve, reject) => { + const timer = setTimeout(() => { + reject(new Error('Timeout: Element not displayed within 5000ms')) + }, timeout) + element + .isDisplayed() + .then((isDisplayed: any) => { + clearTimeout(timer) + if (isDisplayed) { + resolve(true) + } else { + reject(new Error('Element is not displayed')) + } + }) + .catch((err: any) => { + clearTimeout(timer) + reject(err) + }) + }) +} + jest.setTimeout(1200000) // 20 minutes describe('Multiple Clients', () => { let generalChannelOwner: Channel @@ -83,16 +105,19 @@ describe('Multiple Clients', () => { describe('Stages:', () => { it('Owner opens the app', async () => { + logger.info('Multiple Clients', 1) await users.owner.app.open() }) it('Owner sees "join community" modal and switches to "create community" modal', async () => { + logger.info('Multiple Clients', 2) const joinModal = new JoinCommunityModal(users.owner.app.driver) const isJoinModal = await joinModal.element.isDisplayed() expect(isJoinModal).toBeTruthy() await joinModal.switchToCreateCommunity() }) it('Owner submits valid community name', async () => { + logger.info('Multiple Clients', 3) const createModal = new CreateCommunityModal(users.owner.app.driver) const isCreateModal = await createModal.element.isDisplayed() expect(isCreateModal).toBeTruthy() @@ -100,6 +125,7 @@ describe('Multiple Clients', () => { await createModal.submit() }) it('Owner sees "register username" modal and submits valid username', async () => { + logger.info('Multiple Clients', 4) const registerModal = new RegisterUsernameModal(users.owner.app.driver) const isRegisterModal = await registerModal.element.isDisplayed() expect(isRegisterModal).toBeTruthy() @@ -107,6 +133,7 @@ describe('Multiple Clients', () => { await registerModal.submit() }) it('Owner registers successfully and sees general channel', async () => { + logger.info('Multiple Clients', 5) generalChannelOwner = new Channel(users.owner.app.driver, 'general') const isGeneralChannel = await generalChannelOwner.element.isDisplayed() const generalChannelText = await generalChannelOwner.element.getText() @@ -114,16 +141,19 @@ describe('Multiple Clients', () => { expect(generalChannelText).toEqual('# general') }) it('Owner sends a message', async () => { + logger.info('Multiple Clients', 6) const isMessageInput = await generalChannelOwner.messageInput.isDisplayed() expect(isMessageInput).toBeTruthy() await generalChannelOwner.sendMessage(users.owner.messages[0]) }) it("Owner's message is visible on channel", async () => { + logger.info('Multiple Clients', 7) const messages = await generalChannelOwner.getUserMessages(users.owner.username) const text = await messages[1].getText() expect(text).toEqual(users.owner.messages[0]) }) it('Owner opens the settings tab and gets an invitation code', async () => { + logger.info('Multiple Clients', 8) const settingsModal = await new Sidebar(users.owner.app.driver).openSettings() const isSettingsModal = await settingsModal.element.isDisplayed() expect(isSettingsModal).toBeTruthy() @@ -140,11 +170,13 @@ describe('Multiple Clients', () => { }) it('First user opens the app', async () => { + logger.info('Multiple Clients', 9) logger.info('Second client') await users.user1.app.open() }) it('First user submits invitation code received from owner', async () => { + logger.info('Multiple Clients', 10) logger.info('new user - 3') const joinCommunityModal = new JoinCommunityModal(users.user1.app.driver) const isJoinCommunityModal = await joinCommunityModal.element.isDisplayed() @@ -155,6 +187,7 @@ describe('Multiple Clients', () => { }) it('First user submits valid username', async () => { + logger.info('Multiple Clients', 11) logger.info('new user - 5') const registerModal = new RegisterUsernameModal(users.user1.app.driver) const isRegisterModal = await registerModal.element.isDisplayed() @@ -166,6 +199,7 @@ describe('Multiple Clients', () => { }) it('First user joins successfully sees general channel and sends a message', async () => { + logger.info('Multiple Clients', 12) logger.info('new user - 7') generalChannelUser1 = new Channel(users.user1.app.driver, 'general') await generalChannelUser1.element.isDisplayed() @@ -181,6 +215,7 @@ describe('Multiple Clients', () => { await generalChannelUser1.sendMessage(users.user1.messages[0]) }) it("First user's sent message is visible in a channel", async () => { + logger.info('Multiple Clients', 13) const messages2 = await generalChannelUser1.getUserMessages(users.user1.username) const messages1 = await generalChannelUser1.getUserMessages(users.owner.username) logger.info({ messages1, messages2 }) @@ -188,6 +223,7 @@ describe('Multiple Clients', () => { expect(text2).toEqual(users.user1.messages[0]) }) it('First user opens the settings tab and copies updated invitation code', async () => { + logger.info('Multiple Clients', 14) const settingsModal = await new Sidebar(users.user1.app.driver).openSettings() const isSettingsModal = await settingsModal.element.isDisplayed() expect(isSettingsModal).toBeTruthy() @@ -202,10 +238,12 @@ describe('Multiple Clients', () => { }) it('Owner goes offline', async () => { + logger.info('Multiple Clients', 15) await users.owner.app.close() }) it('Second user opens the app', async () => { + logger.info('Multiple Clients', 16) logger.info('Third client') await users.user3.app.open() const debugModal = new DebugModeModal(users.user3.app.driver) @@ -213,6 +251,7 @@ describe('Multiple Clients', () => { }) it('Second user starts to join when owner is offline', async () => { + logger.info('Multiple Clients', 17) const joinCommunityModal = new JoinCommunityModal(users.user3.app.driver) const isJoinCommunityModal = await joinCommunityModal.element.isDisplayed() expect(isJoinCommunityModal).toBeTruthy() @@ -222,6 +261,7 @@ describe('Multiple Clients', () => { }) it('Second user submits non-valid, duplicated username', async () => { + logger.info('Multiple Clients', 18) logger.info('duplicated user - 1') const registerModal = new RegisterUsernameModal(users.user3.app.driver) const isRegisterModal = await registerModal.element.isDisplayed() @@ -233,6 +273,7 @@ describe('Multiple Clients', () => { }) it('Second user submits valid username', async () => { + logger.info('Multiple Clients', 19) logger.info('duplicated user - 2') const registerModal = new RegisterUsernameModal(users.user3.app.driver) const isRegisterModal = await registerModal.elementUsernameTaken.isDisplayed() @@ -244,15 +285,18 @@ describe('Multiple Clients', () => { }) it('Second user sees general channel', async () => { + logger.info('Multiple Clients', 20) logger.info('new user - 7') generalChannelUser3 = new Channel(users.user3.app.driver, 'general') - await generalChannelUser3.element.isDisplayed() - const isMessageInput = await generalChannelUser3.messageInput.isDisplayed() - expect(isMessageInput).toBeTruthy() + await waitForElementToBeDisplayed(generalChannelUser3.element, 2000) + // await generalChannelUser3.element.isDisplayed() + // const isMessageInput = await generalChannelUser3.messageInput.isDisplayed() + // expect(isMessageInput).toBeTruthy() logger.timeEnd(`[${users.user3.app.name}] '${users.user3.username}' joining community time`) }) it('Second user can send a message, they see their message tagged as "unregistered"', async () => { + logger.info('Multiple Clients', 21) logger.info('Second guest FETCHING CHANNEL MESSAGES!') await new Promise(resolve => setTimeout(() => { @@ -265,6 +309,7 @@ describe('Multiple Clients', () => { }) it('First user sees that unregistered user\'s messages are marked as "unregistered"', async () => { + logger.info('Multiple Clients', 22) await generalChannelUser1.waitForLabel(users.user3.username, 'Unregistered') })