diff --git a/backend/src/openarchiefbeheer/utils/tests/gherkin.py b/backend/src/openarchiefbeheer/utils/tests/gherkin.py index aa6389b8..09887d3d 100644 --- a/backend/src/openarchiefbeheer/utils/tests/gherkin.py +++ b/backend/src/openarchiefbeheer/utils/tests/gherkin.py @@ -18,7 +18,7 @@ from openarchiefbeheer.zaken.tests.factories import ZaakFactory -class GherkinLikeTestCase(PlaywrightTestCase): +class GerkinMixin: """ Experimental approach to writing Gherkin-like style test scenarios. Example: @@ -532,6 +532,9 @@ async def page_should_contain_element_with_title( async def path_should_be(self, page, path): await self.url_should_be(page, self.testcase.live_server_url + path) + async def url_regex_should_be(self, page, regex_path): + await expect(page).to_have_url(re.compile(regex_path)) + async def url_should_be(self, page, url): await expect(page).to_have_url(url) @@ -571,3 +574,7 @@ async def this_number_of_zaken_should_be_visible(self, page, number): rows = await locator.locator("tbody").locator("tr").all() self.testcase.assertEqual(len(rows), number) + + +class GherkinLikeTestCase(GerkinMixin, PlaywrightTestCase): + pass