示例#1
0
 def __init__(self, uri):
     super(WinDevice, self).__init__(uri)
     self.application = get_app(uri)
     self.window = get_window(uri)
     self.handle = self.window.handle
     self.add_component(WinNetworkComponent("network", self, uri))
     self.add_component(WinInputComponent("input", self, uri))
     self.add_component(WinKeyEventComponent("keyevent", self, uri))
     self.add_component(WinRuntimeComponent("runtime", self, uri))
     self.add_component(WinScreenComponent("screen", self, uri))
     self.add_component(WinAppComponent("app", self, uri))
示例#2
0
 def __init__(self, name, dev, uri):
     self._name = name
     self.uri = uri
     self.device = dev
     try:
         self.application = self.device.application
         self.window = self.device.window
     except AttributeError:
         self.device.app = get_app(self.uri)
         self.device.window = get_window(self.uri)
         self.window = self.device.window
         self.application = self.device.application
示例#3
0
    def __init__(self, name, dev, uri):
        self._name = name
        self.uri = uri
        self.device = dev

        try:
            self.application = self.device.application
            self.window = self.device.window
        except AttributeError:
            self.device.app = get_app(self.uri)
            self.device.window = get_window(self.uri)
            self.application = self.device.application
            self.window = self.device.window
        self.screen = mss()
        self.monitor = self.screen.monitors[0]  # 双屏的时候,self.monitor为整个双屏
        # 双屏的时候,self.singlemonitor
        self.singlemonitor = self.screen.monitors[1]
示例#4
0
    def __init__(self, uri):
        super(MumuDevice, self).__init__(uri)

        # Initialize the parameters required to operate Android Device
        self.kw = parse_uri(uri)
        self.serialno = self.kw.get("serialno")
        self.adb = ADB(self.serialno, server_addr=self.kw.get("host"))

        # Initialize the parameters required to operate Windows Device
        self.application = get_app(uri)
        self.window = get_window(uri)
        self.handle = self.window.handle

        # Use android app component
        self.add_component(AndroidAppComponent("app", self))
        # Use android screen component as default
        self.add_component(AndroidADBScreenComponent("screen", self))
        # Use android input component as default
        self.add_component(AndroidADBTouchInputComponent("input", self))
        # add windows input component
        self.add_component(WinInputComponent("wininput", self, uri))
        # add windows screen component
        self.add_component(WinScreenComponent("winscreen", self, uri))