2026-01-14 13:23:31 -05:00
|
|
|
from selenium.webdriver.common.by import By
|
|
|
|
|
from selenium.webdriver.common.keys import Keys
|
|
|
|
|
|
|
|
|
|
from .base import FunctionalTest
|
2026-02-17 23:07:12 -05:00
|
|
|
from .list_page import ListPage
|
2026-01-14 13:23:31 -05:00
|
|
|
|
|
|
|
|
class LayoutAndStylingTest(FunctionalTest):
|
|
|
|
|
def test_layout_and_styling(self):
|
|
|
|
|
self.browser.get(self.live_server_url)
|
2026-02-17 23:07:12 -05:00
|
|
|
list_page = ListPage(self)
|
2026-01-14 13:23:31 -05:00
|
|
|
|
|
|
|
|
self.browser.set_window_size(1024, 768)
|
2026-01-19 19:09:11 -05:00
|
|
|
# print("Viewport width:", self.browser.execute_script("return window.innerWidth"))
|
2026-01-14 13:23:31 -05:00
|
|
|
|
2026-02-17 23:07:12 -05:00
|
|
|
inputbox = list_page.get_item_input_box()
|
2026-01-14 13:23:31 -05:00
|
|
|
self.assertAlmostEqual(
|
|
|
|
|
inputbox.location['x'] + inputbox.size['width'] / 2,
|
|
|
|
|
512,
|
|
|
|
|
delta=10,
|
|
|
|
|
)
|
|
|
|
|
|
2026-02-17 23:07:12 -05:00
|
|
|
list_page.add_list_item("testing")
|
|
|
|
|
inputbox = list_page.get_item_input_box()
|
2026-01-14 13:23:31 -05:00
|
|
|
self.assertAlmostEqual(
|
|
|
|
|
inputbox.location['x'] + inputbox.size['width'] / 2,
|
|
|
|
|
512,
|
|
|
|
|
delta=10,
|
|
|
|
|
)
|