Skip to content

Commit

Permalink
Fix/android detox tests (#1958)
Browse files Browse the repository at this point in the history
* fix: android detox tests

* chore: add workflow for android e2e

* fix: set NDK path in local.properties

---------

Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
siepra and githubquiet authored Oct 12, 2023
1 parent 6e7859b commit 2e0fe01
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/e2e.android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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: 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
detox build -c android.emu.debug.ci
- name: Run basic tests
run: |
cd packages/mobile
detox test starter -c android.emu.debug.ci
2 changes: 1 addition & 1 deletion packages/mobile/.detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module.exports = {
emulator_ci: {
type: 'android.emulator',
device: {
avdName: 'Pixel_3a_API_34_arm64-v8a',
avdName: 'Pixel_7_API_31',
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/e2e/starter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 2 additions & 11 deletions packages/mobile/e2e/utils/press.js
Original file line number Diff line number Diff line change
@@ -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
11 changes: 1 addition & 10 deletions packages/mobile/e2e/utils/write.js
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2e0fe01

Please sign in to comment.