-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsample_test_script.py
More file actions
executable file
·51 lines (35 loc) · 1.16 KB
/
Copy pathsample_test_script.py
File metadata and controls
executable file
·51 lines (35 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'''
Created on Sep 12, 2017
@author: nandal-pc
'''
#!/usr/bin/env python3
import sys, os
from pathlib import Path
from pydroid import pydroid
from datetime import datetime
import sys
deviceId = "bff0d3db"
if len(sys.argv) > 2:
deviceId = sys.argv[1].strip()
# Set Test Config Params in SingleTon File
# Set Android Device Id - which we get using $ adb devices
deviceId =deviceId
# Set adb executable full path
adbExe = 'adb'
# set dir which contains temp data during the test run
tempDataDir = "{}/temp".format(Path.home())
# set dir for dumps, screenshots n other results during test run
resultDir = "{}/result_dir".format(Path.home())
# set file path for results logs
resultFilePath = resultDir+"/result_"+datetime.now().strftime('%Y_%m_%d_%H_%M_%S')+".txt"
print("Running Tests for : ", deviceId, adbExe, resultFilePath)
# Create an instance of Android Device
device = pydroid.Element(deviceId=deviceId, adbExe=adbExe, tempDataDir=tempDataDir,resultDir=resultDir,resultFilePath=resultFilePath)
# go to home
device.home()
# Swipe Left
device.swipe("LEFT")
# go to home
device.home()
# uninstall all user apps
device.adb.uninstall_all_user_apps()