def test_08checkControlBoard(self,platform, browserName, version, length, width): filename = "test_08checkControlBoard" + platform + browserName + length + width + ".png" desired_capabilities = {"platform": platform, "browserName": browserName, "version": version, "javascriptEnabled": True } driver = webdriver.Remote(command_executor='http://10.12.128.233:4444/wd/hub', desired_capabilities=desired_capabilities) dp = DestinationP(driver, self.url) dp.open(length, width) time.sleep(1) # 用户登录 login = LoginP(driver, self.url) login.login(self.username, self.password) # 勾选All dp.checkAll("check") self.logger.printlog("check All") time.sleep(1) # 点击 controldelayBitraty and check size result_setBitDelaySize= dp.checkBitDelaySize(self.expect_setBitDelaySize, self.path, filename) if (result_setBitDelaySize == 1): self.logger.printlog("视频大小和预期结果匹配") print("视频大小和预期结果匹配") dp.quit_page() self.assertEqual(result_setBitDelaySize, 1), "test_08checkControlBoard check videosize fail"
def test_08checkControlBoard(self,platformName,browserName,deviceName,udid): filename = "test_08checkControlBoard" + deviceName + ".png" # self.logger.printlog("test_01mobile") desired_capabilities = {"platformName": platformName, "browserName": browserName, "platformVersion": "12.1.0", "deviceName": deviceName, "automationName": "XCUITest", "udid": udid, "useNewWDA": True } driver = wd.Remote(command_executor="http://10.12.128.233:4444/wd/hub", desired_capabilities=desired_capabilities) dp = DestinationP(driver, self.url) dp.open(self.length, self.width) time.sleep(1) # 用户登录 login = LoginP(driver, self.url) login.login(self.username, self.password) # 勾选All dp.checkAll("check") self.logger.printlog("check All") time.sleep(1) # 点击 controldelayBitraty and check size result_setBitDelaySize = dp.checkBitDelaySize(self.expect_setBitDelaySize, self.path, filename) if (result_setBitDelaySize == 1): self.logger.printlog("视频大小和预期结果匹配") print("视频大小和预期结果匹配") dp.quit_page() self.assertEqual(result_setBitDelaySize, 1), "test_08checkControlBoard check videosize fail"
def test_08checkControlBoard(self, deviceName): filename = "test_07checkRinfoSize" + deviceName + ".png" mobile_emulation = {"deviceName": deviceName} chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("mobileEmulation", mobile_emulation) # prefs = {"profile.managed_default_content_settings.images": 2} # chrome_options.add_experimental_option("prefs", prefs) # chrome_options.add_argument('blink-settings=imagesEnabled=false') driver = webdriver.Chrome( executable_path= "D:\\Python36\\chromedriver_win32\\chromedriver.exe", desired_capabilities=chrome_options.to_capabilities()) dp = DestinationP(driver, self.url) dp.open(self.length, self.width) time.sleep(1) # 用户登录 login = LoginP(driver, self.url) login.login(self.username, self.password) # 勾选All dp.checkAll("check") self.logger.printlog("check All") time.sleep(1) # 点击 controldelayBitraty and check size result_setBitDelaySize = dp.checkBitDelaySize( self.expect_setBitDelaySize, self.path, filename) if (result_setBitDelaySize == 1): self.logger.printlog("视频大小和预期结果匹配") print("视频大小和预期结果匹配") dp.quit_page() self.assertEqual(result_setBitDelaySize, 1), "test_08checkControlBoard check videosize fail"
def test_09checkControlBoard(self, platform, browserName, version, length, width): filename = "test_09checkControlBoard" + platform + browserName + length + width + ".png" desired_capabilities = { "platform": platform, "browserName": browserName, "version": version, "javascriptEnabled": True } try: driver = webdriver.Remote( command_executor='http://10.12.128.233:4444/wd/hub', desired_capabilities=desired_capabilities) dp = DestinationP(driver, self.url) dp.open(length, width) time.sleep(1) # 用户登录 login = LoginP(driver, self.url) login.login(self.username, self.password) # 取消勾选All dp.checkAll("uncheck") self.logger.printlog("uncheck All") time.sleep(1) # 去掉勾选Sort and Favorite dp.checkDynamicSorting("uncheck") time.sleep(1) dp.checkFavorite('uncheck') time.sleep(1) # 勾选live result_live = dp.checkLiveReceivers('check') print("check liveReceivers" + str(result_live)) time.sleep(1) # 点击 controldelayBitraty and check size result_setBitDelaySize = dp.checkBitDelaySize( self.expect_setBitDelaySize, self.path, filename) if (result_setBitDelaySize == 1): self.logger.printlog("BitDelaySize大小和预期结果匹配") print("BitDelaySize大小和预期结果匹配") # # check video size # result = dp.checkVideoSize(self.expected_vsize) # if (result == 1): # self.logger.printlog("所有视频大小和预期结果匹配") # print("所有视频大小和预期结果匹配") except Exception as e: print("Reason:", e) finally: dp.quit_page() self.assertEqual(result_setBitDelaySize, 1), "test_09checkControlBoard check videosize fail" self.assertEqual(result_live, 1), "test_09checkControlBoard 勾选live不显示live的视频 fail"