Skip to content

Commit f67cd12

Browse files
committed
fix tests
1 parent 8062054 commit f67cd12

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

tests/regression/reports/operational/test_subjects_to_be_invited_with_temporary_address.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@
2121
from datetime import datetime, timedelta
2222

2323

24-
@pytest.mark.wip
2524
@pytest.mark.regression
2625
@pytest.mark.reports_operational
2726
def test_subject_not_on_report_if_not_due(page: Page) -> None:
2827
"""
29-
Test to check if a subject is not due for invite they are not in the report.
28+
Test to check that a subject who is not due for invite is not in the report.
3029
"""
3130
logging.info(
32-
"Starting test: Test to check if a subject is not due for invite they are not in the report."
31+
"Starting test: Test to check that a subject who is not due for invite is not in the report."
3332
)
3433

3534
criteria1 = {
@@ -52,10 +51,10 @@ def test_subject_not_on_report_if_not_due(page: Page) -> None:
5251
@pytest.mark.reports_operational
5352
def test_subject_to_be_invited_without_temporary_address_at_this_hub_not_on_report(page: Page) -> None:
5453
"""
55-
Test to check if a subject that is due to be invited, that does not have a temporary address, at this hub, does not appear in the report.
54+
Test to check that a subject who is due to be invited, but does not have a temporary address, and is at this hub, does not appear in the report.
5655
"""
5756
logging.info(
58-
"Starting test: Verify a subject that is due to be invited, that does not have a temporary address, at this hub, does not appear in the report."
57+
"Starting test: Check that a subject who is due to be invited, but does not have a temporary address, and is at this hub, does not appear in the report."
5958
)
6059

6160
criteria = {
@@ -87,15 +86,14 @@ def test_subject_to_be_invited_without_temporary_address_at_this_hub_not_on_repo
8786
report.assertRecordsVisible(nhs_no, True)
8887

8988

90-
@pytest.mark.wip
9189
@pytest.mark.regression
9290
@pytest.mark.reports_operational
93-
def test_subject_to_be_invited_without_temporary_address_at_another_hub_not_on_report(page: Page) -> None:
91+
def test_subject_to_be_invited_with_temporary_address_at_another_hub_not_on_report(page: Page) -> None:
9492
"""
95-
Test to check if a subject that is due to be invited, that does have a temporary address but at another hub, does not appear in the report.
93+
Test to check that a subject who is due to be invited, and does have a temporary address but is at another hub, does not appear in the report.
9694
"""
9795
logging.info(
98-
"Starting test: Verify a subject that is due to be invited, that does have a temporary address but at another hub, does not appear in the report."
96+
"Starting test: Check that a subject who is due to be invited, and does have a temporary address but is at another hub, does not appear in the report."
9997
)
10098

10199
criteria = {
@@ -115,15 +113,15 @@ def test_subject_to_be_invited_without_temporary_address_at_another_hub_not_on_r
115113
report.filter_by_nhs_number(nhs_no)
116114
report.assertRecordsVisible(nhs_no, False)
117115

118-
@pytest.mark.wip
116+
119117
@pytest.mark.regression
120118
@pytest.mark.reports_operational
121119
def test_subject_on_report_is_hidden_after_review(page: Page) -> None:
122120
"""
123-
Test to check if a subject is reviewed they are hidden from the default view in the report.
121+
Test to check that a subject who becomes reviewed is then hidden from the default view in the report.
124122
"""
125123
logging.info(
126-
"Starting test: Test to check if a subject is reviewed they are hidden from the default view in the report."
124+
"Starting test: Check that a subject who becomes reviewed is then hidden from the default view in the report."
127125
)
128126

129127
criteria = {
@@ -166,15 +164,15 @@ def test_subject_on_report_is_hidden_after_review(page: Page) -> None:
166164
report.filterByReviewed("No")
167165
report.assertRecordsVisible(nhs_no, True)
168166

169-
@pytest.mark.wip
167+
170168
@pytest.mark.regression
171169
@pytest.mark.reports_operational
172170
def test_subject_to_be_invited_with_temporary_address_at_this_hub_is_on_report(page: Page) -> None:
173171
"""
174-
Test to check if a subject that is due to be invited, that does have a temporary address, at this hub, does appear in the report.
172+
Test to check that a subject who is due to be invited, and does have a temporary address, and is at this hub, does appear in the report.
175173
"""
176174
logging.info(
177-
"Starting test: Verify a subject that is due to be invited, that does have a temporary address, at this hub, does appear in the report."
175+
"Starting test: Check that a subject who is due to be invited, and does have a temporary address, and is at this hub, does appear in the report."
178176
)
179177

180178
criteria = {
@@ -274,4 +272,7 @@ def _remove_a_temp_address(page: Page) -> None:
274272
def _update_temp_address(page: Page, temp_address) -> None:
275273
logging.info(f"Updating Temporary address : {temp_address}.")
276274
demographic_page = SubjectDemographicPage(page)
275+
276+
logging.info("Updating postcode as sometimes the existing address has a bad or blank value which might break the save")
277+
demographic_page.fill_postcode_input("EX11AA")
277278
demographic_page.update_temporary_address(temp_address)

tests/regression/subject/demographic/test_temporary_address.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def before_each(page: Page) -> str:
3535
search_subject_demographics_by_nhs_number(page, nhs_no)
3636
return nhs_no
3737

38-
@pytest.mark.wip
38+
3939
@pytest.mark.vpn_required
4040
@pytest.mark.regression
4141
@pytest.mark.subject_tests
@@ -58,7 +58,6 @@ def test_not_amending_temporary_address(page: Page, before_each) -> None:
5858
LogoutPage(page).log_out()
5959

6060

61-
@pytest.mark.wip
6261
@pytest.mark.vpn_required
6362
@pytest.mark.regression
6463
@pytest.mark.subject_tests
@@ -100,7 +99,6 @@ def test_add_temporary_address_then_delete(page: Page, before_each) -> None:
10099
LogoutPage(page).log_out()
101100

102101

103-
@pytest.mark.wip
104102
@pytest.mark.vpn_required
105103
@pytest.mark.regression
106104
@pytest.mark.subject_tests
@@ -173,7 +171,6 @@ def test_validation_regarding_dates(page: Page) -> None:
173171
LogoutPage(page).log_out()
174172

175173

176-
@pytest.mark.wip
177174
@pytest.mark.vpn_required
178175
@pytest.mark.regression
179176
@pytest.mark.subject_tests
@@ -229,7 +226,6 @@ def test_ammending_temporary_address(page: Page, before_each) -> None:
229226
LogoutPage(page).log_out()
230227

231228

232-
@pytest.mark.wip
233229
@pytest.mark.vpn_required
234230
@pytest.mark.regression
235231
@pytest.mark.subject_tests

utils/oracle/subject_selection_query_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3204,7 +3204,7 @@ def _add_criteria_bowel_scope_due_date_reason(self):
32043204

32053205
def _add_criteria_subject_is_due_for_invite(self) -> None:
32063206
try:
3207-
answer = YesNoType.from_description(self.criteria_value)
3207+
answer = YesNoType.by_description_case_insensitive(self.criteria_value)
32083208

32093209
if answer == YesNoType.YES:
32103210
self.sql_from.append(" INNER JOIN next_invitation_subject nis ")

0 commit comments

Comments
 (0)