emancipated hardcoded form views & html from base.html, apps.dashboard.views, apps.dashboard.tests.test_views; added get_item_input_box() helper method to functional_tests.base & retrofitted the other FTs to utilize it

This commit is contained in:
Disco DeDisco
2026-01-20 15:14:05 -05:00
parent 93cc6632c4
commit 1d96871d7b
7 changed files with 59 additions and 54 deletions

View File

@@ -14,7 +14,7 @@ class NewVisitorTest(FunctionalTest):
header_text = self.browser.find_element(By.TAG_NAME, 'h1').text
self.assertIn('Dashboard', header_text)
inputbox = self.browser.find_element(By.ID, 'id-new-item')
inputbox = self.get_item_input_box()
self.assertEqual(inputbox.get_attribute('placeholder'), 'Enter a to-do item')
inputbox.send_keys('Buy peacock feathers')
@@ -22,7 +22,7 @@ class NewVisitorTest(FunctionalTest):
inputbox.send_keys(Keys.ENTER)
self.wait_for_row_in_list_table('1. Buy peacock feathers')
inputbox = self.browser.find_element(By.ID, 'id-new-item')
inputbox = self.get_item_input_box()
inputbox.send_keys('Use peacock feathers to make a fly')
inputbox.send_keys(Keys.ENTER)
@@ -31,7 +31,7 @@ class NewVisitorTest(FunctionalTest):
def test_multiple_users_can_start_lists_at_different_urls(self):
self.browser.get(self.live_server_url)
inputbox = self.browser.find_element(By.ID, 'id-new-item')
inputbox = self.get_item_input_box()
inputbox.send_keys('Buy peacock feathers')
inputbox.send_keys(Keys.ENTER)
self.wait_for_row_in_list_table('1. Buy peacock feathers')
@@ -45,7 +45,7 @@ class NewVisitorTest(FunctionalTest):
page_text = self.browser.find_element(By.TAG_NAME, 'body').text
self.assertNotIn('Buy peacock feathers', page_text)
inputbox = self.browser.find_element(By.ID, 'id-new-item')
inputbox = self.get_item_input_box()
inputbox.send_keys('Buy milk')
inputbox.send_keys(Keys.ENTER)
self.wait_for_row_in_list_table('1. Buy milk')