Пример #1
0
 def test_03lastPageCheck(self,platform,browserName,version,length,width):
     filename = "test_03lastPage" + 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)
     #翻到最后一页
     dp.jumpToLastPage()
     time.sleep(2)
     dp.saveScreenToFile(self.path, filename)
     time.sleep(1)
     # check video size
     result = dp.checkVideoSize(self.expected_vsize)
     if(result==1):
         self.logger.printlog("视频和预期结果匹配")
         print("视频和预期结果匹配")
     dp.quit_page()
     self.assertEqual(result, 1), "test_03lastPage fail"
Пример #2
0
 def test_03lastPageCheck(self,platformName,browserName,deviceName,udid):
     filename = "test_03lastPageCheck" + 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)
     # 翻到最后一页
     dp.jumpToLastPage()
     time.sleep(2)
     dp.saveScreenToFile(self.path, filename)
     time.sleep(1)
     # check video size
     result = dp.checkVideoSize(self.expected_vsize)
     if (result == 1):
         self.logger.printlog("视频和预期结果匹配")
         print("视频和预期结果匹配")
     dp.quit_page()
     self.assertEqual(result, 1), "test_03lastPage fail"
Пример #3
0
 def test_03lastPageCheck(self, deviceName):
     filename = "test_03lastPageCheck" + 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)
     # 翻到最后一页
     dp.jumpToLastPage()
     time.sleep(2)
     dp.saveScreenToFile(self.path, filename)
     time.sleep(1)
     # check video size
     result = dp.checkVideoSize(self.expected_vsize)
     if (result == 1):
         self.logger.printlog("视频和预期结果匹配")
         print("视频和预期结果匹配")
     dp.quit_page()
     self.assertEqual(result, 1), "test_03lastPage fail"
 def test_03lastPageCheck(self, platform, browserName, version, length,
                          width):
     filename = "test_03lastPage" + 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("check")
         print("check All")
         self.logger.printlog("check All")
         time.sleep(1)
         # 去掉勾选Sort and Favorite
         dp.checkDynamicSorting("uncheck")
         time.sleep(1)
         dp.checkFavorite('uncheck')
         time.sleep(1)
         #翻到最后一页
         result_lastp = dp.jumpToLastPage()
         time.sleep(3)
         dp.saveScreenToFile(self.path, filename)
         time.sleep(1)
         # # 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_lastp, 1), "test_03lastPage fail"