-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Description
Summary
Add end-to-end tests for the @asgardeo/react SDK covering both redirect-based OAuth and embedded <SignIn /> component sign-in flows, running against two identity providers.
What's Included
Identity Providers
- WSO2 Identity Server (
wso2/wso2is:7.2.0) — full OIDC provider with DCR, SCIM2, and logout consent - Asgardeo Thunder - AsgardeoV2` platform
Test Coverage
| Test | IS | Thunder |
|---|---|---|
| Redirect to IDP login page | Yes | Yes |
| Sign in with valid credentials (redirect) | Yes | Yes |
| Redirect unauthenticated users to IDP | Yes | Yes |
| Sign out and redirect to landing page | Yes | — |
| Block protected routes after sign out | Yes | — |
Render embedded <SignIn /> component |
Yes | Yes |
| Sign in via embedded component | Yes | Yes |
| Display user profile | Yes | Yes |
| Navigate back from profile | Yes | Yes |
Infrastructure
- Docker Compose setup for both IDPs with health checks
- Automated IDP setup: app registration (DCR/management API), test user provisioning (SCIM2)
- Unified test runner script (
pnpm e2e -- --idp is|thunder|all --mode redirect|embedded|all --headed) - Separate Playwright configs for redirect and embedded modes (Vite bakes env vars at build time)
SDK Fixes
- Fix
AsgardeoProviderV2 race condition: loading poll could setisLoadingSync=falsebefore token exchange completes, causingProtectedRouteto redirect prematurely. Added auth-params guard to prevent this.
Sample App Improvements
- Remove
VITE_ASGARDEO_SIGN_IN_MODEcustom env var —SignInPagenow usessignInUrlfrom SDK context to determine redirect vs embedded mode (consistent withSignInButtonbehavior) - Remove
CallbackPageworkaround (no longer needed after SDK fix) - Remove test-only
EmbeddedSignInPage
Test Structure
e2e/
├── tests/{is,thunder}/redirect/ # Redirect-based OAuth tests
├── tests/{is,thunder}/embedded/ # Embedded <SignIn /> component tests
├── setup/{is,thunder}/ # IDP-specific setup (app registration, user provisioning)
├── helpers/{is,thunder}/ # IDP-specific selectors and auth helpers
├── playwright.redirect.config.ts # Playwright config for redirect tests
├── playwright.embedded.config.ts # Playwright config for embedded tests
└── scripts/run-e2e.sh # Unified test runner
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels