Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wicked-doors-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@asgardeo/react': patch
---

Add E2E tests for @asgardeo/react SDK
183 changes: 183 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# E2E tests for the React SDK using the teamspace-react sample app.

name: 🧪 E2E Tests

on:
pull_request:
branches: [main]
paths:
- 'packages/**'
- 'samples/teamspace-react/**'
- 'e2e/**'
workflow_dispatch:
inputs:
idp_target:
description: 'IDP target (is, thunder, both)'
required: false
default: 'both'

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
e2e-is:
name: 🧪 E2E (WSO2 IS)
if: >-
github.event_name == 'pull_request' ||
github.event.inputs.idp_target == 'is' ||
github.event.inputs.idp_target == 'both'
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
node-version: [lts/*]
pnpm-version: [latest]
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4

- name: 🟢 Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: 🥡 Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ matrix.pnpm-version }}
run_install: false

- name: 🎈 Get pnpm store directory
id: get-pnpm-cache-dir
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: 🔆 Cache pnpm modules
uses: actions/cache@v4
with:
path: ${{ steps.get-pnpm-cache-dir.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: 🧩 Install Dependencies
run: pnpm install --frozen-lockfile

- name: 🏗️ Build SDK packages
run: pnpm build

- name: 🎭 Install Playwright browsers
run: pnpm e2e:install

- name: 🐳 Start WSO2 IS
run: pnpm e2e:docker:up:is

- name: 🧪 Run E2E redirect tests against IS
run: pnpm e2e -- --idp is --mode redirect
env:
CI: true

- name: 🧪 Run E2E embedded tests against IS
run: pnpm e2e -- --idp is --mode embedded
env:
CI: true

- name: 📊 Upload redirect test report
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-is-redirect-report
path: e2e/playwright-report/
retention-days: 14

- name: 📊 Upload embedded test report
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-is-embedded-report
path: e2e/playwright-report-embedded/
retention-days: 14

- name: 🐳 Stop Docker containers
if: always()
run: pnpm e2e:docker:down

e2e-thunder:
name: 🧪 E2E (Thunder)
if: >-
github.event_name == 'pull_request' ||
github.event.inputs.idp_target == 'thunder' ||
github.event.inputs.idp_target == 'both'
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
node-version: [lts/*]
pnpm-version: [latest]
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4

- name: 🟢 Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: 🥡 Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ matrix.pnpm-version }}
run_install: false

- name: 🎈 Get pnpm store directory
id: get-pnpm-cache-dir
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: 🔆 Cache pnpm modules
uses: actions/cache@v4
with:
path: ${{ steps.get-pnpm-cache-dir.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: 🧩 Install Dependencies
run: pnpm install --frozen-lockfile

- name: 🏗️ Build SDK packages
run: pnpm build

- name: 🎭 Install Playwright browsers
run: pnpm e2e:install

- name: 🐳 Start Thunder
run: pnpm e2e:docker:up:thunder

- name: 🧪 Run E2E redirect tests against Thunder
run: pnpm e2e -- --idp thunder --mode redirect
env:
CI: true

- name: 🧪 Run E2E embedded tests against Thunder
run: pnpm e2e -- --idp thunder --mode embedded
env:
CI: true

- name: 📊 Upload redirect test report
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-thunder-redirect-report
path: e2e/playwright-report/
retention-days: 14

- name: 📊 Upload embedded test report
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-thunder-embedded-report
path: e2e/playwright-report-embedded/
retention-days: 14

- name: 🐳 Stop Docker containers
if: always()
run: pnpm e2e:docker:down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ Thumbs.db
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md

# E2E Test artifacts
e2e/.auth/
e2e/test-results/
e2e/playwright-report/
test-results/

# Experimental Samples
# NOTE to Developers: Please use this samples folder for experimental code only and do not commit.
samples/__experimental__/
Expand Down
48 changes: 30 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,55 @@

Follow these simple steps to get started with Asgardeo:

1. Create an account in Asgardeo 👉 [Sign Up](https://asgardeo.io/signup?visitor_id=685a48bc57b3b5.46411343&utm_source=site&utm_medium=organic)
1. Create an account in Asgardeo 👉
[Sign Up](https://asgardeo.io/signup?visitor_id=685a48bc57b3b5.46411343&utm_source=site&utm_medium=organic)

2. Refer to our **Quick Start Guides** and get started in minutes.
- [React Quick Start](https://wso2.com/asgardeo/docs/quick-starts/react/)
- [Next.js Quick Start](https://wso2.com/asgardeo/docs/quick-starts/nextjs/)

- [React Quick Start](https://wso2.com/asgardeo/docs/quick-starts/react/)
- [Next.js Quick Start](https://wso2.com/asgardeo/docs/quick-starts/nextjs/)

## Packages

| Package | Description |
| --- | --- |
| [![@asgardeo/javascript](https://img.shields.io/npm/v/@asgardeo/javascript?color=%234B32C3&label=%40asgardeo%2Fjavascript&logo=javascript)](./packages/javascript/) | Framework-agnostic JavaScript Core SDK |
| [![@asgardeo/browser](https://img.shields.io/npm/v/@asgardeo/browser?color=%234B32C3&label=%40asgardeo%2Fbrowser&logo=firefox)](./packages/browser/) | Browser-based JavaScript SDK |
| [![@asgardeo/nextjs](https://img.shields.io/npm/v/@asgardeo/nextjs?color=%23000000&label=%40asgardeo%2Fnext&logo=next.js)](./packages/next/) | Next.js SDK for building applications with Asgardeo |
| [![@asgardeo/node](https://img.shields.io/npm/v/@asgardeo/node?color=%23339933&label=%40asgardeo%2Fnode&logo=node.js)](./packages/node/) | Node.js SDK for server-side integration |
| [![@asgardeo/express](https://img.shields.io/npm/v/@asgardeo/express?color=%23339933&label=%40asgardeo%2Fexpress&logo=express)](./packages/express/) | Express.js SDK for server-side integration |
| [![@asgardeo/nuxt](https://img.shields.io/npm/v/@asgardeo/nuxt?color=%2300DC82&label=%40asgardeo%2Fnuxt&logo=nuxt)](./packages/nuxt/) | Nuxt.js SDK for building applications with Asgardeo |
| [![@asgardeo/react](https://img.shields.io/npm/v/@asgardeo/react?color=%2361DAFB&label=%40asgardeo%2Freact&logo=react)](./packages/react/) | React SDK for building applications with Asgardeo |
| [![@asgardeo/react-router](https://img.shields.io/npm/v/@asgardeo/react-router?color=%2361DAFB&label=%40asgardeo%2Freact-router&logo=react-router)](./packages/react-router/) | Supplementary React Router bindings |
| [![@asgardeo/vue](https://img.shields.io/npm/v/@asgardeo/vue?color=%234FC08D&label=%40asgardeo%2Fvue&logo=vue.js)](./packages/vue/) | Vue.js SDK for building applications with Asgardeo |
| Package | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| [![@asgardeo/javascript](https://img.shields.io/npm/v/@asgardeo/javascript?color=%234B32C3&label=%40asgardeo%2Fjavascript&logo=javascript)](./packages/javascript/) | Framework-agnostic JavaScript Core SDK |
| [![@asgardeo/browser](https://img.shields.io/npm/v/@asgardeo/browser?color=%234B32C3&label=%40asgardeo%2Fbrowser&logo=firefox)](./packages/browser/) | Browser-based JavaScript SDK |
| [![@asgardeo/nextjs](https://img.shields.io/npm/v/@asgardeo/nextjs?color=%23000000&label=%40asgardeo%2Fnext&logo=next.js)](./packages/next/) | Next.js SDK for building applications with Asgardeo |
| [![@asgardeo/node](https://img.shields.io/npm/v/@asgardeo/node?color=%23339933&label=%40asgardeo%2Fnode&logo=node.js)](./packages/node/) | Node.js SDK for server-side integration |
| [![@asgardeo/express](https://img.shields.io/npm/v/@asgardeo/express?color=%23339933&label=%40asgardeo%2Fexpress&logo=express)](./packages/express/) | Express.js SDK for server-side integration |
| [![@asgardeo/nuxt](https://img.shields.io/npm/v/@asgardeo/nuxt?color=%2300DC82&label=%40asgardeo%2Fnuxt&logo=nuxt)](./packages/nuxt/) | Nuxt.js SDK for building applications with Asgardeo |
| [![@asgardeo/react](https://img.shields.io/npm/v/@asgardeo/react?color=%2361DAFB&label=%40asgardeo%2Freact&logo=react)](./packages/react/) | React SDK for building applications with Asgardeo |
| [![@asgardeo/react-router](https://img.shields.io/npm/v/@asgardeo/react-router?color=%2361DAFB&label=%40asgardeo%2Freact-router&logo=react-router)](./packages/react-router/) | Supplementary React Router bindings |
| [![@asgardeo/vue](https://img.shields.io/npm/v/@asgardeo/vue?color=%234FC08D&label=%40asgardeo%2Fvue&logo=vue.js)](./packages/vue/) | Vue.js SDK for building applications with Asgardeo |

## E2E Tests

Run End-to-end tests using Playwright. See the [E2E Test Guide](./e2e/README.md) for setup instructions and usage.

## Contribute

Please read [Contributing Guide](CONTRIBUTING.md) for details on how to contribute to Asgardeo JavaScript SDKs. Refer to [General Contribution Guidelines](http://wso2.github.io/) for details on our code of conduct, and the process for submitting pull requests to us.
Please read [Contributing Guide](CONTRIBUTING.md) for details on how to contribute to Asgardeo JavaScript SDKs. Refer to
[General Contribution Guidelines](http://wso2.github.io/) for details on our code of conduct, and the process for
submitting pull requests to us.

### Contributors ❤️

Hats off to all the people who have contributed to this project, including those who created issues and participated in discussions. 🙌
Hats off to all the people who have contributed to this project, including those who created issues and participated in
discussions. 🙌

<a href="https://github.com/asgardeo/javascript/graphs/contributors">
<img src="https://contrib.rocks/image?repo=asgardeo/javascript" />
</a>

### Reporting issues

We encourage you to report issues, improvements, and feature requests creating [Github Issues](https://github.com/asgardeo/javascript/issues).
We encourage you to report issues, improvements, and feature requests creating
[Github Issues](https://github.com/asgardeo/javascript/issues).

**Important**: Please be advised that security issues MUST be reported to <a href="mailto:security@wso2.com">security@wso2.com</a>, not as GitHub issues, in order to reach the proper audience. We strongly advise following the WSO2 Security Vulnerability Reporting Guidelines when reporting the security issues.
**Important**: Please be advised that security issues MUST be reported to
<a href="mailto:security@wso2.com">security@wso2.com</a>, not as GitHub issues, in order to reach the proper audience.
We strongly advise following the WSO2 Security Vulnerability Reporting Guidelines when reporting the security issues.

## License

Expand Down
Loading
Loading