Skip to content

Commit 8883106

Browse files
Add maestro tests for DuckPlayer (#6332)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1207252092703676/task/1210653066943055?focus=true ### Description Add maestro tests for DuckPlayer ### Steps to test this PR Run maestro tests tagged with `duckplayer` in Maestro Cloud Run maestro tests tagged with `duckplayerlocal` localy --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/864955901782631 --------- Co-authored-by: Craig Russell <[email protected]>
1 parent 62ff211 commit 8883106

39 files changed

+766
-1
lines changed

.github/workflows/duckplayer.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Duck Player Tests
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
paths:
10+
- 'node_modules/@duckduckgo/content-scope-scripts/**'
11+
12+
schedule:
13+
- cron: '0 4 * * *' # run at 4 AM UTC
14+
15+
workflow_dispatch:
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
duckplayer_tests:
23+
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || github.event_name == 'pull_request' }}
24+
name: Duck Player Tests
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
submodules: recursive
32+
33+
- name: Set up JDK version
34+
uses: actions/setup-java@v4
35+
with:
36+
java-version-file: .github/.java-version
37+
distribution: 'adopt'
38+
39+
- name: Create folder
40+
if: always()
41+
run: mkdir apk
42+
43+
- name: Decode keys
44+
uses: davidSchuppa/base64Secret-toFile-action@v2
45+
with:
46+
secret: ${{ secrets.FAKE_RELEASE_PROPERTIES }}
47+
fileName: ddg_android_build.properties
48+
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/
49+
50+
- name: Decode key file
51+
uses: davidSchuppa/base64Secret-toFile-action@v2
52+
with:
53+
secret: ${{ secrets.FAKE_RELEASE_KEY }}
54+
fileName: android
55+
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/
56+
57+
- name: Setup Gradle
58+
uses: gradle/actions/setup-gradle@v3
59+
60+
- name: Assemble APK
61+
run: ./gradlew assembleInternalRelease -Pforce-default-variant -Pskip-onboarding -x lint
62+
63+
- name: Move APK to new folder
64+
if: always()
65+
run: find . -name "*.apk" -exec mv '{}' apk/internal.apk \;
66+
67+
- name: Duck Player Tests
68+
if: always()
69+
uses: mobile-dev-inc/[email protected]
70+
timeout-minutes: 120
71+
with:
72+
api-key: ${{ secrets.ROBIN_API_KEY }}
73+
project-id: ${{ vars.ROBIN_ANDROID_PROJECT_ID }}
74+
name: duckPlayerTest_${{ github.sha }}
75+
timeout: ${{ vars.ROBIN_TIMEOUT_MINUTES }}
76+
app-file: apk/internal.apk
77+
android-api-level: 34
78+
workspace: .maestro
79+
include-tags: duckplayer
80+
81+
- name: Create Asana task when workflow failed
82+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
83+
uses: honeycombio/gha-create-asana-task@main
84+
with:
85+
asana-secret: ${{ secrets.ASANA_ACCESS_TOKEN }}
86+
asana-workspace-id: ${{ secrets.GH_ASANA_WORKSPACE_ID }}
87+
asana-project-id: ${{ secrets.DUCK_PLAYER_AOR_PROJECT_ID }}
88+
asana-section-id: ${{ secrets.DUCK_PLAYER_AOR_INCOMING_ID }}
89+
asana-task-name: GH Workflow Failure - Duck Player tests
90+
asana-task-description: The Duck Player workflow has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
appId: com.duckduckgo.mobile.android
2+
name: "DuckPlayer: Always > SERP > Carousel > Duck Player"
3+
tags:
4+
- duckplayer
5+
---
6+
- retry:
7+
maxRetries: 3
8+
commands:
9+
- launchApp:
10+
clearState: true
11+
12+
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- runFlow: common/enable_duck_player_always.yaml
14+
- runFlow: common/load_serp_video_carousel.yaml
15+
- runFlow: common/assert_duckplayer_visible.yaml
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
appId: com.duckduckgo.mobile.android
2+
name: "DuckPlayer: Always > SERP > Organic > Duck Player"
3+
tags:
4+
- duckplayer
5+
---
6+
- retry:
7+
maxRetries: 3
8+
commands:
9+
- launchApp:
10+
clearState: true
11+
12+
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- runFlow: common/enable_duck_player_always.yaml
14+
- runFlow: common/load_serp_videos_organic.yaml
15+
- runFlow: common/assert_duckplayer_visible.yaml
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
appId: com.duckduckgo.mobile.android
2+
name: "DuckPlayer: Always > SERP > Videos > Duck Player"
3+
tags:
4+
- duckplayer
5+
---
6+
- retry:
7+
maxRetries: 3
8+
commands:
9+
- launchApp:
10+
clearState: true
11+
12+
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- runFlow: common/enable_duck_player_always.yaml
14+
- runFlow: common/load_serp_videos_vertical.yaml
15+
- runFlow: common/assert_duckplayer_visible.yaml
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
appId: com.duckduckgo.mobile.android
2+
name: "DuckPlayer: Always > YouTube > Duck Player"
3+
tags:
4+
- duckplayer
5+
---
6+
- retry:
7+
maxRetries: 3
8+
commands:
9+
- launchApp:
10+
clearState: true
11+
12+
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- runFlow: common/enable_duck_player_always.yaml
14+
- runFlow: common/load_youtube_video.yaml
15+
- runFlow: common/assert_duckplayer_visible.yaml
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
appId: com.duckduckgo.mobile.android
2+
name: "DuckPlayer: Ask > Direct YouTube > Duck Player"
3+
tags:
4+
- duckplayer
5+
---
6+
- retry:
7+
maxRetries: 3
8+
commands:
9+
- launchApp:
10+
clearState: true
11+
12+
- runFlow: ../shared/skip_all_onboarding.yaml
13+
14+
- tapOn:
15+
id: "omnibarTextInput"
16+
- inputText: "duck://player/3ml7yeKBUhc"
17+
- pressKey: Enter
18+
19+
- extendedWaitUntil:
20+
visible:
21+
text: "duck://player/3ml7yeKBUhc.*"
22+
timeout: 5000
23+
24+
- tapOn:
25+
id: app
26+
27+
- tapOn:
28+
text: "Watch on YouTube"
29+
30+
- runFlow: common/assert_youtube_visible.yaml
31+
- runFlow: common/assert_overlay_not_shown.yaml
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
appId: com.duckduckgo.mobile.android
2+
name: "DuckPlayer: Ask > Direct YouTube > YouTube"
3+
tags:
4+
- duckplayerlocal
5+
---
6+
- retry:
7+
maxRetries: 3
8+
commands:
9+
- launchApp:
10+
clearState: true
11+
12+
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- runFlow: common/load_youtube_video.yaml
14+
15+
# Close the DuckPlayer prompt using "No Thanks" button
16+
- tapOn:
17+
text: "No Thanks"
18+
19+
# Wait for prompt to disappear
20+
- extendedWaitUntil:
21+
notVisible:
22+
text: "Turn on Duck Player to watch without targeted ads"
23+
timeout: 5000
24+
25+
# Core assertion: Verify we're still on regular YouTube (not Duck Player)
26+
- assertNotVisible:
27+
text: "duck://player/.*"
28+
29+
# Verify we're still on YouTube mobile URL
30+
- assertVisible:
31+
text: ".*youtube.*"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
appId: com.duckduckgo.mobile.android
2+
name: "DuckPlayer: Ask > SERP > Carousel > Duck Player"
3+
tags:
4+
- duckplayer
5+
---
6+
- retry:
7+
maxRetries: 3
8+
commands:
9+
- launchApp:
10+
clearState: true
11+
12+
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- runFlow: common/load_serp_video_carousel.yaml
14+
- runFlow: common/serp_dialog_duckplayer.yaml
15+
- runFlow: common/assert_duckplayer_visible.yaml
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
appId: com.duckduckgo.mobile.android
2+
name: "DuckPlayer: Ask > SERP > Carousel > YouTube"
3+
tags:
4+
- duckplayer
5+
---
6+
- retry:
7+
maxRetries: 3
8+
commands:
9+
- launchApp:
10+
clearState: true
11+
12+
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- runFlow: common/load_serp_video_carousel.yaml
14+
- runFlow: common/serp_dialog_youtube.yaml
15+
- runFlow: common/handle_youtube_cookies.yaml
16+
- runFlow: common/assert_youtube_visible.yaml
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
appId: com.duckduckgo.mobile.android
2+
name: "DuckPlayer: Ask > SERP > Organic > Duck Player"
3+
tags:
4+
- duckplayer
5+
---
6+
- retry:
7+
maxRetries: 3
8+
commands:
9+
- launchApp:
10+
clearState: true
11+
12+
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- runFlow: common/load_serp_videos_organic.yaml
14+
- runFlow: common/serp_dialog_duckplayer.yaml
15+
- runFlow: common/assert_duckplayer_visible.yaml

0 commit comments

Comments
 (0)