本文整理匯總了Python中toolium.visual_test.VisualTest.get_scrolls_size方法的典型用法代碼示例。如果您正苦於以下問題:Python VisualTest.get_scrolls_size方法的具體用法?Python VisualTest.get_scrolls_size怎麽用?Python VisualTest.get_scrolls_size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類toolium.visual_test.VisualTest
的用法示例。
在下文中一共展示了VisualTest.get_scrolls_size方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_get_scrolls_size_firefox
# 需要導入模塊: from toolium.visual_test import VisualTest [as 別名]
# 或者: from toolium.visual_test.VisualTest import get_scrolls_size [as 別名]
def test_get_scrolls_size_firefox(driver_wrapper):
# Update conf and create a new VisualTest instance
driver_wrapper.config.set('Driver', 'type', 'firefox')
visual = VisualTest(driver_wrapper)
# Check chrome scrolls
assert visual.get_scrolls_size() == {'x': 0, 'y': 0}
示例2: test_get_scrolls_size_iexplore
# 需要導入模塊: from toolium.visual_test import VisualTest [as 別名]
# 或者: from toolium.visual_test.VisualTest import get_scrolls_size [as 別名]
def test_get_scrolls_size_iexplore(driver_wrapper):
# Update conf and create a new VisualTest instance
# Mock scrollHeight, scrollWidth, innerHeight, innerWidth
driver_wrapper.driver.execute_script.side_effect = [600, 1200, 400, 900]
driver_wrapper.config.set('Driver', 'type', 'iexplore')
visual = VisualTest(driver_wrapper)
# Check chrome scrolls
assert visual.get_scrolls_size() == {'x': 21, 'y': 21}
示例3: test_remove_scrolls_without_scroll
# 需要導入模塊: from toolium.visual_test import VisualTest [as 別名]
# 或者: from toolium.visual_test.VisualTest import get_scrolls_size [as 別名]
def test_remove_scrolls_without_scroll(driver_wrapper):
# Create a new VisualTest instance
visual = VisualTest(driver_wrapper)
visual.get_scrolls_size = lambda: {'x': 0, 'y': 0}
# Remove scroll
img = Image.open(file_scroll)
img = visual.remove_scrolls(img)
# Assert output image
assert_image(visual, img, 'report_name', 'register_chrome_scroll')