|
| 1 | +import pytest |
| 2 | +from playwright.sync_api import Page |
| 3 | +from pages.base_page import BasePage |
| 4 | +from pages.call_and_recall.call_and_recall_page import CallAndRecallPage |
| 5 | +from pages.call_and_recall.planning_and_monitoring_page import PlanningAndMonitoringPage |
| 6 | +from pages.call_and_recall.create_a_plan_page import CreateAPlanPage |
| 7 | +from utils.user_tools import UserTools |
| 8 | + |
| 9 | + |
| 10 | +@pytest.fixture(scope="function", autouse=True) |
| 11 | +def before_each(page: Page): |
| 12 | + """ |
| 13 | + Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the call and recall page |
| 14 | + """ |
| 15 | + # Log in to BCSS |
| 16 | + UserTools.user_login(page, "Hub Manager State Registered at BCS01") |
| 17 | + |
| 18 | + # Go to call and recall page |
| 19 | + BasePage(page).go_to_call_and_recall_page() |
| 20 | + |
| 21 | + |
| 22 | +def test_create_a_plan_weekly_rate(page: Page): |
| 23 | + """ |
| 24 | + Test to confirm that Hub Manager State Registered can set a weekly rate for invitations |
| 25 | + """ |
| 26 | + CallAndRecallPage(page).go_to_planning_and_monitoring_page() |
| 27 | + PlanningAndMonitoringPage(page).click_on_bcs001() |
| 28 | + CreateAPlanPage(page).click_create_a_plan() |
| 29 | + page.locator("#setAll").click() |
| 30 | + page.locator("input#weeklyRate").fill("130") |
| 31 | + page.locator("#update").click() |
| 32 | + |
| 33 | + # Add assertions here to verify rates are set correctly |
| 34 | + assert True # Replace with actual assertions |
| 35 | + |
| 36 | + |
| 37 | +def test_create_a_plan_daily_rate(page: Page): |
| 38 | + """ |
| 39 | + Test to confirm that Hub Manager State Registered can set a daily rate for invitations |
| 40 | + """ |
| 41 | + CallAndRecallPage(page).go_to_planning_and_monitoring_page() |
| 42 | + PlanningAndMonitoringPage(page).click_on_bcs001() |
| 43 | + CreateAPlanPage(page).click_create_a_plan() |
| 44 | + page.locator("#setAll").click() |
| 45 | + page.locator("input#dailyRate").fill("28") |
| 46 | + page.locator("#update").click() |
| 47 | + |
| 48 | + # Add assertions here to verify rates are set correctly |
| 49 | + assert True # Replace with actual assertions |
| 50 | + |
| 51 | + |
| 52 | +def test_update_week_rate(page: Page): |
| 53 | + """ |
| 54 | + Test to confirm that Hub Manager State Registered can update the invitation rate for a specific week |
| 55 | + """ |
| 56 | + CallAndRecallPage(page).go_to_planning_and_monitoring_page() |
| 57 | + PlanningAndMonitoringPage(page).click_on_bcs001() |
| 58 | + CreateAPlanPage(page).click_create_a_plan() |
| 59 | + # Simulate entering rate and updating, then add assertions to verify increments |
| 60 | + assert True # Replace with actual assertions |
| 61 | + |
| 62 | + |
| 63 | +def test_complete_invitation_planning(page: Page): |
| 64 | + """ |
| 65 | + Test to confirm that Hub Manager - State Registered can complete invitation planning for a screening centre |
| 66 | + """ |
| 67 | + CallAndRecallPage(page).go_to_planning_and_monitoring_page() |
| 68 | + PlanningAndMonitoringPage(page).click_on_bcs001() |
| 69 | + CreateAPlanPage(page).click_create_a_plan() |
| 70 | + # Add assertions to confirm successful creation and saving of the plan |
| 71 | + assert True # Replace with actual assertions |
0 commit comments