|
| 1 | +# E2E tests for the React SDK using the teamspace-react sample app. |
| 2 | + |
| 3 | +name: 🧪 E2E Tests |
| 4 | + |
| 5 | +on: |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + paths: |
| 9 | + - 'packages/**' |
| 10 | + - 'samples/teamspace-react/**' |
| 11 | + - 'e2e/**' |
| 12 | + workflow_dispatch: |
| 13 | + inputs: |
| 14 | + idp_target: |
| 15 | + description: 'IDP target (is, thunder, both)' |
| 16 | + required: false |
| 17 | + default: 'both' |
| 18 | + |
| 19 | +env: |
| 20 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 21 | + |
| 22 | +jobs: |
| 23 | + e2e-is: |
| 24 | + name: 🧪 E2E (WSO2 IS) |
| 25 | + if: >- |
| 26 | + github.event_name == 'pull_request' || |
| 27 | + github.event.inputs.idp_target == 'is' || |
| 28 | + github.event.inputs.idp_target == 'both' |
| 29 | + runs-on: ubuntu-latest |
| 30 | + timeout-minutes: 30 |
| 31 | + strategy: |
| 32 | + matrix: |
| 33 | + node-version: [lts/*] |
| 34 | + pnpm-version: [latest] |
| 35 | + steps: |
| 36 | + - name: ⬇️ Checkout |
| 37 | + uses: actions/checkout@v4 |
| 38 | + |
| 39 | + - name: 🟢 Setup node |
| 40 | + uses: actions/setup-node@v4 |
| 41 | + with: |
| 42 | + node-version: ${{ matrix.node-version }} |
| 43 | + |
| 44 | + - name: 🥡 Setup pnpm |
| 45 | + uses: pnpm/action-setup@v4 |
| 46 | + with: |
| 47 | + version: ${{ matrix.pnpm-version }} |
| 48 | + run_install: false |
| 49 | + |
| 50 | + - name: 🎈 Get pnpm store directory |
| 51 | + id: get-pnpm-cache-dir |
| 52 | + run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT |
| 53 | + |
| 54 | + - name: 🔆 Cache pnpm modules |
| 55 | + uses: actions/cache@v4 |
| 56 | + with: |
| 57 | + path: ${{ steps.get-pnpm-cache-dir.outputs.pnpm_cache_dir }} |
| 58 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 59 | + restore-keys: | |
| 60 | + ${{ runner.os }}-pnpm-store- |
| 61 | +
|
| 62 | + - name: 🧩 Install Dependencies |
| 63 | + run: pnpm install --frozen-lockfile |
| 64 | + |
| 65 | + - name: 🏗️ Build SDK packages |
| 66 | + run: pnpm build |
| 67 | + |
| 68 | + - name: 🎭 Install Playwright browsers |
| 69 | + run: pnpm e2e:install |
| 70 | + |
| 71 | + - name: 🐳 Start WSO2 IS |
| 72 | + run: pnpm e2e:docker:up:is |
| 73 | + |
| 74 | + - name: 🧪 Run E2E redirect tests against IS |
| 75 | + run: pnpm e2e -- --idp is --mode redirect |
| 76 | + env: |
| 77 | + CI: true |
| 78 | + |
| 79 | + - name: 🧪 Run E2E embedded tests against IS |
| 80 | + run: pnpm e2e -- --idp is --mode embedded |
| 81 | + env: |
| 82 | + CI: true |
| 83 | + |
| 84 | + - name: 📊 Upload redirect test report |
| 85 | + uses: actions/upload-artifact@v4 |
| 86 | + if: always() |
| 87 | + with: |
| 88 | + name: e2e-is-redirect-report |
| 89 | + path: e2e/playwright-report/ |
| 90 | + retention-days: 14 |
| 91 | + |
| 92 | + - name: 📊 Upload embedded test report |
| 93 | + uses: actions/upload-artifact@v4 |
| 94 | + if: always() |
| 95 | + with: |
| 96 | + name: e2e-is-embedded-report |
| 97 | + path: e2e/playwright-report-embedded/ |
| 98 | + retention-days: 14 |
| 99 | + |
| 100 | + - name: 🐳 Stop Docker containers |
| 101 | + if: always() |
| 102 | + run: pnpm e2e:docker:down |
| 103 | + |
| 104 | + e2e-thunder: |
| 105 | + name: 🧪 E2E (Thunder) |
| 106 | + if: >- |
| 107 | + github.event_name == 'pull_request' || |
| 108 | + github.event.inputs.idp_target == 'thunder' || |
| 109 | + github.event.inputs.idp_target == 'both' |
| 110 | + runs-on: ubuntu-latest |
| 111 | + timeout-minutes: 20 |
| 112 | + strategy: |
| 113 | + matrix: |
| 114 | + node-version: [lts/*] |
| 115 | + pnpm-version: [latest] |
| 116 | + steps: |
| 117 | + - name: ⬇️ Checkout |
| 118 | + uses: actions/checkout@v4 |
| 119 | + |
| 120 | + - name: 🟢 Setup node |
| 121 | + uses: actions/setup-node@v4 |
| 122 | + with: |
| 123 | + node-version: ${{ matrix.node-version }} |
| 124 | + |
| 125 | + - name: 🥡 Setup pnpm |
| 126 | + uses: pnpm/action-setup@v4 |
| 127 | + with: |
| 128 | + version: ${{ matrix.pnpm-version }} |
| 129 | + run_install: false |
| 130 | + |
| 131 | + - name: 🎈 Get pnpm store directory |
| 132 | + id: get-pnpm-cache-dir |
| 133 | + run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT |
| 134 | + |
| 135 | + - name: 🔆 Cache pnpm modules |
| 136 | + uses: actions/cache@v4 |
| 137 | + with: |
| 138 | + path: ${{ steps.get-pnpm-cache-dir.outputs.pnpm_cache_dir }} |
| 139 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 140 | + restore-keys: | |
| 141 | + ${{ runner.os }}-pnpm-store- |
| 142 | +
|
| 143 | + - name: 🧩 Install Dependencies |
| 144 | + run: pnpm install --frozen-lockfile |
| 145 | + |
| 146 | + - name: 🏗️ Build SDK packages |
| 147 | + run: pnpm build |
| 148 | + |
| 149 | + - name: 🎭 Install Playwright browsers |
| 150 | + run: pnpm e2e:install |
| 151 | + |
| 152 | + - name: 🐳 Start Thunder |
| 153 | + run: pnpm e2e:docker:up:thunder |
| 154 | + |
| 155 | + - name: 🧪 Run E2E redirect tests against Thunder |
| 156 | + run: pnpm e2e -- --idp thunder --mode redirect |
| 157 | + env: |
| 158 | + CI: true |
| 159 | + |
| 160 | + - name: 🧪 Run E2E embedded tests against Thunder |
| 161 | + run: pnpm e2e -- --idp thunder --mode embedded |
| 162 | + env: |
| 163 | + CI: true |
| 164 | + |
| 165 | + - name: 📊 Upload redirect test report |
| 166 | + uses: actions/upload-artifact@v4 |
| 167 | + if: always() |
| 168 | + with: |
| 169 | + name: e2e-thunder-redirect-report |
| 170 | + path: e2e/playwright-report/ |
| 171 | + retention-days: 14 |
| 172 | + |
| 173 | + - name: 📊 Upload embedded test report |
| 174 | + uses: actions/upload-artifact@v4 |
| 175 | + if: always() |
| 176 | + with: |
| 177 | + name: e2e-thunder-embedded-report |
| 178 | + path: e2e/playwright-report-embedded/ |
| 179 | + retention-days: 14 |
| 180 | + |
| 181 | + - name: 🐳 Stop Docker containers |
| 182 | + if: always() |
| 183 | + run: pnpm e2e:docker:down |
0 commit comments