gitlab - 使用 appium 为移动自动化设置 gitlab cicd?

标签 gitlab appium gitlab-ci appium-ios appium-android

有没有人使用 appium 工具为移动自动化设置 Gitlab CICD?

我想知道如何在 gitlab 中设置用于自动化的模拟器/设备,以及如何在 gitlab 中设置 appium 服务器。

非常感谢您的意见:)

最佳答案

我找到了关于 gitlab-ci 和 android 项目的相关链接:https://about.gitlab.com/2018/10/24/setting-up-gitlab-ci-for-android-projects/

然而,在这个示例链接中似乎没有使用 appium,但我相信如果你稍微调整一下它仍然很有用。

基本上,这是您需要使用的 yml 文件:

image: openjdk:8-jdk

variables:
  ANDROID_COMPILE_SDK: "28"
  ANDROID_BUILD_TOOLS: "28.0.2"
  ANDROID_SDK_TOOLS:   "4333796"

before_script:
  - apt-get --quiet update --yes
  - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
  - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip
  - unzip -d android-sdk-linux android-sdk.zip
  - echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null
  - echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null
  - echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null
  - export ANDROID_HOME=$PWD/android-sdk-linux
  - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
  - chmod +x ./gradlew
  # temporarily disable checking for EPIPE error and use yes to accept all licenses
  - set +o pipefail
  - yes | android-sdk-linux/tools/bin/sdkmanager --licenses
  - set -o pipefail

stages:
  - build
  - test

lintDebug:
  stage: build
  script:
    - ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint

assembleDebug:
  stage: build
  script:
    - ./gradlew assembleDebug
  artifacts:
    paths:
    - app/build/outputs/

debugTests:
  stage: test
  script:
    - ./gradlew -Pci --console=plain :app:testDebug


我还发现了这个相关的 StackOverflow 答案,我发现它非常有用:how to set up a Appium UI test maven project to work with Gitlab CI to test Android App?

关于gitlab - 使用 appium 为移动自动化设置 gitlab cicd?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53166279/

相关文章:

ubuntu - GitLab 更新后 Nginx 无法启动

docker - 进行更改后,GitLab docker镜像不会从gitlab.rb重新配置某些参数

android - 如何为 Appium 中使用的测试数据库建立种子?

ios - 如何将 .ipa 文件导入 Xcode 进行开发

windows - 如何在 Windows 上调试 "Could not add identity : agent refused operation"?

gitlab-ci - Gitlab CI在特定分支和手册上运行管道

linux - 使用变量替换创建文件并替换字符串中的某些字符

gitlab - 如何提前退出 gitlab 管道而不会失败?

docker - 将gitlab设置为docker容器,并显示docker Registry错误500

ios - Appium iOS Safari 打开新标签,接受提醒并在两个标签之间切换