diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 963f74331..58744a980 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,7 +40,7 @@ jobs: test_chapter_23_debugging_prod, test_chapter_24_outside_in, test_chapter_25_CI, - test_chapter_25_page_pattern, + test_chapter_26_page_pattern, ] env: diff --git a/.gitmodules b/.gitmodules index e95ec7cc8..376d23031 100644 --- a/.gitmodules +++ b/.gitmodules @@ -73,8 +73,8 @@ [submodule "source/chapter_25_CI/superlists"] path = source/chapter_25_CI/superlists url = git@github.com:hjwp/book-example.git -[submodule "source/chapter_25_page_pattern/superlists"] - path = source/chapter_25_page_pattern/superlists +[submodule "source/chapter_26_page_pattern/superlists"] + path = source/chapter_26_page_pattern/superlists url = git@github.com:hjwp/book-example.git [submodule "tests/testrepo"] diff --git a/Makefile b/Makefile index 3826c7ca3..1d22ae2ca 100644 --- a/Makefile +++ b/Makefile @@ -156,9 +156,9 @@ test_chapter_24_outside_in: chapter_24_outside_in.html $(TMPDIR) $(VENV)/bin .PHONY: test_chapter_25_CI test_chapter_25_CI: chapter_25_CI.html $(TMPDIR) $(VENV)/bin $(VENV)/bin/pytest -s --tb=short ./tests/test_chapter_25_CI.py -.PHONY: test_chapter_25_page_pattern -test_chapter_25_page_pattern: chapter_25_page_pattern.html $(TMPDIR) $(VENV)/bin - $(VENV)/bin/pytest -s --tb=short ./tests/test_chapter_25_page_pattern.py +.PHONY: test_chapter_26_page_pattern +test_chapter_26_page_pattern: chapter_26_page_pattern.html $(TMPDIR) $(VENV)/bin + $(VENV)/bin/pytest -s --tb=short ./tests/test_chapter_26_page_pattern.py .PHONY: test_appendix_purist_unit_tests diff --git a/appendix_IX_cheat_sheet.asciidoc b/appendix_IX_cheat_sheet.asciidoc index c8a64edad..d947a75db 100644 --- a/appendix_IX_cheat_sheet.asciidoc +++ b/appendix_IX_cheat_sheet.asciidoc @@ -123,7 +123,7 @@ Selenium/Functional Testing Best Practices * Look into BDD tools as another way of structuring your FTs. Relevant chapters: <>, <>, -<> +<> Outside-In, Test Isolation Versus Integrated Tests, and Mocking ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -162,5 +162,5 @@ painful, remember “__listen to your tests__”—ugly, mocky tests m trying to tell you that your code could be simplified. Relevant chapters: <>, <>, -<> +<> diff --git a/appendix_bdd.asciidoc b/appendix_bdd.asciidoc index 93c42e165..cee9cf2b9 100644 --- a/appendix_bdd.asciidoc +++ b/appendix_bdd.asciidoc @@ -648,7 +648,7 @@ The Page Pattern as an Alternative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ((("behavior-driven development (BDD)", "page pattern")))((("page pattern")))In -<> of the book, I present an example of the "Page +<> of the book, I present an example of the "Page pattern", which is an object-oriented approach to structuring your Selenium tests. Here's a reminder of what it looks like: diff --git a/appendix_github_links.asciidoc b/appendix_github_links.asciidoc index e54789963..c9566d1d8 100644 --- a/appendix_github_links.asciidoc +++ b/appendix_github_links.asciidoc @@ -44,7 +44,7 @@ Full List of Links for Each Chapter <>:: https://github.com/hjwp/book-example/tree/chapter_24_outside_in <>:: https://github.com/hjwp/book-example/tree/appendix_purist_unit_tests <>:: https://github.com/hjwp/book-example/tree/chapter_25_CI -<>:: https://github.com/hjwp/book-example/tree/chapter_25_page_pattern +<>:: https://github.com/hjwp/book-example/tree/chapter_26_page_pattern <>:: https://github.com/hjwp/book-example/tree/appendix_Django_Class-Based_Views <>:: https://github.com/hjwp/book-example/tree/appendix_bdd <>:: https://github.com/hjwp/book-example/tree/appendix_rest_api diff --git a/appendix_purist_unit_tests.asciidoc b/appendix_purist_unit_tests.asciidoc index e4be88e14..9acbeeb6e 100644 --- a/appendix_purist_unit_tests.asciidoc +++ b/appendix_purist_unit_tests.asciidoc @@ -408,7 +408,7 @@ class NewListViewIntegratedTest(TestCase): TIP: Have you heard the term "integration test" and are wondering what the difference is from an "integrated test"? Go and take a peek at the - definitions box in <>. + definitions box in <>. @@ -2007,7 +2007,7 @@ benefits. It's a judgement call. I hope that, by going through this appendix, I've given you a feel for what the trade-offs are. There's more discussion on this in -<>.((("", startref="IEinteg23")))((("", startref="IEisol23"))) +<>.((("", startref="IEinteg23")))((("", startref="IEisol23"))) Onwards! diff --git a/appendix_rest_api.asciidoc b/appendix_rest_api.asciidoc index de623748e..710dce044 100644 --- a/appendix_rest_api.asciidoc +++ b/appendix_rest_api.asciidoc @@ -43,7 +43,7 @@ has a good overview. In brief: * GET will give you details of a list (including all its items) in JSON format * POST lets you add an item -We'll take the code from its state at the end of <>. +We'll take the code from its state at the end of <>. Choosing Our Test Approach diff --git a/atlas.json b/atlas.json index 382e4aa74..51e42dc75 100644 --- a/atlas.json +++ b/atlas.json @@ -37,8 +37,8 @@ "chapter_23_debugging_prod.asciidoc", "chapter_24_outside_in.asciidoc", "chapter_25_CI.asciidoc", - "chapter_25_page_pattern.asciidoc", - "chapter_26_hot_lava.asciidoc", + "chapter_26_page_pattern.asciidoc", + "chapter_27_hot_lava.asciidoc", "epilogue.asciidoc", "appendix_I_PythonAnywhere.asciidoc", "appendix_Django_Class-Based_Views.asciidoc", diff --git a/book.asciidoc b/book.asciidoc index 87e78356a..5388a1fa4 100644 --- a/book.asciidoc +++ b/book.asciidoc @@ -48,8 +48,8 @@ include::chapter_22_fixtures_and_wait_decorator.asciidoc[] include::chapter_23_debugging_prod.asciidoc[] include::chapter_24_outside_in.asciidoc[] include::chapter_25_CI.asciidoc[] -include::chapter_25_page_pattern.asciidoc[] -include::chapter_26_hot_lava.asciidoc[] +include::chapter_26_page_pattern.asciidoc[] +include::chapter_27_hot_lava.asciidoc[] include::epilogue.asciidoc[] diff --git a/chapter_13_organising_test_files.asciidoc b/chapter_13_organising_test_files.asciidoc index 0c3b5bc8c..0d517668c 100644 --- a/chapter_13_organising_test_files.asciidoc +++ b/chapter_13_organising_test_files.asciidoc @@ -257,9 +257,9 @@ class FunctionalTest(StaticLiveServerTestCase): NOTE: Keeping helper methods in a base `FunctionalTest` class is one useful way of preventing duplication in FTs. - Later in the book (in <>) we'll use the "Page pattern", + Later in the book (in <>) we'll use the "Page pattern", // CSANAD: is this reference to the chapter "The Token Social Bit, the Page -// Pattern, and an Exercise for the Reader" as chapter_25_page_pattern +// Pattern, and an Exercise for the Reader" as chapter_26_page_pattern // still clear in print? which is related, but prefers composition over inheritance--always a good thing. @@ -716,7 +716,7 @@ The day we decide to change the implementation of how our list table works, we want to make sure we only have to change our FT code in one place, not in dozens of places across loads of FTs... -See also <> and <> for more on structuring +See also <> and <> for more on structuring your FT code. ******************************************************************************* diff --git a/chapter_25_page_pattern.asciidoc b/chapter_26_page_pattern.asciidoc similarity index 99% rename from chapter_25_page_pattern.asciidoc rename to chapter_26_page_pattern.asciidoc index 4fb2a5083..025b7cdbf 100644 --- a/chapter_25_page_pattern.asciidoc +++ b/chapter_26_page_pattern.asciidoc @@ -1,4 +1,4 @@ -[[chapter_25_page_pattern]] +[[chapter_26_page_pattern]] == The Token Social Bit, the Page Pattern, and an Exercise for the Reader .Warning, Chapter Update in Progress @@ -419,7 +419,7 @@ $ *git commit -m "Create Page objects for list pages, use in sharing FT"* [quote, Iain H. (reader)] ______________________________________________________________ I probably didn’t really understand what I was doing until after having -completed the "Exercise for the reader" in <>. +completed the "Exercise for the reader" in <>. ______________________________________________________________ ((("Page pattern", "practical exercise")))There's diff --git a/chapter_26_hot_lava.asciidoc b/chapter_27_hot_lava.asciidoc similarity index 99% rename from chapter_26_hot_lava.asciidoc rename to chapter_27_hot_lava.asciidoc index 49e4956da..0a9f57b6c 100644 --- a/chapter_26_hot_lava.asciidoc +++ b/chapter_27_hot_lava.asciidoc @@ -1,4 +1,4 @@ -[[chapter_26_hot_lava]] +[[chapter_27_hot_lava]] Fast Tests, Slow Tests, and Hot Lava ------------------------------------ diff --git a/preface.asciidoc b/preface.asciidoc index aced2936f..7f791c215 100644 --- a/preface.asciidoc +++ b/preface.asciidoc @@ -186,7 +186,7 @@ I've split this book into three parts. JavaScript. -<> (Chapters pass:[#chapter_19_spiking_custom_auth#chapter_26_hot_lava]): More advanced testing topics:: +<> (Chapters pass:[#chapter_19_spiking_custom_auth#chapter_27_hot_lava]): More advanced testing topics:: Mocking, integrating a third-party system, test fixtures, Outside-In TDD, and Continuous Integration (CI). diff --git a/source/chapter_25_page_pattern/superlists b/source/chapter_26_page_pattern/superlists similarity index 100% rename from source/chapter_25_page_pattern/superlists rename to source/chapter_26_page_pattern/superlists diff --git a/tests/chapters.py b/tests/chapters.py index c42acdbf6..b8cec6e06 100644 --- a/tests/chapters.py +++ b/tests/chapters.py @@ -31,8 +31,8 @@ "chapter_23_debugging_prod", "chapter_24_outside_in", "chapter_25_CI", - "chapter_25_page_pattern", + "chapter_26_page_pattern", - "chapter_26_hot_lava", + "chapter_27_hot_lava", ] diff --git a/tests/test_appendix_rest_api.py b/tests/test_appendix_rest_api.py index d38b4113b..43aebcb67 100644 --- a/tests/test_appendix_rest_api.py +++ b/tests/test_appendix_rest_api.py @@ -6,7 +6,7 @@ class AppendixVITest(ChapterTest): chapter_name = 'appendix_rest_api' - previous_chapter = 'chapter_25_page_pattern' + previous_chapter = 'chapter_26_page_pattern' def test_listings_and_commands_and_output(self): self.parse_listings() diff --git a/tests/test_chapter_25_page_pattern.py b/tests/test_chapter_26_page_pattern.py similarity index 97% rename from tests/test_chapter_25_page_pattern.py rename to tests/test_chapter_26_page_pattern.py index f65e3dbf3..298d3b163 100644 --- a/tests/test_chapter_25_page_pattern.py +++ b/tests/test_chapter_26_page_pattern.py @@ -6,7 +6,7 @@ class Chapter22Test(ChapterTest): - chapter_name = "chapter_25_page_pattern" + chapter_name = "chapter_26_page_pattern" previous_chapter = "chapter_25_CI" def test_listings_and_commands_and_output(self):