mirror of
https://github.com/TrentSPalmer/hugo_themes_report.git
synced 2024-12-04 08:41:29 -08:00
fix window sizes in tests
This commit is contained in:
parent
8730970956
commit
e33847df1c
@ -14,8 +14,8 @@ class TestScroll(TestSelenium, TestCase):
|
||||
self.driver.execute_script(
|
||||
"window.scrollTo(0,document.body.scrollHeight)"
|
||||
)
|
||||
self.assertEqual(
|
||||
self.driver.execute_script("return window.pageYOffset"), 12461)
|
||||
self.assertGreaterEqual(
|
||||
self.driver.execute_script("return window.pageYOffset"), 12061)
|
||||
|
||||
def test_plus_button_scroll_to_top(self):
|
||||
self.assertEqual(
|
||||
@ -23,8 +23,8 @@ class TestScroll(TestSelenium, TestCase):
|
||||
self.driver.execute_script(
|
||||
"window.scrollTo(0,document.body.scrollHeight)"
|
||||
)
|
||||
self.assertEqual(
|
||||
self.driver.execute_script("return window.pageYOffset"), 12461)
|
||||
self.assertGreaterEqual(
|
||||
self.driver.execute_script("return window.pageYOffset"), 12061)
|
||||
self.plus_button.click()
|
||||
self.assertEqual(
|
||||
self.driver.execute_script("return window.pageYOffset"), 0)
|
||||
@ -36,8 +36,8 @@ class TestScroll(TestSelenium, TestCase):
|
||||
self.driver.execute_script(
|
||||
"window.scrollTo(0,document.body.scrollHeight)"
|
||||
)
|
||||
self.assertEqual(
|
||||
self.driver.execute_script("return window.pageYOffset"), 12573)
|
||||
self.assertGreaterEqual(
|
||||
self.driver.execute_script("return window.pageYOffset"), 12125)
|
||||
self.minus_button.click()
|
||||
self.assertEqual(
|
||||
self.driver.execute_script("return window.pageYOffset"), 0)
|
||||
|
@ -15,6 +15,7 @@ SOURCE_PAGE = f'file://{str(SOURCE_FILE)}'
|
||||
class TestSelenium(TestCase):
|
||||
def setUp(self):
|
||||
self.driver = webdriver.Chrome(options=OPTIONS, service=SERVICE)
|
||||
self.driver.set_window_size(1920, 1080)
|
||||
self.driver.get(SOURCE_PAGE)
|
||||
|
||||
def tearDown(self):
|
||||
|
@ -13,7 +13,8 @@ class TestTitle(TestSelenium, TestCase):
|
||||
self.assertEqual(
|
||||
self.x[0].value_of_css_property('text-align'), 'center')
|
||||
self.assertEqual(self.x[0].value_of_css_property('display'), 'block')
|
||||
self.assertEqual(self.x[0].value_of_css_property('max-width'), '736px')
|
||||
self.assertEqual(
|
||||
self.x[0].value_of_css_property('max-width'), '1856px')
|
||||
self.assertEqual(self.x[0].value_of_css_property('font-size'), '32px')
|
||||
self.assertEqual(self.x[0].value_of_css_property('font-weight'), '700')
|
||||
self.assertEqual(
|
||||
|
Loading…
Reference in New Issue
Block a user