testdriverai 6.0.20 → 6.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/testdriver/examples/android/example.yaml +12 -0
- package/testdriver/examples/android/lifecycle/postrun.yaml +11 -0
- package/testdriver/examples/android/lifecycle/provision.yaml +47 -0
- package/testdriver/examples/android/readme.md +7 -0
- package/testdriver/examples/desktop/lifecycle/prerun.yaml +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
version: 6.0.0
|
|
2
|
+
session: 685c63558f43d1527c84d053
|
|
3
|
+
steps:
|
|
4
|
+
- prompt: assert app opens
|
|
5
|
+
commands:
|
|
6
|
+
- command: assert
|
|
7
|
+
expect: The Todo App is open
|
|
8
|
+
|
|
9
|
+
- command: hover-text
|
|
10
|
+
action: click
|
|
11
|
+
text: "click anywhere"
|
|
12
|
+
description: Label that describes to click anywhere
|
|
@@ -0,0 +1,47 @@
|
|
|
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-test'
|
|
15
|
+
$instance=$(gmsaas instances start 3990323a-1e9a-49df-ad87-6947f7fc166e td-test)
|
|
16
|
+
gmsaas instances adbconnect $instance
|
|
17
|
+
|
|
18
|
+
# Save Instance ID and echo value
|
|
19
|
+
Write-Output $instance | Out-File -FilePath C:\instance_id
|
|
20
|
+
Write-Output "Instance ID: $instance"
|
|
21
|
+
|
|
22
|
+
# Get Display Link
|
|
23
|
+
gmsaas instances display -y $instance
|
|
24
|
+
$clipboard = Get-Clipboard
|
|
25
|
+
$escapedUrl = '"' + $clipboard + '"'
|
|
26
|
+
|
|
27
|
+
# Open Chrome to Emulator
|
|
28
|
+
Start-Process 'C:/Program Files/Google/Chrome/Application/chrome.exe' -ArgumentList '--start-maximized',$escapedUrl
|
|
29
|
+
|
|
30
|
+
- command: exec
|
|
31
|
+
lang: pwsh
|
|
32
|
+
code: |
|
|
33
|
+
# Download + install APK via cmd
|
|
34
|
+
$apk_url = "https://v6-demo-assets.s3.us-east-2.amazonaws.com/todo-1-0-0.apk"
|
|
35
|
+
Start-Process cmd.exe -ArgumentList "/c curl -o C:\app.apk $apk_url && adb install C:\app.apk"
|
|
36
|
+
|
|
37
|
+
# Get Package name
|
|
38
|
+
$output = & 'C:\Android\build-tools\36.0.0\aapt.exe' dump badging C:\app.apk
|
|
39
|
+
$package = ($output | Select-String "package: name='([^']+)'" ).Matches.Groups[1].Value
|
|
40
|
+
|
|
41
|
+
# Launch Application via cmd
|
|
42
|
+
Start-Process cmd.exe -ArgumentList "/c adb shell monkey -p $package -c android.intent.category.LAUNCHER 1"
|
|
43
|
+
|
|
44
|
+
# Make Sure Window is open
|
|
45
|
+
- command: wait-for-text
|
|
46
|
+
text: gmsaas
|
|
47
|
+
timeout: 60000
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Android Example (Preview)
|
|
2
|
+
|
|
3
|
+
This is a preview of TestDriver mobile support.
|
|
4
|
+
|
|
5
|
+
This example [Genymotion](https://www.genymotion.com/) cloud instance, downloads and installs an APK, uploads it to genymotion, and provides it as input to TestDriver.
|
|
6
|
+
|
|
7
|
+
This example only needs a Genymotion Key. Set it in `TD_GENYMOTION_KEY` within your `.env`.
|
|
File without changes
|