Skip to content

Commit 08eba66

Browse files
Reverting overwritten changes
1 parent cdb6d2d commit 08eba66

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

tests/test_contacts_list_page.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import pytest
22
from playwright.sync_api import Page, expect
3-
4-
from pages.contacts_list_page import ContactsListPage
5-
from utils.click_helper import click
63
from pages.base_page import BasePage
4+
from pages.contacts_list_page import ContactsListPage
5+
from pages.view_contacts_page import ViewContacts
6+
from pages.edit_my_contact_details_page import EditMyContactDetails
7+
from pages.maintain_contacts_page import MaintainContacts
8+
from pages.my_preference_settings_page import MyPreferenceSettings
79
from utils.user_tools import UserTools
810

911

@@ -26,29 +28,29 @@ def test_contacts_list_page_navigation(page: Page) -> None:
2628
are loaded when the links are clicked
2729
"""
2830
# View contacts page loads as expected
29-
click(page, page.get_by_role("link", name="View Contacts"))
30-
expect(page.locator("#ntshPageTitle")).to_contain_text("View Contacts")
31-
click(page, page.get_by_role("link", name="Back", exact=True))
31+
ContactsListPage(page).go_to_view_contacts_page()
32+
ViewContacts(page).verify_view_contacts_title()
33+
BasePage(page).click_back_button()
3234

3335
# Edit my contact details page loads as expected
34-
click(page, page.get_by_role("link", name="Edit My Contact Details"))
35-
expect(page.locator("#ntshPageTitle")).to_contain_text("Edit My Contact Details")
36-
click(page, page.get_by_role("link", name="Back"))
36+
ContactsListPage(page).go_to_edit_my_contact_details_page()
37+
EditMyContactDetails(page).verify_edit_my_contact_details_title()
38+
BasePage(page).click_back_button()
3739

3840
# Maintain contacts page loads as expected
39-
click(page, page.get_by_role("link", name="Maintain Contacts"))
40-
expect(page.locator("#ntshPageTitle")).to_contain_text("Maintain Contacts")
41-
click(page, page.get_by_role("link", name="Back"))
41+
ContactsListPage(page).go_to_maintain_contacts_page()
42+
MaintainContacts(page).verify_maintain_contacts_title()
43+
BasePage(page).click_back_button()
4244

4345
# My preference settings page loads as expected
44-
click(page, page.get_by_role("link", name="My Preference Settings"))
45-
expect(page.locator("#ntshPageTitle")).to_contain_text("My Preference Settings")
46-
click(page, page.get_by_role("link", name="Back"))
46+
ContactsListPage(page).go_to_my_preference_settings_page()
47+
MyPreferenceSettings(page).verify_my_preference_settings_title()
48+
BasePage(page).click_back_button()
4749

4850
# Other links are visible (Not clickable due to user role permissions)
49-
expect(page.get_by_text("Extract Contact Details")).to_be_visible()
50-
expect(page.get_by_text("Resect and Discard Accredited")).to_be_visible()
51+
ContactsListPage(page).verify_extract_contact_details_page_visible()
52+
ContactsListPage(page).verify_resect_and_discard_accredited_page_visible()
5153

5254
# Return to main menu
53-
click(page, page.get_by_role("link", name="Main Menu"))
54-
expect(page.locator("#ntshPageTitle")).to_contain_text("Main Menu")
55+
BasePage(page).click_main_menu_link()
56+
BasePage(page).main_menu_header_is_displayed()

0 commit comments

Comments
 (0)