11import pytest
2- import logging
32from playwright .sync_api import Page
43from pages .base_page import BasePage
54from pages .call_and_recall .call_and_recall_page import CallAndRecallPage
@@ -17,7 +16,7 @@ def before_each(page: Page):
1716 Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the call and recall page
1817 """
1918 # Log in to BCSS
20- UserTools.user_login(page, "Hub Manager State Registered at BCS01 ")
19+ UserTools .user_login (page , "Hub Manager at BCS02 " )
2120
2221 # Go to call and recall page
2322 BasePage (page ).go_to_call_and_recall_page ()
@@ -29,55 +28,44 @@ def test_add_then_delete_non_invitation_day(page: Page) -> None:
2928 """
3029 Verifies that a user can add and delete a non-invitation day.
3130 """
32- CallAndRecallPage(page).go_to_non_invitation_days_page()
33-
34- NonInvitationDaysPage(page).enter_date("14/11/2030")
35- NonInvitationDaysPage(page).enter_note(
36- "Add a non-invitation day for automated test"
37- )
38- NonInvitationDaysPage(page).click_add_non_invitation_day_button()
39- NonInvitationDaysPage(page).verify_date_is_visible("14/11/2030")
40-
41- NonInvitationDaysPage(page).click_delete_button("14/11/2030")
42- NonInvitationDaysPage(page).confirm_delete_action()
43- NonInvitationDaysPage(page).verify_date_is_not_visible("14/11/2030")
44-
4531 # Scenario: Add then delete a non invitation day
46- # Given I log in to BCSS "England" as user role "HubManagerAtBCS02"
4732 # And I go to "Non-Invitation Days"
33+ CallAndRecallPage (page ).go_to_non_invitation_days_page ()
4834
4935 # # The date entered should be a week day, otherwise a warning message will pop up
5036 # When I enter "14/11/2030" in the input box with id "date"
51-
37+ NonInvitationDaysPage ( page ). enter_date ( "14/11/2030" )
5238 # # Add a new non invitation day
5339 # And I enter "Add a non invitation day for automated test" in the input box with id "note"
54- # And I click the "Add Non-Invitation Day" button
55- # Then the text "14/11/2030" is visible
40+ NonInvitationDaysPage (page ).enter_note (
41+ "Add a non-invitation day for automated test"
42+ )
5643
57- # # Delete the non invitation day using delete button whose element id happens to contain date information
58- # When I click the element with id "actionButton14/11/2030"
59- # And I press OK on my confirmation prompt
60- # Then the text "14/11/2030" is not visible
44+ # And I click the "Add Non-Invitation Day" button
45+ NonInvitationDaysPage (page ).click_add_non_invitation_day_button ()
46+ # Then todays date is visible in the non-invitation days table
47+ NonInvitationDaysPage (page ).verify_date_is_visible ()
48+ # When I click the delete button for the non-invitation day
49+ NonInvitationDaysPage (page ).click_delete_button ()
50+ # And I press OK on my confirmation prompt TODO: This is a modal/popup that needs to be handled
51+ NonInvitationDaysPage (page ).confirm_delete_action ()
52+ # Then todays date is not visible in the non-invitation days table
53+ NonInvitationDaysPage (page ).verify_date_is_not_visible ()
6154
6255
6356@pytest .mark .regression
6457@pytest .mark .call_and_recall
65- def test_non_invitation_day_note_required (page: Page) -> None:
58+ def test_non_invitation_day_note_is_mandatory (page : Page ) -> None :
6659 """
6760 Verifies that a note is required when adding a non-invitation day.
6861 """
62+ # And I go to "Non-Invitation Days"
6963 CallAndRecallPage (page ).go_to_non_invitation_days_page ()
70-
64+ # When I enter "14/11/2030" in the input box with id "date"
7165 NonInvitationDaysPage (page ).enter_date ("14/11/2030" )
66+ # And I click the "Add Non-Invitation Day" button
7267 NonInvitationDaysPage (page ).click_add_non_invitation_day_button ()
73-
68+ # Then I get an alert message that "contains" "The Note field is mandatory" TODO: This is a modal/popup that needs to be handled
7469 NonInvitationDaysPage (page ).verify_alert_message_contains (
7570 "The Note field is mandatory"
7671 )
77-
78- # Scenario: Non invitation day note is compulsory
79- # Given I log in to BCSS "England" as user role "HubManagerAtBCS02"
80- # And I go to "Non-Invitation Days"
81- # When I enter "14/11/2030" in the input box with id "date"
82- # And I click the "Add Non-Invitation Day" button
83- # Then I get an alert message that "contains" "The Note field is mandatory"
0 commit comments