diff --git a/chapter_24_outside_in.asciidoc b/chapter_24_outside_in.asciidoc index 62ef5fc8..84180ebf 100644 --- a/chapter_24_outside_in.asciidoc +++ b/chapter_24_outside_in.asciidoc @@ -92,7 +92,7 @@ to look for a "My Lists" page: [role="sourcecode"] -.src/functional_tests/test_my_lists.py (ch22l001) +.src/functional_tests/test_my_lists.py (ch24l001) ==== [source,python] ---- @@ -105,15 +105,23 @@ from selenium.webdriver.common.by import By # She goes to the home page and starts a list self.browser.get(self.live_server_url) - self.add_list_item("Reticulate splines") + self.add_list_item("Reticulate splines") # <1> self.add_list_item("Immanentize eschaton") first_list_url = self.browser.current_url # She notices a "My lists" link, for the first time. self.browser.find_element(By.LINK_TEXT, "My lists").click() - # She sees that her list is in there, named according to its - # first list item + # She sees her email is there in the page heading + self.wait_for( + lambda: self.assertIn( + "edith@example.com", + self.browser.find_element(By.CSS_SELECTOR, "h1").text, + ) + ) + + # And she sees that her list is in there, + # named according to its first list item self.wait_for( lambda: self.browser.find_element(By.LINK_TEXT, "Reticulate splines") ) @@ -124,11 +132,11 @@ from selenium.webdriver.common.by import By ---- ==== +<1> We'll define this `add_list_item()` shortly. -//TODO: add a check for email in my lists page header, reflow logic -// to fit better with workshops.. +// Programming by wishful thinking, as always! -We create a list with a couple of items, +As you can see, we create a list with a couple of items, then we check that this list appears on a new "My Lists" page, and that it's "named" after the first item in the list. @@ -138,7 +146,7 @@ The FT continues, and while we're at it, we check that only logged-in users can see the "My Lists" page: [role="sourcecode"] -.src/functional_tests/test_my_lists.py (ch22l002) +.src/functional_tests/test_my_lists.py (ch24l002) ==== [source,python] ---- @@ -177,7 +185,7 @@ We define it in 'base.py': [role="sourcecode small-code"] -.src/functional_tests/base.py (ch22l003) +.src/functional_tests/base.py (ch24l003) ==== [source,python] ---- @@ -198,8 +206,8 @@ And while we're at it we can use it in a few of the other FTs, like this for example: -[role="sourcecode dofirst-ch22l004-1"] -.src/functional_tests/test_layout_and_styling.py (ch22l004-2) +[role="sourcecode dofirst-ch24l004-1"] +.src/functional_tests/test_layout_and_styling.py (ch24l004-2) ==== [source,diff] ---- @@ -213,13 +221,12 @@ like this for example: ---- ==== -I think it makes the FTs a lot more readable. I made a total of six -changes--see if you agree with me. +I think it makes the FTs a lot more readable. +I made a total of six changes--see if you agree with me. A quick run of all FTs, a commit, and then back to the FT we're working on. The first error should look like this: -//IDEA: add a thing that looks for her email address in an h1? [subs="specialcharacters,macros"] ---- @@ -239,10 +246,8 @@ We can address that at the presentation layer, in _base.html_, in our navigation Here's the minimal code change: -* TODO: update this link for latest bootstrap / style nicely - [role="sourcecode small-code"] -.src/lists/templates/base.html (ch22l005) +.src/lists/templates/base.html (ch24l005) ==== [source,html] ---- @@ -250,45 +255,46 @@ Here's the minimal code change: