|
| 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 | + - command: exec |
| 30 | + lang: pwsh |
| 31 | + code: | |
| 32 | + # Download +install APK |
| 33 | + $apk_url = "https://dw.uptodown.net/dwn/RvVkii134Riphftvun7hQBZyU0aCwJjJMFI3FD3XyiR2-IJpuBWXadWSW1IBDH4us2x6lZT5CFGPXN-mCE8iXmUtEDZX9EcgP0ZDVFNBjF-6Esb49ktjva0lneLIgN0q/sfVkgNUCoq4pyIjN4Kgq_eLeFsdl17qphwZPltH0KDQ0MhaRZ2f14JU9eNL-NzInogYsiMKSi1Hi3i8dJlO7LeLBT-trJq_waAWMe6dxM0axtzM5XxyFcXrXKVvIdcVC/Qq5DSToc1YivIME2j6y0fjMcKHol6T4Zl8LeQs4lcgR4o0I_RP7IK0hUJuC_Le8U/todo-2-3-4.apk" |
| 34 | + Invoke-WebRequest -Uri "$apk_url" -OutFile "C:\app.apk" |
| 35 | + 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 |
| 42 | + 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 |
| 48 | + |
| 49 | + - prompt: assert app opens |
| 50 | + commands: |
| 51 | + - command: assert |
| 52 | + expect: The Todo App is open |
| 53 | + |
| 54 | + - command: hover-text |
| 55 | + action: click |
| 56 | + text: "click anywhere" |
| 57 | + description: Label that describes to click anywhere |
| 58 | + |
| 59 | + - prompt: Stop the Android Instance |
| 60 | + commands: |
| 61 | + - command: exec |
| 62 | + lang: pwsh |
| 63 | + code: | |
| 64 | + $instance = Get-Content -Path C:\instance_id -Raw |
| 65 | +
|
| 66 | + gmsaas instances stop $instance |
0 commit comments