Skip to content

test: Add Overview page UI tests#850

Open
emmaaroche wants to merge 1 commit intoKuadrant:mainfrom
emmaaroche:overview-page-ui-tests
Open

test: Add Overview page UI tests#850
emmaaroche wants to merge 1 commit intoKuadrant:mainfrom
emmaaroche:overview-page-ui-tests

Conversation

@emmaaroche
Copy link
Contributor

@emmaaroche emmaaroche commented Jan 22, 2026

Description

Added UI tests for the console plugin Overview page.

UI test issue: #556

Changes

Tests Added

  • test_overview_page_sections_and_links: Verifies the overview page displays main panels (Getting started resources, Gateways, Gateways - Traffic Analysis, Policies, HTTPRoutes) and that the Getting started resources has clickable links
  • test_creation_buttons: Validates creation buttons (Create Gateway, Create HTTPRoute, Create Policy) are clickable and policy dropdown shows available policy types (AuthPolicy, RateLimitPolicy, DNSPolicy, TLSPolicy, and version-specific policies like OIDCPolicy, PlanPolicy, TokenRateLimitPolicy)
  • test_resources_appear_in_sections: Creates Gateway, HTTPRoute, and AuthPolicy programmatically and verifies they appear in their respective sections (Gateways - Traffic Analysis, HTTPRoutes, Policies)
  • test_gateway_section_status: Creates Gateway programmatically, and verifies status metrics update (counts increase and gateway becomes healthy)

Verification steps

These tests requires refactor from: #856 for login flow to work.

Run the new Overview page tests:

poetry run pytest -vv -n4 testsuite/tests/singlecluster/ui/console_plugin/overview/test_overview.py

@emmaaroche emmaaroche self-assigned this Jan 22, 2026
@emmaaroche emmaaroche added the Test case New test case label Jan 22, 2026
@emmaaroche emmaaroche force-pushed the overview-page-ui-tests branch 2 times, most recently from 1cb397f to 265312e Compare January 23, 2026 13:06
@emmaaroche emmaaroche force-pushed the overview-page-ui-tests branch from 265312e to b1ff550 Compare January 26, 2026 12:20
Copy link
Contributor

@averevki averevki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have this PR split into multiple ones. Too much code and changes from multiple areas are hard to review

@emmaaroche emmaaroche force-pushed the overview-page-ui-tests branch from b1ff550 to a90ab47 Compare February 3, 2026 16:23
@emmaaroche emmaaroche changed the title test: Add new Overview page UI tests and update login flow test: Add Overview page UI tests Feb 3, 2026
@emmaaroche emmaaroche force-pushed the overview-page-ui-tests branch from a90ab47 to f0bcd12 Compare February 5, 2026 15:08
Comment on lines +31 to +35
end_time = self.page.evaluate("Date.now()") + timeout
while self.page.evaluate("Date.now()") < end_time:
if self.get_metric_count("Healthy Gateways") >= expected_count:
return
self.page.wait_for_timeout(2000)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backoff

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See also #850 (comment)

Comment on lines +40 to +41
self.page.wait_for_timeout(3000)
return self.page.locator(f"//tr//a[@data-test-id='{gateway_name}']").count() > 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can wait_for_selector page function replace this? Or maybe wait_for_load_state This comment applies to almost all places. I have read this article https://webscrapingsite.com/blog/how-to-wait-for-page-to-fully-load-in-playwright/

Not sure how openshift handles page updates but maybe would be nice to try few page object waiters before resorting to simple sleeps.

assert overview_page.page.get_by_role("menuitem", name="DNSPolicy", exact=True).is_visible()
assert overview_page.page.get_by_role("menuitem", name="TLSPolicy", exact=True).is_visible()

# Check for additional policies (available in OCP 4.20+)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm is it possible to separate this to an extra test? So if we run it on ocp419 it would fail just this part. Then I would add a skip if the ocp version is lower then required to avoid a known fail.

Comment on lines +134 to +138
# Verify unhealthy count increased (gateway starts as unhealthy while provisioning)
new_unhealthy = overview_page.get_metric_count("Unhealthy Gateways")
assert (
new_unhealthy > initial_unhealthy
), f"Unhealthy count did not increase (was {initial_unhealthy}, now {new_unhealthy})"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We expect the Gateway is first is state "unhealthy" but what if it reconciles so quick the ui plugin will only show "healthy"? This could happen on very fast infrastructures.
This can be left as is for now, but maybe in the future or on certain cloud providers this could cause a false negative fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s a fair point! So far I’ve always seen it report Unhealthy, even if just briefly, before becoming Healthy, but I can see how on faster infra that might not always be the case. I will for sure dig into it a bit more in the future, along with some other UI refactoring I want to do 😄

Signed-off-by: emmaaroche <eroche@redhat.com>
@emmaaroche emmaaroche force-pushed the overview-page-ui-tests branch from f0bcd12 to 9579a90 Compare March 3, 2026 12:21
@emmaaroche emmaaroche requested review from averevki and azgabur March 3, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Test case New test case

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants