|
| 1 | +from playwright.sync_api import Page |
| 2 | + |
| 3 | +from mavis.test.annotations import step |
| 4 | + |
| 5 | + |
| 6 | +class HeaderComponent: |
| 7 | + def __init__(self, page: Page) -> None: |
| 8 | + self.page = page |
| 9 | + |
| 10 | + self.mavis_link = page.get_by_role( |
| 11 | + "link", |
| 12 | + name="Manage vaccinations in schools", |
| 13 | + ) |
| 14 | + |
| 15 | + links = page.get_by_label("Menu", exact=True) |
| 16 | + |
| 17 | + self.programmes_link = links.get_by_role("link", name="Programmes") |
| 18 | + self.sessions_link = links.get_by_role("link", name="Sessions") |
| 19 | + self.children_link = links.get_by_role("link", name="Children") |
| 20 | + self.vaccines_link = links.get_by_role("link", name="Vaccines") |
| 21 | + self.unmatched_consent_responses_link = links.get_by_role( |
| 22 | + "link", |
| 23 | + name="Unmatched Responses", |
| 24 | + ) |
| 25 | + self.school_moves_link = links.get_by_role("link", name="School Moves") |
| 26 | + self.import_records_link = links.get_by_role("link", name="Imports") |
| 27 | + self.your_team_link = links.get_by_role("link", name="Your Team") |
| 28 | + |
| 29 | + @step("Click on Manage vaccinations in schools") |
| 30 | + def click_mavis_header(self) -> None: |
| 31 | + self.mavis_link.click() |
| 32 | + |
| 33 | + @step("Click on Programmes") |
| 34 | + def click_programmes_header(self) -> None: |
| 35 | + self.programmes_link.click() |
| 36 | + |
| 37 | + @step("Click on Sessions") |
| 38 | + def click_sessions_header(self) -> None: |
| 39 | + self.sessions_link.click() |
| 40 | + |
| 41 | + @step("Click on Children") |
| 42 | + def click_children_header(self) -> None: |
| 43 | + self.children_link.click() |
| 44 | + |
| 45 | + @step("Click on Vaccines") |
| 46 | + def click_vaccines_header(self) -> None: |
| 47 | + self.vaccines_link.click() |
| 48 | + |
| 49 | + @step("Click on Consent Responses") |
| 50 | + def click_consent_responses_header(self) -> None: |
| 51 | + self.unmatched_consent_responses_link.click() |
| 52 | + |
| 53 | + @step("Click on School Moves") |
| 54 | + def click_school_moves_header(self) -> None: |
| 55 | + self.school_moves_link.click() |
| 56 | + |
| 57 | + @step("Click on Imports") |
| 58 | + def click_imports_header(self) -> None: |
| 59 | + self.import_records_link.click() |
| 60 | + |
| 61 | + @step("Click on Your Team") |
| 62 | + def click_your_team_header(self) -> None: |
| 63 | + self.your_team_link.click() |
0 commit comments