changed _ naming convention in el ids to -; expanded home.html to include head w. title, body w. h1, input & table for testing purposes; functional_tests updated to accomodate above changes & for more specific error handling during tests

This commit is contained in:
Disco DeDisco
2025-12-30 22:19:42 -05:00
parent b3dba69708
commit 1ddabe4448
2 changed files with 16 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ class NewVisitorTest(unittest.TestCase):
header_text = self.browser.find_element(By.TAG_NAME, 'h1').text
self.assertIn('To-Do', header_text)
inputbox = self.browser.find_element(By.ID, 'id_new_item')
inputbox = self.browser.find_element(By.ID, 'id-new-item')
self.assertEqual(inputbox.get_attribute('placeholder'), 'Enter a to-do item')
inputbox.send_keys('Buy peacock feathers')
@@ -25,9 +25,12 @@ class NewVisitorTest(unittest.TestCase):
inputbox.send_keys(Keys.ENTER)
time.sleep(1)
table = self.browser.find_element(By.ID, 'id_list_table')
table = self.browser.find_element(By.ID, 'id-list-table')
rows = table.find_elements(By.TAG_NAME, 'tr')
self.assertTrue(any(row.text == '1: Buy peacock feathers' for row in rows))
self.assertTrue(
any(row.text == '1: Buy peacock feathers' for row in rows),
'New to-do item did not appear in table',
)
self.fail("Finish the test!")