Skip to content

Commit b1932b3

Browse files
committed
Created POM for lines - 34, 57, 114, 120
1 parent 5d2e551 commit b1932b3

File tree

6 files changed

+34
-5
lines changed

6 files changed

+34
-5
lines changed

pages/active_batch_list_page.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def __init__(self, page: Page):
1212
self.batch_split_by_filter = self.page.locator("#splitByFilter")
1313
self.screening_centre_filter = self.page.locator("#screeningCentreFilter")
1414
self.count_filter = self.page.locator("#countFilter")
15+
self.batch_successfully_archived_msg = self.page.locator('text="Batch Successfully Archived and Printed"')
1516

1617
def enter_id_filter(self, search_text: str):
1718
self.id_filter.click()

pages/archived_batch_list_page.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from playwright.sync_api import Page
1+
from playwright.sync_api import Page,expect
22

33
class ArchivedBatchList:
44
def __init__(self, page: Page):
@@ -12,6 +12,15 @@ def __init__(self, page: Page):
1212
self.batch_split_by_filter = self.page.locator("#splitByFilter")
1313
self.screening_centre_filter = self.page.locator("#screeningCentreFilter")
1414
self.count_filter = self.page.locator("#countFilter")
15+
self.table_data = self.page.locator("td")
16+
17+
def verify_table_data(self,value):
18+
expect(self.table_data.filter(has_text=value)).to_be_visible()
19+
20+
def text_id_filter(self, search_text: str):
21+
self.text_filter.click()
22+
self.text_filter.fill(search_text)
23+
self.text_filter.press("Enter")
1524

1625
def enter_id_filter(self, search_text: str):
1726
self.id_filter.click()
@@ -52,3 +61,5 @@ def enter_count_filter(self, search_text: str):
5261
self.count_filter.click()
5362
self.count_filter.fill(search_text)
5463
self.count_filter.press("Enter")
64+
65+

pages/invitations_plans_page.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ def __init__(self, page: Page):
55
self.page = page
66
# Call and Recall - page links
77
self.create_a_plan = self.page.get_by_role("button", name="Create a Plan")
8+
self.invitations_plans_title = self.page.locator('#page-title:has-text("Invitation Plans")')
89

910
def go_to_create_a_plan_page(self):
1011
self.create_a_plan.click()

pages/log_out_page.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from playwright.sync_api import Page,expect
2+
3+
class Logout:
4+
def __init__(self, page: Page):
5+
self.page = page
6+
# Call and Recall - page links
7+
self.log_out_msg = self.page.get_by_role("heading", name="You have logged out")
8+
9+
def verify_log_out_page(self):
10+
expect(self.log_out_msg).to_be_visible()
11+
12+
13+
14+
15+

tests/Smokescreen/my_pages.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
from pages.create_a_plan_page import *
1313
from pages.invitations_plans_page import *
1414
from pages.generate_invitations_page import *
15+
from pages.log_out_page import *
1516
from utils.oracle import *

tests/Smokescreen/test_compartment_1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_example(page: Page) -> None:
3131
CreateAPlan(page).click_save_button()
3232
CreateAPlan(page).fill_note_field("test data")
3333
CreateAPlan(page).click_saveNote_button()
34-
page.locator('#page-title:has-text("Invitation Plans")').wait_for()
34+
InvitationsPlans(page).invitations_plans_title.wait_for()
3535

3636
# Generate Invitations
3737
NavigationBar(page).click_main_menu_link()
@@ -54,7 +54,7 @@ def test_example(page: Page) -> None:
5454

5555
# Log out
5656
NavigationBar(page).click_log_out_link()
57-
expect(page.get_by_role("heading", name="You have logged out")).to_be_visible()
57+
Logout(page).verify_log_out_page()
5858

5959
def batch_processing(page: Page, batch_type: str, batch_description: str, latest_event_status: str):
6060
NavigationBar(page).click_main_menu_link()
@@ -111,13 +111,13 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest
111111
page.on("dialog", lambda dialog: dialog.accept())
112112
ManageActiveBatch(page).confirm_button.nth(0).click()
113113

114-
page.locator('text="Batch Successfully Archived and Printed"').wait_for()
114+
ActiveBatchList(page).batch_successfully_archived_msg.wait_for()
115115

116116
NavigationBar(page).click_main_menu_link()
117117
MainMenu(page).go_to_communications_production_page()
118118
CommunicationsProduction(page).go_to_archived_batch_list_page()
119119
ArchivedBatchList(page).enter_id_filter(link_text)
120-
expect(page.locator("td").filter(has_text=link_text)).to_be_visible() # Checks to see if the batch is now archived
120+
ArchivedBatchList(page).verify_table_data(link_text)
121121

122122
subject_search_by_nhs_no(page, nhs_no, latest_event_status)
123123

0 commit comments

Comments
 (0)