From ca0739c57fb6cbe1e16cd85bb7f8e9b47c232fcf Mon Sep 17 00:00:00 2001 From: Alan Buscaglia Date: Tue, 30 Jun 2026 16:26:47 +0200 Subject: [PATCH] test(ui): run provider connection check, verify add from providers page --- ui/tests/providers/providers-page.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/ui/tests/providers/providers-page.ts b/ui/tests/providers/providers-page.ts index 8e491ad0f1..778d5d6f93 100644 --- a/ui/tests/providers/providers-page.ts +++ b/ui/tests/providers/providers-page.ts @@ -993,19 +993,21 @@ export class ProvidersPage extends BasePage { return; } - // Provider-add E2E validates credential persistence only. Reaching the - // connection step is enough; do not click "Continue"/"Check connection" - // because that performs provider-specific connectivity checks covered by - // dedicated scan/connection flows and can hang on external services. - const reachedNoScanState = - (await testConnectionButton.isVisible().catch(() => false)) || - (await launchStepReady.isVisible().catch(() => false)) || - (await this.wizardModal.isHidden().catch(() => false)); + // Execute the connection step so the flow exercises provider connectivity, + // not just credential entry. The connection is NOT required to succeed: + // external provider connectivity (e.g. Okta) can time out in E2E, and a + // failed/timed-out connection does not undo provider creation. The scan is + // not launched here (covered by scans.spec.ts); the provider's presence on + // the Providers page is the source of truth and is verified below. + if (await testConnectionButton.isVisible().catch(() => false)) { + await testConnectionButton.click(); - if (!reachedNoScanState) { - throw new Error( - "Provider no-scan flow did not reach the connection or launch step.", - ); + // Let the connection check settle (success, error, or wizard close). + await Promise.race([ + launchStepReady.waitFor({ state: "visible", timeout }).catch(() => {}), + this.wizardModal.waitFor({ state: "hidden", timeout }).catch(() => {}), + connectionError.waitFor({ state: "visible", timeout }).catch(() => {}), + ]); } if (await this.wizardModal.isVisible().catch(() => false)) {