chore(UITest): ability to auto backend redirect - WPB-28604 - #5230
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Two moderate unresolved findings affect backend URL configuration and cleanup error handling.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds an end-to-end UI test for on-premises login redirection, with page-model helpers and BackOffice domain management APIs.
Changes:
- Adds staging domain setup, polling, and cleanup.
- Adds redirect navigation and backend URL verification.
- Improves proceed-button interaction reliability.
File summaries
| File | Summary |
|---|---|
wire-ios/WireUITests/Pages/WelcomePage.swift |
Adds domain-based backend switching navigation. |
wire-ios/WireUITests/Pages/SetCustomBackendPage.swift |
Adds backend URL lookup and reliable tap handling. |
wire-ios/WireUITests/OnPremLoginRedirectTests.swift |
Adds the redirect test. Moderate (2 votes): uses the REST API base instead of the environment-provided deeplink/config URL. Moderate (1 vote): cleanup DELETE failures are discarded. |
wire-ios/WireUITests/Helper/BackOffice.swift |
Adds domain configuration, polling, and deletion APIs. |
Review details
Suppressed comments (1)
wire-ios/WireUITests/OnPremLoginRedirectTests.swift:31
- operational_implications: These are the only cleanup calls for the shared staging domain, but both errors are discarded. A transient DELETE failure can leave the claimed domain and custom-backend entry in staging without failing or reporting the test, accumulating state across runs; surface the cleanup failure while still attempting both deletes instead of silently swallowing it.
try? await backOffice.deleteCustomBackendDomain(claimedDomain, basicAuth: UserHelper.default.basicAuth())
try? await backOffice.deleteDomainClaim(claimedDomain, basicAuth: UserHelper.default.basicAuth())
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Test Results1 952 tests 1 925 ✅ 2m 26s ⏱️ Results for commit 04fe675. ♻️ This comment has been updated with latest results. Summary: workflow run #35078019257 |
There was a problem hiding this comment.
🔵 Needs a closer look
Address the cleanup failure handling and confirmation-tap result before approval.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
wire-ios/WireUITests/OnPremLoginRedirectTests.swift:31
- These
try?calls hide cleanup failures. If a staging deletion fails transiently, the test can still pass while leaving the claimed domain and custom-backend record in the shared environment; please make teardown surface/aggregate cleanup errors and/or retry so test-created state cannot be silently leaked.
wire-ios/WireUITests/Pages/SetCustomBackendPage.swift:31
- The new method uses
Urlin its name, while the surrounding test API consistently spells this acronym asURL(backendURL(for:)in EnvironmentVariables.swift:269 andtargetBackendURLin OnPremLoginRedirectTests.swift:44). Rename it tobackendURLValueand update the call site for a consistent page-model API.
func backendUrlValue(containing url: URL) -> XCUIElement {
wire-ios/WireUITests/Pages/SetCustomBackendPage.swift:38
waitAndTap()returnsfalsewhen the button never becomes hittable, but that result is ignored here. The method can therefore return aWelcomePagewhile the confirmation sheet is still presented, allowing callers to continue as if the redirect was confirmed; guard the result and throw before constructing the next page.
proceedButton.waitAndTap()
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
Issue
Please describe the issue.
Optional: add details about technical approach, solutions etc.
Optional: reference dependencies to other pull requests etc.
UITest - able to auto backend redirect
Testing
Describe how to test.
Optional: attachments like images, videos, etc.
auto-redirect.mp4
Checklist
[WPB-XXX].UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: