Skip to content

Commit 922ce1f

Browse files
committed
Add Android Demo
1 parent 538efb3 commit 922ce1f

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/workflows/acceptance-v6.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ jobs:
5252
TD_API_KEY: ${{ secrets.TESTDRIVER_API_KEY }}
5353
TD_WEBSITE: https://testdriver-sandbox.vercel.app
5454
TD_THIS_FILE: ${{ matrix.test }}
55+
TD_GENYMOTION_KEY: ${{ secrets.GENYMOTION_KEY }}

testdriver/acceptance/android.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
version: 6.0.0
2+
session: 685c63558f43d1527c84d053
3+
steps:
4+
# Start the instance and install APK
5+
- prompt: Download and Start APK
6+
commands:
7+
- command: exec
8+
lang: pwsh
9+
code: |
10+
# Authenticate Gmsaas
11+
gmsaas auth token ${TD_GENYMOTION_KEY}
12+
# gmsaas config set android-sdk-path C:\Android
13+
14+
# Start instance, with name 'td'
15+
$instance=$(gmsaas instances start 3990323a-1e9a-49df-ad87-6947f7fc166e td)
16+
gmsaas instances adbconnect $instance
17+
18+
# Save Instance ID
19+
$instance | Out-File -FilePath C:\instance_id
20+
21+
# Get Display Link
22+
gmsaas instances display -y $instance
23+
$clipboard = Get-Clipboard
24+
$escapedUrl = '"' + $clipboard + '"'
25+
26+
# Open Chrome to Emulator
27+
Start-Process 'C:/Program Files/Google/Chrome/Application/chrome.exe' -ArgumentList '--start-maximized',$escapedUrl
28+
29+
# Download +install APK
30+
$apk_url = "https://dw.uptodown.net/dwn/RvVkii134Riphftvun7hQBZyU0aCwJjJMFI3FD3XyiR2-IJpuBWXadWSW1IBDH4us2x6lZT5CFGPXN-mCE8iXmUtEDZX9EcgP0ZDVFNBjF-6Esb49ktjva0lneLIgN0q/sfVkgNUCoq4pyIjN4Kgq_eLeFsdl17qphwZPltH0KDQ0MhaRZ2f14JU9eNL-NzInogYsiMKSi1Hi3i8dJlO7LeLBT-trJq_waAWMe6dxM0axtzM5XxyFcXrXKVvIdcVC/Qq5DSToc1YivIME2j6y0fjMcKHol6T4Zl8LeQs4lcgR4o0I_RP7IK0hUJuC_Le8U/todo-2-3-4.apk"
31+
Invoke-WebRequest -Uri "$apk_url" -OutFile "C:\app.apk"
32+
adb install C:\app.apk
33+
34+
# Get Package name
35+
$output = & 'C:\Android\build-tools\36.0.0\aapt.exe' dump badging C:\app.apk
36+
$package = ($output | Select-String "package: name='([^']+)'" ).Matches.Groups[1].Value
37+
38+
# Launch Application
39+
adb shell monkey -p $package -c android.intent.category.LAUNCHER 1
40+
41+
# Make Sure Window is open
42+
- command: wait-for-text
43+
text: gmsaas
44+
timeout: 60000
45+
46+
- prompt: assert app opens
47+
commands:
48+
- command: assert
49+
expect: The Todo App is open
50+
51+
- command: hover-text
52+
action: click
53+
text: "click anywhere"
54+
description: Label that describes to click anywhere
55+
56+
- command: hover-text
57+
action: click
58+
text: "+"
59+
description: New Task button
60+
61+
- prompt: Stop the Android Instance
62+
commands:
63+
- command: exec
64+
lang: pwsh
65+
code: |
66+
$instance = Get-Content -Path C:\instance_id -Raw
67+
68+
gmsaas instances stop $instance

0 commit comments

Comments
 (0)