diff --git a/src/functional_tests/tests.py b/src/functional_tests/tests.py index 70c484c..d1de157 100644 --- a/src/functional_tests/tests.py +++ b/src/functional_tests/tests.py @@ -117,4 +117,27 @@ class NewVisitorTest(LiveServerTestCase): self.assertNotIn('Buy peacock feathers', page_text) self.assertIn('Buy milk', page_text) - # Satisfied, they both go back to sleep \ No newline at end of file + # Satisfied, they both go back to sleep + + def test_layout_and_styling(self): + # Edith goes to the home page + self.browser.get(self.live_server_url) + self.browser.set_window_size(1024, 768) + + # She notices the input box is nicely centered + inputbox = self.browser.find_element_by_id('id_new_item') + self.assertAlmostEqual( + inputbox.location['x'] + inputbox.size['width']/2, + 512, + delta=10) + + # She starts a new list and sees the input is nicely centered there too + inputbox.send_keys('testing') + inputbox.send_keys(Keys.ENTER) + self.wait_for_row_in_list_table('1: testing') + inputbox = self.browser.find_element_by_id('id_new_item') + self.assertAlmostEqual( + inputbox.location['x'] + inputbox.size['width'] / 2, + 512, + delta=10 + ) \ No newline at end of file