Beispiel #1
0
    def setUp(self):
        # 在当前目录,新建mail.txt,文件第一行存放设备列表,第二行存放roomid
        with open('mail.txt', 'r') as f:
            info = f.readlines()
        devicelist = info[0].rstrip().split(',')
        logger.info(f'devicelist: {devicelist}')
        self.device_name = devicelist
        self.roomid = info[1].split('#')[0].rstrip()
        self.sd = pubfuc.StartDriver(devicelist)
        self.proc_list = []
        print(self.roomid)

        pubfuc.cleannodeproc()
        for i in range(len(self.sd.devicelist)):
            self.proc_list.append(multiprocessing.Process(target=self.sd.startappiumserver, args=(i,)))

        for pro in self.proc_list:
            pro.start()

        for pro in self.proc_list:
            pro.join()

        while len(self.sd.getnodeprocpid()) < len(devicelist):
            sleep(1)

        logger.info(self.sd.getnodeprocpid())

        self.driverlist = []

        for i in range(len(self.sd.devicelist)):
            logger.info(i)
            driver = webdriver.Remote(f"http://localhost:{self.sd.aport[i]}/wd/hub", self.sd.realdevice[i])
            self.driverlist.append(driver)

        logger.info(self.driverlist)
Beispiel #2
0
    def setUp(self):
        # 在当前目录,新建mail.txt,文件第一行存放设备列表,第二行存放roomid
        with open('mail.txt', 'r') as f:
            info = f.readlines()
        devicelist = info[0].rstrip().split(',')
        logger.info(f'devicelist: {devicelist}')
        self.device_name = devicelist
        self.roomid = info[1].split('#')[0].rstrip()
        self.package = info[2].rstrip()
        self.sd = pubfuc.StartDriver(devicelist)
        self.proc_list = []

        pubfuc.cleannodeproc()
        for i in range(len(self.sd.devicelist)):
            self.proc_list.append(
                multiprocessing.Process(target=self.sd.startappiumserver,
                                        args=(i, )))

        for pro in self.proc_list:
            pro.start()

        for pro in self.proc_list:
            pro.join()

        while len(self.sd.getnodeprocpid()) < len(devicelist):
            sleep(1)

        logger.info(self.sd.getnodeprocpid())

        self.driverlist = []

        for i in range(len(self.sd.devicelist)):
            logger.info(i)
            desire_caps = self.sd.realdevice[i]
            packageinfo = pubfuc.getpackageinfo(desire_caps, self.package)
            if 'bundleId' in desire_caps:
                desire_caps['bundleId'] = packageinfo['bundleId']
                # desire_caps['waitForQuiescence'] = 'false'
            else:
                desire_caps['appPackage'] = packageinfo['appPackage']
                desire_caps['appActivity'] = packageinfo['appActivity']
            driver = webdriver.Remote(
                f"http://localhost:{self.sd.aport[i]}/wd/hub",
                self.sd.realdevice[i])
            self.driverlist.append(driver)

        logger.info(self.driverlist)
Beispiel #3
0
    def setUp(self):
        with open('mail.txt', 'r') as f:
            info = f.readlines()
        self.device_name = info[0].rstrip().split(',')
        logger.info(f'devicelist: {self.device_name}')
        self.roomid = info[1].split('#')[0].rstrip()
        self.sd = pubfuc.StartDriver(self.device_name)
        self.proc_list = []

        pubfuc.cleannodeproc()
        for i in range(len(self.sd.devicelist)):
            self.proc_list.append(
                multiprocessing.Process(target=self.sd.startappiumserver,
                                        args=(i, )))

        for pro in self.proc_list:
            pro.start()

        for pro in self.proc_list:
            pro.join()

        while len(self.sd.getnodeprocpid()) < len(self.device_name):
            sleep(1)

        logger.info(self.sd.getnodeprocpid())

        self.driverlist = []

        for i in range(len(self.sd.devicelist)):
            logger.info(i)
            desire_caps = self.sd.realdevice[i]
            if 'bundleId' in desire_caps:
                desire_caps['bundleId'] = 'net.powerinfo.face2face'
                desire_caps['waitForQuiescence'] = 'false'
            else:
                desire_caps['appPackage'] = 'net.powerinfo.face2face'
                desire_caps[
                    'appActivity'] = 'net.powerinfo.face2face.MainActivity'
            driver = webdriver.Remote(
                f"http://localhost:{self.sd.aport[i]}/wd/hub", desire_caps)
            sleep(3)
            self.driverlist.append(driver)

        print(self.driverlist)
Beispiel #4
0
    def setUp(self):
        with open('mail.txt', 'r') as f:
            info = f.readlines()
        devicelist = info[0].rstrip().split(',')
        logger.info(f'devicelist: {devicelist}')
        self.device_name = devicelist
        self.roomid = info[1].split('#')[0].rstrip()
        self.sd = pubfuc.StartDriver(devicelist)
        self.proc_list = []

        pubfuc.cleannodeproc()
        for i in range(len(self.sd.devicelist)):
            self.proc_list.append(multiprocessing.Process(target=self.sd.startappiumserver, args=(i,)))

        for pro in self.proc_list:
            pro.start()

        for pro in self.proc_list:
            pro.join()

        while len(self.sd.getnodeprocpid()) < len(devicelist):
            sleep(1)

        logger.info(self.sd.getnodeprocpid())

        self.driverlist = []

        for i in range(len(self.sd.devicelist)):
            logger.info(i)
            desire_caps = self.sd.realdevice[i]

            desire_caps['appPackage'] = 'com.powerinfo.demo.mpdemo'
            desire_caps['appActivity'] = 'com.powerinfo.demo.mpdemo.SettingActivity'

            driver = webdriver.Remote(f"http://localhost:{self.sd.aport[i]}/wd/hub", self.sd.realdevice[i])
            driver.implicitly_wait(20)
            self.driverlist.append(driver)

        print(self.driverlist)
Beispiel #5
0
    def setUp(self):
        self.控件信息 = pubfuc.getymlfileinfo()['zego_Android']
        #第一个为主播
        devicelist = ['p6']

        self.sd = pubfuc.StartDriver(devicelist)

        self.proc_list = []
        是否mac = 'mac' in pubfuc.getcurretsystem()

        pubfuc.cleannodeproc()
        for i in range(len(self.sd.devicelist)):
            self.proc_list.append(
                multiprocessing.Process(target=self.sd.startappiumserver,
                                        args=(i, )))

        # print(self.proc_list)

        for pro in self.proc_list:
            pro.start()

        for pro in self.proc_list:
            pro.join()

        while len(self.sd.getnodeprocpid()) < len(devicelist):
            sleep(1)

        print(self.sd.getnodeprocpid())

        self.driverlist = []
        for i in range(len(self.sd.devicelist)):
            desire_caps = self.sd.realdevice[i]
            desire_caps['appPackage'] = 'com.zego.videotalk'
            desire_caps['appActivity'] = 'com.zego.videotalk.MainActivity'
            driver = webdriver.Remote(
                f"http://localhost:{self.sd.aport[i]}/wd/hub", desire_caps)
            self.driverlist.append(driver)
            driver.page_source
        print(self.driverlist)