Skip to content

Commit 25a39ac

Browse files
Upgrading actions/upload-artifact@v3 to actions/upload-artifact@v4
Adding aother POM
1 parent 0b92324 commit 25a39ac

File tree

6 files changed

+67
-38
lines changed

6 files changed

+67
-38
lines changed

.github/actions/create-lines-of-code-report/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ runs:
3232
run: zip lines-of-code-report.json.zip lines-of-code-report.json
3333
- name: "Upload CLOC report as an artefact"
3434
if: ${{ !env.ACT }}
35-
uses: actions/upload-artifact@v3
35+
uses: actions/upload-artifact@v4
3636
with:
3737
name: lines-of-code-report.json.zip
3838
path: ./lines-of-code-report.json.zip

.github/actions/scan-dependencies/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ runs:
3232
run: zip sbom-repository-report.json.zip sbom-repository-report.json
3333
- name: "Upload SBOM report as an artefact"
3434
if: ${{ !env.ACT }}
35-
uses: actions/upload-artifact@v3
35+
uses: actions/upload-artifact@v4
3636
with:
3737
name: sbom-repository-report.json.zip
3838
path: ./sbom-repository-report.json.zip
@@ -47,7 +47,7 @@ runs:
4747
run: zip vulnerabilities-repository-report.json.zip vulnerabilities-repository-report.json
4848
- name: "Upload vulnerabilities report as an artefact"
4949
if: ${{ !env.ACT }}
50-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v4
5151
with:
5252
name: vulnerabilities-repository-report.json.zip
5353
path: ./vulnerabilities-repository-report.json.zip

pages/generate_invitations_page.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
from playwright.sync_api import Page, expect
2+
import pytest
3+
4+
class GenerateInvitations:
5+
def __init__(self, page: Page):
6+
self.page = page
7+
# Generate Invitations - page links
8+
self.generate_invitations_button = self.page.get_by_role("button", name="Generate Invitations")
9+
self.displayRS = self.page.locator("#displayRS")
10+
self.refresh_button = self.page.get_by_role("button", name="Refresh")
11+
self.planned_invitations_total = self.page.locator("#col8_total")
12+
13+
14+
def click_generate_invitations_button(self):
15+
self.generate_invitations_button.click()
16+
17+
def click_refresh_button(self):
18+
self.refresh_button.click()
19+
20+
def wait_for_invitation_generation_complete(self):
21+
self.page.wait_for_selector("#displayRS", timeout=5000)
22+
23+
if self.planned_invitations_total == "0":
24+
pytest.fail("There are no planned invitations to generate")
25+
26+
# Initially, ensure the table contains "Queued"
27+
expect(self.displayRS).to_contain_text("Queued")
28+
29+
# Set timeout parameters
30+
timeout = 120000 # Total timeout of 120 seconds (in milliseconds)
31+
wait_interval = 5000 # Wait 5 seconds between refreshes (in milliseconds)
32+
elapsed = 0
33+
34+
# Loop until the table no longer contains "Queued"
35+
while elapsed < timeout:
36+
table_text = self.displayRS.text_content()
37+
if "Queued" in table_text or "In Progress" in table_text:
38+
# Click the Refresh button
39+
self.click_refresh_button()
40+
self.page.wait_for_timeout(wait_interval)
41+
elapsed += wait_interval
42+
elif "Failed" in table_text:
43+
pytest.fail("Invitation has failed to generate")
44+
else:
45+
break
46+
47+
# Final check: ensure that the table now contains "Completed"
48+
expect(self.displayRS).to_contain_text("Completed")

pages/navigation_bar_links.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ def __init__(self, page: Page):
1111
self.log_out_link = self.page.get_by_role("link", name="Log-out")
1212

1313
def click_main_menu_link(self):
14-
self.main_menu_link.click()
14+
for _ in range(3): # Try up to 3 times
15+
if self.main_menu_link.is_visible():
16+
self.main_menu_link.click()
17+
return # Exit if successful
1518

1619
def click_back_link(self):
1720
self.back_link.click()

tests/Smokescreen/my_pages.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
from pages.invitations_monitoring_page import *
1111
from pages.create_a_plan_page import *
1212
from pages.invitations_plans_page import *
13+
from pages.generate_invitations_page import *
1314
from utils.oracle import *

tests/Smokescreen/test_compartment_1.py

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,8 @@ def test_example(page: Page) -> None:
3737
NavigationBar(page).click_main_menu_link()
3838
MainMenu(page).go_to_call_and_recall_page()
3939
CallAndRecall(page).go_to_generate_invitations_page()
40-
page.get_by_role("button", name="Generate Invitations").click()
41-
42-
page.wait_for_selector("#displayRS", timeout=5000)
43-
44-
# Initially, ensure the table contains "Queued"
45-
expect(page.locator("#displayRS")).to_contain_text("Queued")
46-
47-
# Set timeout parameters
48-
timeout = 120000 # Total timeout of 120 seconds (in milliseconds)
49-
wait_interval = 5000 # Wait 5 seconds between refreshes (in milliseconds)
50-
elapsed = 0
51-
52-
# Loop until the table no longer contains "Queued"
53-
while elapsed < timeout:
54-
table_text = page.locator("#displayRS").text_content()
55-
if "Queued" in table_text or "In Progress" in table_text:
56-
# Click the Refresh button
57-
page.get_by_role("button", name="Refresh").click()
58-
page.wait_for_timeout(wait_interval)
59-
elapsed += wait_interval
60-
elif "Failed" in table_text:
61-
pytest.fail("Invitation has failed to generate")
62-
else:
63-
break
64-
65-
# Final check: ensure that the table now contains "Completed"
66-
expect(page.locator("#displayRS")).to_contain_text("Completed")
40+
GenerateInvitations(page).click_generate_invitations_button()
41+
GenerateInvitations(page).wait_for_invitation_generation_complete()
6742

6843
# Print the batch of Pre-Invitation Letters
6944
batch_processing(page, "S1", "Pre-invitation (FIT)", "S9 - Pre-invitation Sent")
@@ -86,16 +61,17 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest
8661
MainMenu(page).go_to_communications_production_page()
8762
CommunicationsProduction(page).go_to_active_batch_list_page()
8863
ActiveBatchList(page).enter_event_code_filter(batch_type)
89-
pre_invitation_cells = page.locator(f"//td[text()='{batch_description}']")
9064

91-
if pre_invitation_cells.count() == 0 and batch_description == "Pre-invitation (FIT) (digital leaflet)":
65+
batch_description_cells = page.locator(f"//td[text()='{batch_description}']")
66+
67+
if batch_description_cells.count() == 0 and batch_description == "Pre-invitation (FIT) (digital leaflet)":
9268
print(f"No S1 Pre-invitation (FIT) (digital leaflet) batch found. Skipping to next step")
9369
return
94-
elif pre_invitation_cells.count() == 0 and page.locator("td", has_text="No matching records found"):
70+
elif batch_description_cells.count() == 0 and page.locator("td", has_text="No matching records found"):
9571
pytest.fail(f"No {batch_type} {batch_description} batch found")
9672

97-
for i in range(pre_invitation_cells.count()):
98-
row = pre_invitation_cells.nth(i).locator("..") # Get the parent row
73+
for i in range(batch_description_cells.count()):
74+
row = batch_description_cells.nth(i).locator("..") # Get the parent row
9975

10076
# Check if the row contains "Prepared" or "Open"
10177
if row.locator("td", has_text="Prepared").count() > 0 or row.locator("td", has_text="Open").count() > 0:
@@ -110,8 +86,9 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest
11086
ManageActiveBatch(page).click_prepare_button()
11187

11288
ManageActiveBatch(page).reprepare_batch_text.wait_for()
113-
retrieve_button_count = 0
89+
11490
# This loops through each Retrieve button and clicks each one
91+
retrieve_button_count = 0
11592
for retrieve_button in range (ManageActiveBatch(page).retrieve_button.count()):
11693
retrieve_button_count += 1
11794
# Start waiting for the pdf download
@@ -126,7 +103,7 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest
126103
nhs_no = pdf_Reader(file)
127104
os.remove(file) # Deletes the file after extracting the necessary data
128105
elif file.endswith(".csv"):
129-
csv_df = csv_Reader(file) # Currently no use in compartment 1, will be necessary for future compartments
106+
# csv_df = csv_Reader(file) # Currently no use in compartment 1, will be necessary for future compartments
130107
os.remove(file) # Deletes the file after extracting the necessary data
131108

132109
# This loops through each Confirm printed button and clicks each one

0 commit comments

Comments
 (0)