This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git


The following commit(s) were added to refs/heads/main by this push:
     new d27a68b  Add a browser test to ensure that hashing checks complete 
successfully
d27a68b is described below

commit d27a68bb6c95436d88c419d95ba6f65b34bcccdf
Author: Sean B. Palmer <[email protected]>
AuthorDate: Mon Apr 14 20:03:31 2025 +0100

    Add a browser test to ensure that hashing checks complete successfully
---
 atr/templates/draft-evaluate.html |  6 +++++-
 playwright/test.py                | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/atr/templates/draft-evaluate.html 
b/atr/templates/draft-evaluate.html
index 36a2c75..5ce3021 100644
--- a/atr/templates/draft-evaluate.html
+++ b/atr/templates/draft-evaluate.html
@@ -106,14 +106,18 @@
                   </td>
                   <td class="atr-sans">
                     <a href="{{ as_url(routes.draft.evaluate_path, 
project_name=project_name, version_name=version_name, rel_path=path) }}"
+                       title="Evaluate file {{ path }}"
                        class="btn btn-sm btn-outline-primary">Evaluate file</a>
                     <a href="{{ as_url(routes.download.phase, 
phase='candidate-draft', project=release.project.name, version=release.version, 
path=path) }}"
+                       title="Download file {{ path }}"
                        class="btn btn-sm btn-outline-secondary 
ms-2">Download</a>
                     <a href="{{ as_url(routes.draft.tools, 
project_name=project_name, version_name=version_name, file_path=path) }}"
+                       title="Tools for file {{ path }}"
                        class="btn btn-sm btn-outline-secondary ms-2">Tools</a>
                     <button class="btn btn-sm btn-outline-danger ms-2"
                             data-bs-toggle="modal"
-                            data-bs-target="#delete-{{ path|slugify }}">Delete 
file</button>
+                            data-bs-target="#delete-{{ path|slugify }}"
+                            title="Delete file {{ path }}">Delete file</button>
                   </td>
                 </tr>
                 {% set file_id = path|string %}
diff --git a/playwright/test.py b/playwright/test.py
index ae511e6..cacfc81 100644
--- a/playwright/test.py
+++ b/playwright/test.py
@@ -259,6 +259,9 @@ def test_all(page: sync_api.Page, credentials: Credentials, 
skip_slow: bool) ->
         test_ssh_01_add_key,
         test_ssh_02_rsync_upload,
     ]
+    tests["checks"] = [
+        test_checks_hashing_01_sha512,
+    ]
 
     # Order between our tests must be preserved
     # Insertion order is reliable since Python 3.6
@@ -267,6 +270,41 @@ def test_all(page: sync_api.Page, credentials: 
Credentials, skip_slow: bool) ->
         run_tests_skipping_slow(tests[key], page, credentials, skip_slow)
 
 
+def test_checks_hashing_01_sha512(page: sync_api.Page, credentials: 
Credentials) -> None:
+    project_name = "tooling-test-example"
+    version_name = "0.2"
+    filename_sha512 = f"apache-{project_name}-{version_name}.tar.gz.sha512"
+    evaluate_page_path = f"/draft/evaluate/{project_name}/{version_name}"
+    evaluate_file_path = f"{evaluate_page_path}/{filename_sha512}"
+
+    logging.info(f"Starting hashing check test for {filename_sha512}")
+
+    logging.info(f"Navigating to evaluate page {evaluate_page_path}")
+    go_to_path(page, evaluate_page_path)
+
+    logging.info(f"Locating 'Evaluate file' link for {filename_sha512}")
+    row_locator = page.locator(f"tr:has(:text('{filename_sha512}'))")
+    evaluate_link_title = f"Evaluate file {filename_sha512}"
+    evaluate_link_locator = 
row_locator.locator(f'a[title="{evaluate_link_title}"]')
+    sync_api.expect(evaluate_link_locator).to_be_visible()
+
+    logging.info(f"Clicking 'Evaluate file' link for {filename_sha512}")
+    evaluate_link_locator.click()
+
+    logging.info(f"Waiting for navigation to {evaluate_file_path}")
+    wait_for_path(page, evaluate_file_path)
+    logging.info(f"Successfully navigated to {evaluate_file_path}")
+
+    logging.info("Verifying Hashing Check status")
+    hashing_check_div_locator = 
page.locator("div.border:has(span.fw-bold:text-is('Hashing Check'))")
+    sync_api.expect(hashing_check_div_locator).to_be_visible()
+    logging.info("Located Hashing Check block")
+
+    passed_badge_locator = 
hashing_check_div_locator.locator("span.badge.bg-success:text-is('Passed')")
+    sync_api.expect(passed_badge_locator).to_be_visible()
+    logging.info("Hashing Check status verified as Passed")
+
+
 def test_lifecycle_01_add_draft(page: sync_api.Page, credentials: Credentials) 
-> None:
     logging.info("Following link to add draft")
     add_draft_link_locator = page.get_by_role("link", name="Add draft")


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to