From 6909da8de19c5cd685e38f11912e9b97c2c38218 Mon Sep 17 00:00:00 2001 From: "github@zbay.llc" Date: Wed, 11 Oct 2023 16:34:59 +0200 Subject: [PATCH 1/3] fix: android detox tests --- packages/mobile/.detoxrc.js | 2 +- packages/mobile/e2e/starter.test.js | 2 +- packages/mobile/e2e/utils/press.js | 13 ++----------- packages/mobile/e2e/utils/write.js | 11 +---------- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/packages/mobile/.detoxrc.js b/packages/mobile/.detoxrc.js index b5832f5d0e..a03e86f3a9 100644 --- a/packages/mobile/.detoxrc.js +++ b/packages/mobile/.detoxrc.js @@ -77,7 +77,7 @@ module.exports = { emulator_ci: { type: 'android.emulator', device: { - avdName: 'Pixel_3a_API_34_arm64-v8a', + avdName: 'Pixel_7_API_31', }, }, }, diff --git a/packages/mobile/e2e/starter.test.js b/packages/mobile/e2e/starter.test.js index 1f63dd13b5..f2ce45c703 100644 --- a/packages/mobile/e2e/starter.test.js +++ b/packages/mobile/e2e/starter.test.js @@ -21,7 +21,7 @@ describe('User', () => { test('should see join community screen', async () => { await waitFor(element(by.text('Join community'))) .toBeVisible() - .withTimeout(LONG) + .withTimeout(STARTUP) const componentName = 'join-community-component' await checkVisualRegression(componentName) diff --git a/packages/mobile/e2e/utils/press.js b/packages/mobile/e2e/utils/press.js index dfd392a3f1..01189a95e6 100644 --- a/packages/mobile/e2e/utils/press.js +++ b/packages/mobile/e2e/utils/press.js @@ -1,14 +1,5 @@ -import info from './info' - -const { ios } = info - -const press = async (element, double = false) => { - if (ios) { - await element.tap() - } else { - if (double) await element.longPress() // Idle - await element.longPress() - } +const press = async (element) => { + await element.tap() } export default press diff --git a/packages/mobile/e2e/utils/write.js b/packages/mobile/e2e/utils/write.js index 0d6014f509..0c2af647d0 100644 --- a/packages/mobile/e2e/utils/write.js +++ b/packages/mobile/e2e/utils/write.js @@ -1,14 +1,5 @@ -import info from './info' - -const { ios } = info - const write = async (element, text) => { - if (ios) { - await element.typeText(text) - } else { - await element.longPress() - await element.typeText(text) - } + await element.typeText(text) } export default write From 9395e8b87289e7349320d16e5792ab6ce6d74b3f Mon Sep 17 00:00:00 2001 From: "github@zbay.llc" Date: Wed, 11 Oct 2023 16:48:26 +0200 Subject: [PATCH 2/3] chore: add workflow for android e2e --- .github/workflows/e2e-ios.yml | 2 +- .github/workflows/e2e.android.yml | 34 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/e2e.android.yml diff --git a/.github/workflows/e2e-ios.yml b/.github/workflows/e2e-ios.yml index 91c81888e1..ca0933e2d4 100644 --- a/.github/workflows/e2e-ios.yml +++ b/.github/workflows/e2e-ios.yml @@ -8,7 +8,7 @@ on: jobs: detox: timeout-minutes: 10 - runs-on: [self-hosted, macOS, ARM64] + runs-on: [self-hosted, macOS, ARM64, iOS] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/e2e.android.yml b/.github/workflows/e2e.android.yml new file mode 100644 index 0000000000..aae61f7017 --- /dev/null +++ b/.github/workflows/e2e.android.yml @@ -0,0 +1,34 @@ +name: E2E Android + +on: + pull_request: + paths: + - packages/mobile/** + +jobs: + detox: + timeout-minutes: 10 + runs-on: [self-hosted, macOS, ARM64, android] + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + npm i + npm run lerna bootstrap --scope @quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle + + - name: Pull binaries + run: | + git lfs install + git lfs pull + + - name: Build Detox + run: | + cd packages/mobile + detox build -c android.emu.debug.ci + + - name: Run basic tests + run: | + cd packages/mobile + detox test starter -c android.emu.debug.ci From ac8097278ade42b1e507ddb19e13664df5633fde Mon Sep 17 00:00:00 2001 From: "github@zbay.llc" Date: Thu, 12 Oct 2023 09:04:11 +0200 Subject: [PATCH 3/3] fix: set NDK path in local.properties --- .github/workflows/e2e.android.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/e2e.android.yml b/.github/workflows/e2e.android.yml index aae61f7017..055b6fa994 100644 --- a/.github/workflows/e2e.android.yml +++ b/.github/workflows/e2e.android.yml @@ -23,6 +23,12 @@ jobs: git lfs install git lfs pull + - name: Set NDK path in local.properties + run: | + printf "\ + ndk.path=${{ env.NDK_PATH }}\n\ + " > packages/mobile/android/local.properties + - name: Build Detox run: | cd packages/mobile