11import pytest
2+ from sys import platform
23from playwright .sync_api import Page , expect
34from utils .click_helper import click
45from pages .bcss_home_page import MainMenu
@@ -16,8 +17,12 @@ def tests_properties() -> dict:
1617 dict: A dictionary containing the values loaded from the 'bcss_tests.properties' file.
1718 """
1819 configs = Properties ()
19- with open ('bcss_tests.properties' , 'rb' ) as read_prop :
20- configs .load (read_prop )
20+ if platform == "win32" : # File path from content root is required on Windows OS
21+ with open ('tests/bcss_tests.properties' , 'rb' ) as read_prop :
22+ configs .load (read_prop )
23+ elif platform == "darwin" : # Only the filename is required on macOS
24+ with open ('bcss_tests.properties' , 'rb' ) as read_prop :
25+ configs .load (read_prop )
2126 return configs .properties
2227
2328
@@ -48,13 +53,11 @@ def test_call_and_recall_page_navigation(page: Page) -> None:
4853 expect (page .locator ("#ntshPageTitle" )).to_contain_text ("Generate Invitations" )
4954 click (page , page .get_by_role ("link" , name = "Back" ))
5055
51-
5256 # Invitation generation progress page loads as expected
5357 click (page , page .get_by_role ("link" , name = "Invitation Generation Progress" ))
5458 expect (page .locator ("#ntshPageTitle" )).to_contain_text ("Invitation Generation Progress" )
5559 click (page , page .get_by_role ("link" , name = "Back" ))
5660
57-
5861 # Non invitation days page loads as expected
5962 click (page , page .get_by_role ("link" , name = "Non Invitation Days" ))
6063 expect (page .locator ("#ntshPageTitle" )).to_contain_text ("Non-Invitation Days" )
@@ -65,7 +68,6 @@ def test_call_and_recall_page_navigation(page: Page) -> None:
6568 expect (page .locator ("#page-title" )).to_contain_text ("Age Extension Rollout Plans" )
6669 click (page , page .get_by_role ("link" , name = "Back" ))
6770
68-
6971 # Return to main menu
7072 click (page , page .get_by_role ("link" , name = "Main Menu" ))
7173 expect (page .locator ("#ntshPageTitle" )).to_contain_text ("Main Menu" )
0 commit comments