Skip to content

Commit

Permalink
feat: add flashlist (#57)
Browse files Browse the repository at this point in the history
* add flashlist

* e2e fix(1)

* e2e fix(2) bundle install fix

* e2e fix(2) bundle install fix

* e2e fix(3) install java version 17

* e2e fix(3) install java version 17

* remove test warnings

* increase to api-level 33 e2e test

* maestro cloud addition to e2e testing in ci/cd

* maestro cloud addition to e2e testing in ci/cd 2

* maestro cloud addition to e2e testing in ci/cd 3

* maestro cloud addition to e2e testing in ci/cd 4

* create .gradle folder and global properties

* correct working folder for android activities

* correct working folder for android activities

* correct working folder for android activities

* correct app-file

* correct app-file

* initial build_ios + correct app-file destin.

* initial build_ios + correct app-file destin.

* correct xcode version

* correct xcode version

* correct xcode version

* correct xcode version

* correct xcode version

* build android unified in one job

* correct apk name

* try to find apk location

* use absolute url

* e2e name .maestro dir
  • Loading branch information
vanGalilea authored Jan 16, 2024
1 parent 7208a11 commit 14705b5
Show file tree
Hide file tree
Showing 15 changed files with 178 additions and 255 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
root: true,
extends: '@react-native',
ignorePatterns: ['e2e/', 'coverage'],
ignorePatterns: ['.maestro/', 'coverage'],
};
89 changes: 0 additions & 89 deletions .github/actions/bootstrap/action.yml

This file was deleted.

99 changes: 31 additions & 68 deletions .github/workflows/e2e-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,82 +10,45 @@ concurrency:

jobs:
build_android:
name: Build Android
timeout-minutes: 60
name: Build & Test Android
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/bootstrap
timeout-minutes: 15
env:
INSTALL_NODE: true
INSTALL_JAVA: true

- name: Build
run: bundle exec fastlane build_android

- name: Upload .apk
uses: actions/upload-artifact@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
name: apk
path: '**/dist/*.apk'

test_android:
name: Test Android
needs: build_android
timeout-minutes: 100
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/bootstrap
timeout-minutes: 15
env:
INSTALL_NODE: true
INSTALL_FFMPEG: true
INSTALL_MAESTRO: true
INSTALL_ANDROID_EMULATOR: true
distribution: 'zulu'
java-version: '17'
check-latest: true

- name: Download .apk
uses: actions/download-artifact@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
name: apk
node-version: '18'

- name: Create AVD Snapshot
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
arch: x86_64
target: google_apis
profile: pixel_5
force-avd-creation: false
avd-name: test
ram-size: 8192M
disk-size: 2048M
emulator-boot-timeout: 1000
emulator-options: -no-window -no-boot-anim -no-audio -no-snapshot-load -gpu swiftshader_indirect
script: echo 'AVD snapshot is generated and will be cached for the future runs.'
- name: Run Yarn Install
run: yarn install

- name: Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
arch: x86_64
target: google_apis
profile: pixel_5
force-avd-creation: false
avd-name: test
ram-size: 8192M
disk-size: 2048M
emulator-boot-timeout: 1000
emulator-options: -no-window -no-boot-anim -no-audio -no-snapshot-load -gpu swiftshader_indirect
script: bundle exec fastlane test_android
- name: Build Release APK
run: cd android && ./gradlew assembleRelease

- uses: actions/upload-artifact@v3
if: failure()
- name: Upload to Maestro Cloud
uses: mobile-dev-inc/[email protected]
with:
name: Android Test Data
path: |
**/fastlane/recordings
~/.maestro/tests
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: /home/runner/work/react-native-testing/react-native-testing/android/app/build/outputs/apk/release/app-release.apk

build_ios:
name: Build IOS
timeout-minutes: 60
runs-on: macos-latest
steps:
- name: Archive iOS app
run: echo "To be implemented"
# - uses: actions/checkout@v2
# - uses: maxim-lobanov/[email protected]
# with:
# xcode-version: 14.2.0
# - run: cd ios && xcodebuild -project reactnativetesting.xcodeproj -scheme reactnativetesting -destination 'platform=iOS Simulator,name=iPhone 11'
12 changes: 6 additions & 6 deletions e2e/flow.yaml → .maestro/flow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ appId: com.reactnativetesting
- assertVisible: ${output.screens.counter.currentCountIs1}
- tapOn: ${output.screens.counter.decrementButton}
- assertVisible: ${output.screens.counter.currentCountIs0}
- runFlow: goBackHome.yaml
- runFlow: ./subFlows/goBackHome.yaml
# test Login screen flow
- tapOn: ${output.screens.home.loginButton}
- tapOn: ${output.screens.login.usernamePlaceholder}
Expand All @@ -27,22 +27,22 @@ appId: com.reactnativetesting
- tapOn: ${output.screens.easyButton.button}
- assertVisible: ${output.screens.easyButton.modalDescription}
- tapOn: ${output.screens.easyButton.modalDismissButton}
- runFlow: goBackHome.yaml
- runFlow: ./subFlows/goBackHome.yaml
# test Video screen flow
- tapOn: ${output.screens.home.videoButton}
- assertVisible: ${output.screens.video.playerA11yId}
- tapOn: ${output.screens.video.fullScreenButton}
- tapOn: ${output.screens.video.pauseStartButton}
- tapOn: ${output.screens.video.exitFullScreen}
- tapOn: ${output.screens.video.pauseStartButton}
- runFlow: goBackHome.yaml
- runFlow: ./subFlows/goBackHome.yaml
# test Modal screen flow
- tapOn: ${output.screens.home.modalButton}
- tapOn: ${output.screens.modal.showButton}
- assertVisible: ${output.screens.modal.description}
- tapOn: ${output.screens.modal.hideButton}
- assertVisible: ${output.screens.modal.showButton}
- runFlow: goBackHome.yaml
- runFlow: ./subFlows/goBackHome.yaml
# flat list screen flow
- tapOn: ${output.screens.home.flatListButton}
- assertVisible: ${output.screens.flatList.firstItemPage1}
Expand All @@ -52,12 +52,12 @@ appId: com.reactnativetesting
- scrollUntilVisible:
element: ${output.screens.flatList.fifthItemPage2}
direction: "DOWN"
- runFlow: goBackHome.yaml
- runFlow: ./subFlows/goBackHome.yaml
# ListWithFetch screen flow
- tapOn: ${output.screens.home.listWithFetchButton}
- assertVisible: ${output.screens.listWitchFetch.firstItemId}
- scrollUntilVisible:
element: ${output.screens.listWitchFetch.fifteenthItemId}
direction: "DOWN"
- runFlow: goBackHome.yaml
- runFlow: ./subFlows/goBackHome.yaml
- assertVisible: ${output.screens.home.title}
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ ruby ">= 2.6.10"
gem 'cocoapods', '~> 1.13'
gem 'fastlane'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
Loading

0 comments on commit 14705b5

Please sign in to comment.