Beispiel #1
0
 def __init__(self, dev):
     Replayer.__init__(self)
     self.device = dev
     self.wifiAgent = WifiAgent(self.device)
     self.cellularAgent = CellularAgent(self.device)
     self.screenAgent = ScreenAgent(self.device)
     self.keypressAgent = KeypressAgent(self.device)
Beispiel #2
0
 def processSpecialEvents(self, specialEvent):
     if specialEvent == 'wifi':
         WifiAgent(self.device).changeWifiStatus()
     elif specialEvent == 'data':
         CellularAgent(self.device).toggleCellularDataStatus()
 def __init__(self, dev):
     Replayer.__init__(self)
     self.device = dev
     self.wifiAgent = WifiAgent(self.device)
     self.cellularAgent = CellularAgent(self.device)
Beispiel #4
0
sys.path.append(os.path.join(module_path(), '..', 'src'))

from Agents import CellularAgent, ScreenAgent, SystemStatusAgent, WifiAgent
from MonkeyHelper import EMonkeyDevice
from time import sleep

device = EMonkeyDevice()
test = CellularAgent(device)
print 'current cellular data status', test.getCellularDataStatus()
print 'toggle cellular data status', test.toggleCellularDataStatus()
sleep(5)
print 'turn off cellular data status', test.turnOffCellularData()
sleep(5)
print 'turn on cellular data status', test.turnOnCellularData()

test = ScreenAgent(device)
print 'current screen rotation status', test.getScreenRotationStatus()
print 'current orientation', test.getOrientation()

test = SystemStatusAgent(device)
print 'current WIFI status', test.getWifiStatus()
print 'current battery level', test.getBatteryLevel()

test = WifiAgent(device)
print 'current WIFI status', test.getWiFiStatus()
print 'toggle WIFI status', test.changeWifiStatus()
sleep(5)
print 'turn off cellular data status', test.turnOffWifi()
sleep(5)
print 'turn on cellular data status', test.turnOnWifi()