Skip to content

Commit

Permalink
♻️ [#496] Split gherkin to mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Dec 10, 2024
1 parent 0574e81 commit ac1ea7f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/src/openarchiefbeheer/utils/tests/gherkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

0 comments on commit ac1ea7f

Please sign in to comment.