Conversation
1cb397f to
265312e
Compare
265312e to
b1ff550
Compare
averevki
left a comment
There was a problem hiding this comment.
Would be nice to have this PR split into multiple ones. Too much code and changes from multiple areas are hard to review
testsuite/tests/singlecluster/ui/console_plugin/overview/test_overview.py
Outdated
Show resolved
Hide resolved
b1ff550 to
a90ab47
Compare
a90ab47 to
f0bcd12
Compare
| 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) |
| self.page.wait_for_timeout(3000) | ||
| return self.page.locator(f"//tr//a[@data-test-id='{gateway_name}']").count() > 0 |
There was a problem hiding this comment.
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+) |
There was a problem hiding this comment.
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.
| # 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})" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
f0bcd12 to
9579a90
Compare
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 linkstest_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: