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-releases.git
The following commit(s) were added to refs/heads/main by this push:
new b9e2799 Add tests for the script on the committees page
b9e2799 is described below
commit b9e279967fde1a6ad29e000b9f9f447e9ea17fac
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Dec 11 19:24:22 2025 +0000
Add tests for the script on the committees page
---
tests/e2e/committees/__init__.py | 16 +++++++
tests/e2e/committees/conftest.py | 52 +++++++++++++++++++++
tests/e2e/committees/test_get.py | 97 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 165 insertions(+)
diff --git a/tests/e2e/committees/__init__.py b/tests/e2e/committees/__init__.py
new file mode 100644
index 0000000..13a8339
--- /dev/null
+++ b/tests/e2e/committees/__init__.py
@@ -0,0 +1,16 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
diff --git a/tests/e2e/committees/conftest.py b/tests/e2e/committees/conftest.py
new file mode 100644
index 0000000..cde6c02
--- /dev/null
+++ b/tests/e2e/committees/conftest.py
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Final
+
+import e2e.helpers as helpers # type: ignore[reportMissingImports]
+import pytest
+
+if TYPE_CHECKING:
+ from collections.abc import Generator
+
+ from playwright.sync_api import Browser, BrowserContext, Page
+
+COMMITTEES_URL: Final[str] = "/committees"
+
+
[email protected](scope="module")
+def committees_context(browser: Browser) -> Generator[BrowserContext]:
+ """Create a browser context with an authenticated user."""
+ context = browser.new_context(ignore_https_errors=True)
+ page = context.new_page()
+ helpers.log_in(page)
+ page.close()
+
+ yield context
+
+ context.close()
+
+
[email protected]
+def page_committees(committees_context: BrowserContext) -> Generator[Page]:
+ """Navigate to the committees page with a fresh page for each test."""
+ page = committees_context.new_page()
+ helpers.visit(page, COMMITTEES_URL)
+ yield page
+ page.close()
diff --git a/tests/e2e/committees/test_get.py b/tests/e2e/committees/test_get.py
new file mode 100644
index 0000000..2ab80ed
--- /dev/null
+++ b/tests/e2e/committees/test_get.py
@@ -0,0 +1,97 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from playwright.sync_api import Page, expect
+
+
+def test_filter_button_filters_committees(page_committees: Page) -> None:
+ """Clicking filter button should filter committees by text input."""
+ filter_input = page_committees.locator("#project-filter")
+ filter_button = page_committees.locator("#filter-button")
+
+ filter_input.fill("test")
+ filter_button.click()
+
+ count_span = page_committees.locator("#committee-count")
+ expect(count_span).not_to_have_text("0")
+
+
+def test_filter_clears_participant_mode(page_committees: Page) -> None:
+ """Using text filter should reset to all committees mode."""
+ participant_button = page_committees.locator("#filter-participant-button")
+ filter_input = page_committees.locator("#project-filter")
+ filter_button = page_committees.locator("#filter-button")
+
+ expect(participant_button).to_have_text("Show all committees")
+
+ filter_input.fill("a")
+ filter_button.click()
+
+ expect(participant_button).to_have_text("Show my committees")
+
+
+def test_filter_enter_key_triggers_filter(page_committees: Page) -> None:
+ """Pressing Enter in filter input should trigger filtering."""
+ filter_input = page_committees.locator("#project-filter")
+ initial_count = page_committees.locator("#committee-count").text_content()
+
+ filter_input.fill("nosuchcommittee")
+ filter_input.press("Enter")
+
+ count_span = page_committees.locator("#committee-count")
+ expect(count_span).not_to_have_text(initial_count or "")
+
+
+def test_filter_updates_committee_count(page_committees: Page) -> None:
+ """Filtering should update the displayed committee count."""
+ filter_input = page_committees.locator("#project-filter")
+ filter_button = page_committees.locator("#filter-button")
+ count_span = page_committees.locator("#committee-count")
+
+ initial_count = count_span.text_content()
+
+ filter_input.fill("nosuchcommittee")
+ filter_button.click()
+
+ expect(count_span).to_have_text("0")
+ expect(count_span).not_to_have_text(initial_count or "")
+
+
+def test_participant_button_toggles_text(page_committees: Page) -> None:
+ """Clicking participant button should toggle the button text."""
+ participant_button = page_committees.locator("#filter-participant-button")
+
+ expect(participant_button).to_have_text("Show all committees")
+
+ participant_button.click()
+
+ expect(participant_button).to_have_text("Show my committees")
+
+
+def test_participant_button_toggles_aria_pressed(page_committees: Page) ->
None:
+ """Clicking participant button should toggle aria pressed state."""
+ participant_button = page_committees.locator("#filter-participant-button")
+
+ expect(participant_button).to_have_attribute("aria-pressed", "true")
+
+ participant_button.click()
+
+ expect(participant_button).to_have_attribute("aria-pressed", "false")
+
+ participant_button.click()
+
+ expect(participant_button).to_have_attribute("aria-pressed", "true")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]