8.1 What to Functionally Test About Layout and Style
parent
c1e75783d6
commit
f8ea01f895
|
@ -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
|
||||
# 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
|
||||
)
|
Loading…
Reference in New Issue