Skip to content

Commit 81e8edb

Browse files
Adding scenario 11 from feature file
1 parent f4441b5 commit 81e8edb

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

tests/regression/subject/episodes/datasets/investigation/endoscopy/test_endoscopy_investigation_dataset_scenarios.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,73 @@ def test_check_behaviour_of_drug_information_fields_in_incomplete_dataset(
12481248
LogoutPage(page).log_out()
12491249

12501250

1251+
@pytest.mark.regression
1252+
@pytest.mark.vpn_required
1253+
@pytest.mark.investigation_dataset_tests
1254+
@pytest.mark.bcss_additional_tests
1255+
@pytest.mark.colonoscopy_dataset_tests
1256+
def test_check_behaviour_of_aspirant_endoscopist_fields_in_incomplete_dataset(
1257+
page: Page,
1258+
) -> None:
1259+
"""
1260+
Scenario: Check the behaviour of the Aspirant Endoscopist fields
1261+
This tests:
1262+
> Aspirant Endoscopist Not Present field is enabled until an Aspirant Endoscopist is selected
1263+
> If Aspirant Endoscopist Not Present is ticked, it is automatically unticked and disabled when an Aspirant Endoscopist is selected
1264+
> Aspirant Endoscopist Participation is only displayed if an Aspirant Endoscopist is selected
1265+
> Aspirant Endoscopist Participation is only displayed if an Aspirant Endoscopist defaults to Operator
1266+
"""
1267+
nhs_no = get_subject_with_new_colonoscopy_investigation_dataset()
1268+
1269+
UserTools.user_login(page, "Screening Centre Manager at BCS001")
1270+
1271+
BasePage(page).go_to_screening_subject_search_page()
1272+
search_subject_episode_by_nhs_number(page, nhs_no)
1273+
1274+
SubjectScreeningSummaryPage(page).click_datasets_link()
1275+
SubjectDatasetsPage(page).click_investigation_show_datasets()
1276+
1277+
InvestigationDatasetsPage(page).bowel_cancer_screening_page_title_contains_text(
1278+
"Investigation Datasets"
1279+
)
1280+
1281+
assert (
1282+
InvestigationDatasetsPage(page).are_fields_on_page(
1283+
"Investigation Dataset", None, ["Aspirant Endoscopist"]
1284+
)
1285+
) is True, "Aspirant Endoscopist field is not visible when it should be"
1286+
logging.info("Aspirant Endoscopist field is visible")
1287+
1288+
assert (
1289+
InvestigationDatasetsPage(page).are_fields_on_page(
1290+
"Investigation Dataset",
1291+
None,
1292+
["Aspirant Endoscopist Participation"],
1293+
visible=False,
1294+
)
1295+
) is True, (
1296+
"Aspirant Endoscopist Participation field is visible when it should not be"
1297+
)
1298+
logging.info("Aspirant Endoscopist Participation field is not visible")
1299+
1300+
InvestigationDatasetsPage(page).check_aspirant_endoscopist_not_present()
1301+
DatasetFieldUtil(page).assert_checkbox_to_right_is_ticked_or_not(
1302+
"Aspirant Endoscopist lookup", "Ticked"
1303+
)
1304+
InvestigationDatasetsPage(page).select_aspirant_endoscopist_option_index(-1)
1305+
DatasetFieldUtil(page).assert_checkbox_to_right_is_enabled(
1306+
"Aspirant Endoscopist lookup", False
1307+
)
1308+
1309+
DatasetFieldUtil(page).assert_cell_to_right_has_expected_text(
1310+
"Aspirant Endoscopist Participation", "Operator"
1311+
)
1312+
DatasetFieldUtil(page).assert_select_to_right_has_values(
1313+
"Aspirant Endoscopist Participation", ["Operator", "Spectator"]
1314+
)
1315+
LogoutPage(page).log_out()
1316+
1317+
12511318
def check_role_access_to_edit_investigation_dataset(
12521319
page: Page,
12531320
nhs_no: str,

0 commit comments

Comments
 (0)