This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch sbp
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/sbp by this push:
new 717b82f2 Fix some e2e tests related to Trusted Publishing and RAT
checks
717b82f2 is described below
commit 717b82f2c4f83a9049c8ebac292dc1079a947a34
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Mar 20 16:11:17 2026 +0000
Fix some e2e tests related to Trusted Publishing and RAT checks
---
tests/e2e/policy/conftest.py | 4 ++++
tests/e2e/report/test_get.py | 42 ++++++++++++++++++++++--------------------
2 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/tests/e2e/policy/conftest.py b/tests/e2e/policy/conftest.py
index e3cc5b67..f8f67977 100644
--- a/tests/e2e/policy/conftest.py
+++ b/tests/e2e/policy/conftest.py
@@ -42,6 +42,10 @@ def _clear_policy_excludes(page: Page) -> None:
helpers.visit(page, policy_helpers.PROJECT_URL)
policy_helpers.textarea_source_excludes_lightweight(page).fill("")
policy_helpers.textarea_source_excludes_rat(page).fill("")
+ policy_helpers.compose_form_save_button(page).click()
+ page.wait_for_load_state()
+
+ helpers.visit(page, policy_helpers.PROJECT_URL)
policy_helpers.input_github_repository_name(page).fill("")
policy_helpers.input_github_repository_branch(page).fill("")
policy_helpers.textarea_github_compose_workflow_path(page).fill("")
diff --git a/tests/e2e/report/test_get.py b/tests/e2e/report/test_get.py
index 14ef7db8..d33e75cc 100644
--- a/tests/e2e/report/test_get.py
+++ b/tests/e2e/report/test_get.py
@@ -121,27 +121,29 @@ def test_primary_toggle_button_text_changes(
expect(btn_span).to_have_text("Hide")
-def test_row_striping_updates_after_filter(
- page_report: Page,
- member_rows: Locator,
- member_filter_input: Locator,
-) -> None:
+def test_row_striping_updates_after_filter(page_report: Page) -> None:
"""Row striping should update when filtering member results."""
- if member_rows.count() < 2:
- # There's only one .py file in the test .tar.gz
- pytest.skip("Need at least 2 member rows for striping test")
-
- first_visible =
page_report.locator(".atr-result-member:not(.page-member-path-hide):not(.atr-hide)").first
- first_path = first_visible.locator("td").first.text_content()
- if not first_path:
- pytest.fail("First visible row has no path text")
-
- member_filter_input.fill(first_path)
-
- filtered_visible =
page_report.locator(".atr-result-member:not(.page-member-path-hide):not(.atr-hide)")
- if filtered_visible.count() == 0:
- pytest.fail("No visible rows after filtering")
-
expect(filtered_visible.first).to_have_class(re.compile(r"page-member-visible-odd"))
+ page_report.evaluate("""() => {
+ const tbody =
document.querySelector('.atr-result-member').closest('tbody');
+ for (const path of ['synth/alpha.py', 'synth/beta.py',
'synth/gamma.py']) {
+ const tr = document.createElement('tr');
+ tr.className = 'atr-result-member atr-result-status-success';
+ const td = document.createElement('td');
+ td.textContent = path;
+ tr.appendChild(td);
+ tbody.appendChild(tr);
+ }
+ updateMemberStriping();
+ }""")
+
+ synth_rows =
page_report.locator(".atr-result-member").filter(has_text="synth/")
+ expect(synth_rows).to_have_count(3)
+
+ page_report.locator("#member-path-filter").fill("synth/alpha")
+
+ visible =
page_report.locator(".atr-result-member:not(.page-member-path-hide):not(.atr-hide)")
+ expect(visible).to_have_count(1)
+ expect(visible.first).to_have_class(re.compile(r"page-member-visible-odd"))
def test_toggle_all_details_button_visible(page_report: Page) -> None:
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]