|
|
@@ -34,6 +34,43 @@ class NewVisitorTest(LiveServerTestCase):
|
|
|
header_text = self.browser.find_element_by_tag_name('h2').text
|
|
|
self.assertIn('Register', header_text)
|
|
|
|
|
|
+ # She is invited to enter a to-do item straight away
|
|
|
+ inputbox = self.browser.find_element_by_id('input-username')
|
|
|
+ self.assertEqual(
|
|
|
+ inputbox.get_attribute('placeholder'),
|
|
|
+ 'Enter your username'
|
|
|
+ )
|
|
|
+
|
|
|
+ # She types "Inception" into a text box
|
|
|
+ inputbox.send_keys('foobar')
|
|
|
+
|
|
|
+ inputbox = self.browser.find_element_by_id('input-email')
|
|
|
+ self.assertEqual(
|
|
|
+ inputbox.get_attribute('placeholder'),
|
|
|
+ 'Enter your email'
|
|
|
+ )
|
|
|
+
|
|
|
+ # She types "Inception" into a text box
|
|
|
+ inputbox.send_keys('foobar@example.com')
|
|
|
+
|
|
|
+ inputbox = self.browser.find_element_by_id('input-password')
|
|
|
+ self.assertEqual(
|
|
|
+ inputbox.get_attribute('placeholder'),
|
|
|
+ 'Enter your password'
|
|
|
+ )
|
|
|
+
|
|
|
+ # She types "Inception" into a text box
|
|
|
+ inputbox.send_keys('foobar')
|
|
|
+
|
|
|
+ # When she hits enter, the page updates, and now the page lists
|
|
|
+ # "1: Inception" as an item in a to-do list table
|
|
|
+ inputbox.send_keys(Keys.ENTER)
|
|
|
+
|
|
|
+ time.sleep(0.5)
|
|
|
+
|
|
|
+ edith_list_url = self.browser.current_url
|
|
|
+ self.assertRegex(edith_list_url, '/libraries/foobar/')
|
|
|
+
|
|
|
|
|
|
def test_can_start_a_list_for_one_user(self):
|
|
|
# Edith has heard about a cool new online to-do app. She goes
|