forked from nhs-england-tools/playwright-python-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 2
Further updates to POMs and methods for compartment 4 #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adrianoaru-nhs
merged 2 commits into
main
from
feature/BCSS-20229-playwright-compartment-4-page-object-models
Apr 24, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
pages/screening_practitioner_appointments/book_appointment_page.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| from playwright.sync_api import Page, expect | ||
| from pages.base_page import BasePage | ||
|
|
||
|
|
||
| class BookAppointmentPage(BasePage): | ||
| def __init__(self, page: Page): | ||
| super().__init__(page) | ||
| self.page = page | ||
| # Book Appointment - page locators | ||
| self.screening_center_dropdown = page.locator("#UI_NEW_SCREENING_CENTRE") | ||
| self.site_dropdown = page.locator("#UI_NEW_SITE") | ||
| self.day_with_available_slots = page.locator( | ||
| 'input.twoColumnCalendar[style*="background-color: rgb(102, 255, 153);"]' | ||
| ).last | ||
| self.appointment_time_radio_button = page.locator( | ||
| page.get_by_role("radio", name="UI_NEW_SLOT_SELECTION_ID") | ||
| ) | ||
| self.save_button = page.get_by_role("button", name="Save") | ||
|
|
||
| def select_screening_centre_dropdown_option(self, screening_centre: str) -> None: | ||
| self.screening_center_dropdown.select_option(label=screening_centre) | ||
|
|
||
| def select_site_dropdown_option(self, screening_site: str) -> None: | ||
| self.site_dropdown.select_option(label=screening_site) | ||
| self.site_dropdown.press("Enter") | ||
|
|
||
| def choose_day_with_available_slots(self) -> None: | ||
| self.click(self.day_with_available_slots) | ||
|
|
||
| def choose_appointment_time(self) -> None: | ||
| self.appointment_time_radio_button.check() | ||
|
|
||
| def click_save_button(self) -> None: | ||
| self.click(self.save_button) | ||
|
|
||
| def appointment_booked_confirmation_is_displayed(self, message: str) -> None: | ||
| expect(self.page.get_by_text(message)).to_be_visible() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
pages/screening_practitioner_appointments/practitioner_availability_page.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| from playwright.sync_api import Page, expect | ||
| from pages.base_page import BasePage | ||
|
|
||
|
|
||
| class PractitionerAvailabilityPage(BasePage): | ||
| def __init__(self, page: Page): | ||
| super().__init__(page) | ||
| self.page = page | ||
| # Practitioner Availability - page locators | ||
| self.site_id_dropdown = page.locator("#UI_SITE_ID") | ||
| self.screening_practitioner_dropdown = page.locator("#UI_PRACTITIONER_ID") | ||
| self.calendar_button = page.get_by_role("button", name="Calendar") | ||
| self.show_button = page.get_by_role("button", name="Show") | ||
| self.time_from_text_field = page.get_by_role("textbox", name="From:") | ||
| self.time_to_text_field = page.get_by_role("textbox", name="To:") | ||
| self.calculate_slots_button = page.get_by_role("button", name="Calculate Slots") | ||
| self.number_of_weeks_text_field = page.locator("#FOR_WEEKS") | ||
| self.save_button = page.get_by_role("button", name="Save") | ||
|
|
||
| def select_site_dropdown_option(self, site_to_use: str) -> None: | ||
| self.site_id_dropdown.select_option(label=site_to_use) | ||
|
|
||
| def select_practitioner_dropdown_option(self, practitioner: str) -> None: | ||
| self.screening_practitioner_dropdown.select_option(label=practitioner) | ||
|
|
||
| def click_calendar_button(self) -> None: | ||
| self.click(self.calendar_button) | ||
|
|
||
| def click_show_button(self) -> None: | ||
| self.click(self.show_button) | ||
|
|
||
| def enter_start_time(self, start_time: str) -> None: | ||
| self.time_from_text_field.fill(start_time) | ||
|
|
||
| def enter_end_time(self, end_time: str) -> None: | ||
| self.time_to_text_field.fill(end_time) | ||
|
|
||
| def click_calculate_slots_button(self) -> None: | ||
| self.click(self.calculate_slots_button) | ||
|
|
||
| def enter_number_of_weeks(self, weeks: str) -> None: | ||
| self.number_of_weeks_text_field.fill(weeks) | ||
|
|
||
| def click_save_button(self) -> None: | ||
| self.click(self.save_button) | ||
|
|
||
| def slots_updated_message_is_displayed(self, message: str) -> None: | ||
| expect(self.page.get_by_text(message)).to_be_visible() |
15 changes: 15 additions & 0 deletions
15
pages/screening_practitioner_appointments/set_availability_page.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from playwright.sync_api import Page | ||
| from pages.base_page import BasePage | ||
|
|
||
|
|
||
| class SetAvailabilityPage(BasePage): | ||
| def __init__(self, page: Page): | ||
| super().__init__(page) | ||
| self.page = page | ||
| # Set Availability - page locators | ||
| self.practitioner_availability_link = page.get_by_role( | ||
| "link", name="Practitioner Availability -" | ||
| ) | ||
|
|
||
| def go_to_practitioner_availability_page(self) -> None: | ||
| self.click(self.practitioner_availability_link) |
14 changes: 14 additions & 0 deletions
14
pages/screening_subject_search/episode_events_and_notes_page.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from playwright.sync_api import Page, expect | ||
| from pages.base_page import BasePage | ||
|
|
||
|
|
||
| class EpisodeEventsAndNotesPage(BasePage): | ||
| def __init__(self, page: Page): | ||
| super().__init__(page) | ||
| self.page = page | ||
| # List of episode events and notes - page locators | ||
|
|
||
| def expected_episode_event_is_displayed(self, event_description: str) -> None: | ||
| expect( | ||
| self.page.get_by_role("cell", name=event_description, exact=True) | ||
| ).to_be_visible() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.