使用排毒在Circleci 2.0上运行android e2e测试以进行本机响应

时间:2019-01-17 06:44:45

标签: android react-native e2e-testing detox circleci-2.0

我正在circleci(2.0)上排毒android e2e,并面临两个问题-

  1. circ ci(2)仍然不支持基于x86的模拟器,因此我使用的是基于ARM的ems
  2. 它真的很慢,甚至在模拟器启动/安装应用程序之前,排毒就会超时,因此firebase测试实验室应运而生

有没有办法在circleci 2上运行android x86模拟器?和 Detox是否支持在Firebase测试实验室上运行测试?周围有文件吗?

作为参考,这是我的circleci yaml文件

    reference:
      android_config: &android_config
        docker:
          - image: circleci/android:api-28-node8-alpha
      download_android_dependencies: &download_android_dependencies
        run:
          name: Download Android Dependencies
          command: |
            ls
            cd android
            ./gradlew androidDependencies
            cd ../
    jobs:
      test-android:
        <<: *android_config
      steps:
        - checkout
        - run: npm install
        - *download_android_dependencies
        - run: sdkmanager "system-images;android-25;google_apis;armeabi-v7a"
        - run: sdkmanager --licenses
        - run: echo "no" | avdmanager create avd -n testEmulator -k "system-images;android-25;google_apis;armeabi-v7a"
        - run:
              name: Run emulator in background
              command: |
                sudo apt-get install libpulse0
                export ANDROID_SDK_ROOT=${ANDROID_HOME}
                export LD_LIBRARY_PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib emulator64-arm -avd testEmulator -noaudio -no-boot-anim -no-window -accel on -verbose -gpu swiftshader
               background: true
         - run: sudo npm install -g detox-cli
         - run:
              name: start pkg server
              command: npm start
              background: true
          - run: detox build -c android.emu.debug
          - run: detox test -c android.emu.debug -l trace
workflows:
  version: 2
  build:
    jobs:
      - test-android

0 个答案:

没有答案