diff --git a/functional_test.py b/functional_test.py index 685a970f98247afd1be1c1a48cd138da49df2ce2..2953424a1ae7ab6dbc99c840c7d7e5bb29c42f3c 100644 --- a/functional_test.py +++ b/functional_test.py @@ -1,4 +1,3 @@ -from django.test import LiveServerTestCase from selenium import webdriver from selenium.common.exceptions import WebDriverException from selenium.webdriver.common.keys import Keys @@ -41,6 +40,12 @@ class NewVisitorTest(unittest.TestCase): rows = table.find_elements_by_tag_name('tr') self.assertIn(row_text, [row.text for row in rows]) + def test_assert_name(self): + self.browser.get(HEROKU_APP_HOST) + + introduction = self.browser.find_element_by_id("intro") + self.assertIn('Izzatul', introduction.text) + def test_can_start_a_list_and_retrieve_it_later(self): self.browser.get(HEROKU_APP_HOST) diff --git a/practice/templates/homepage/home.html b/practice/templates/homepage/home.html index e39d3dea843f7cea792fbee099ad2d18971b286b..47a73b272228496045ef4989124932d39ca9fb02 100644 --- a/practice/templates/homepage/home.html +++ b/practice/templates/homepage/home.html @@ -1,7 +1,7 @@ <html> <title>To-Do lists {{ name }}</title> <body> - <h1>Hello, this is {{ name }}.</h1> + <h1 id="intro">Hello, this is {{ name }}.</h1> <h1>Your To-Do list</h1> <form method="POST"> <input name="item_text" id="id_new_item" placeholder="Enter a to-do item" />