-
Notifications
You must be signed in to change notification settings - Fork 927
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e552fa
commit a3ddee0
Showing
3 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Instrumentation tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- feature/marcos/add_maestro_to_ci | ||
schedule: | ||
- cron: '0 4 * * *' # run at 3 AM UTC | ||
workflow_dispatch: | ||
|
||
jobs: | ||
instrumentation_tests: | ||
runs-on: macos-latest | ||
name: Instrumentation tests | ||
strategy: | ||
matrix: | ||
api-level: [31] | ||
|
||
steps: | ||
- name: Cancel previous | ||
uses: styfle/cancel-workflow-action@0.7.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
- name: Decode keys | ||
uses: davidSchuppa/base64Secret-toFile-action@v1 | ||
with: | ||
secret: ${{ secrets.FAKE_RELEASE_PROPERTIES }} | ||
fileName: ddg_android_build.properties | ||
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/ | ||
|
||
- name: Decode key file | ||
uses: davidSchuppa/base64Secret-toFile-action@v1 | ||
with: | ||
secret: ${{ secrets.FAKE_RELEASE_KEY }} | ||
fileName: android | ||
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/ | ||
|
||
- name: Set up Homebrew | ||
id: set-up-homebrew | ||
uses: Homebrew/actions/setup-homebrew@master | ||
|
||
- name: Install Maestro | ||
run: | | ||
brew tap mobile-dev-inc/tap | ||
brew install maestro | ||
- name: Gradle cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} | ||
|
||
- name: AVD cache | ||
uses: actions/cache@v2 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-emul-${{ matrix.api-level }} | ||
|
||
- name: create AVD and generate snapshot for caching | ||
if: steps.avd-cache.outputs.cache-hit != 'true' | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: google_apis | ||
ndk: 21.0.6113669 | ||
arch: x86_64 | ||
profile: pixel_5 | ||
force-avd-creation: true | ||
emulator-options: -gpu host -noaudio -no-boot-anim -camera-back none | ||
disable-animations: false | ||
script: echo "Generated AVD snapshot for caching." | ||
|
||
- name: Android checks | ||
uses: reactiveCircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: google_apis | ||
ndk: 21.0.6113669 | ||
arch: x86_64 | ||
profile: pixel_5 | ||
force-avd-creation: false | ||
emulator-options: -no-snapshot-save -gpu host -noaudio -no-boot-anim -camera-back none | ||
disable-animations: true | ||
script: ./gradlew installPlayRelease && cd maestro && for i in *.yaml; do maestro test "$i"; done; | ||
|
||
- name: Bundle the Android CI checks report | ||
if: always() | ||
run: find . -type d -name 'reports' | zip -@ -r android-checks-report.zip | ||
|
||
- name: Upload the Android CI checks report | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: android-checks-report | ||
path: android-checks-report.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
appId: com.duckduckgo.mobile.android | ||
--- | ||
- launchApp: | ||
clearState: true | ||
- assertVisible: | ||
text: ".*Not to worry! Searching and browsing privately.*" | ||
- tapOn: "let's do it!" | ||
- tapOn: "cancel" | ||
- assertVisible: | ||
text: ".*I'll also upgrade the security of your connection if possible.*" | ||
- inputText: "https://www.search-company.site/" | ||
- tapOn: | ||
id: ".*key_pos_ime_action.*" | ||
- assertVisible: | ||
text: ".*Got It.*" | ||
- tapOn: | ||
text: ".*Got It.*" | ||
- assertVisible: | ||
id: ".*ad-id-2.*" | ||
- tapOn: | ||
id: ".*ad-id-2.*" | ||
- assertVisible: | ||
text: ".*Publisher site.*" | ||
- tapOn: | ||
text: ".*Publisher site.*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters