Skip to content

Commit 6924e62

Browse files
author
Victor Soares
committed
Added base url and break to test_compartment_1.py
1 parent 4394cb1 commit 6924e62

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ addopts =
1212
--json-report-file=test-results/results.json
1313
--json-report-omit=collectors
1414
--tracing=retain-on-failure
15+
--base-url=https://bcss-bcss-18680-ddc-bcss.k8s-nonprod.texasplatform.uk/
1516

1617
# Allows pytest to identify the base of this project as the pythonpath
1718
pythonpath = .
1819

20+
1921
# These are the tags that pytest will recognise when using @pytest.mark
2022
markers =
2123
#example: tests used for example purposes by this blueprint

tests/Smokescreen/test_compartment_1.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest
9696
link = row.locator("a").first
9797
link_text = link.inner_text() # Get the link text dynamically
9898
link.click()
99+
break
99100
else:
100101
pytest.fail(f"No {batch_type} batch found")
101102

@@ -119,7 +120,7 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest
119120
download_file = download_info.value
120121
file = download_file.suggested_filename
121122
# Wait for the download process to complete and save the downloaded file in a temp folder
122-
download_file.save_as(f"/temp/{file}")
123+
download_file.save_as(file)
123124
page.wait_for_timeout(1000)
124125
if file.endswith(".pdf"):
125126
nhs_no = pdf_Reader(file)
@@ -146,7 +147,7 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest
146147
subject_search_by_nhs_no(page, nhs_no, latest_event_status)
147148

148149
def pdf_Reader(file: str):
149-
reader = PdfReader(f"/temp/{file}")
150+
reader = PdfReader(file)
150151

151152
# For loop looping through all pages of the file to find the NHS Number
152153
for pages in reader.pages:
@@ -162,7 +163,7 @@ def pdf_Reader(file: str):
162163
return nhs_no
163164

164165
def csv_Reader(file: str):
165-
csv_df = pd.read_csv(f"/temp/{file}")
166+
csv_df = pd.read_csv(file)
166167
return csv_df
167168

168169
def subject_search_by_nhs_no(page: Page, nhs_no: str, latest_event_status: str):

0 commit comments

Comments
 (0)