|
3 | 3 | # CI groups, which reuse the production build from `e2e-build`. |
4 | 4 | # The job extracts it into apps/sim/.next before running these suites. |
5 | 5 | # |
6 | | -# Usage: http-e2e.sh <scim|cli|stop-after|desktop-inbox|project-files|mobile|seo> (run from apps/sim) |
| 6 | +# Usage: http-e2e.sh <scim|cli|stop-after|desktop-inbox|browser-extension|project-files|mobile|seo> (run from apps/sim) |
7 | 7 | # |
8 | 8 | # The job provides DATABASE_URL, BETTER_AUTH_SECRET and ENCRYPTION_KEY; each group sets the rest of |
9 | 9 | # its app's environment here. Reports and server logs land in $RUNNER_TEMP/e2e. |
|
20 | 20 | # telemetry flush runs detached and still writes .next/dev). |
21 | 21 | set -euo pipefail |
22 | 22 |
|
23 | | -group=${1:?usage: http-e2e.sh <scim|cli|stop-after|desktop-inbox|project-files|mobile|seo>} |
| 23 | +group=${1:?usage: http-e2e.sh <scim|cli|stop-after|desktop-inbox|browser-extension|project-files|mobile|seo>} |
24 | 24 | report_dir="$RUNNER_TEMP/e2e" |
25 | 25 | ready_timeout_seconds=600 |
26 | 26 | mkdir -p "$report_dir" |
@@ -198,7 +198,7 @@ case "$group" in |
198 | 198 | ;; |
199 | 199 |
|
200 | 200 | # The desktop background executor's protocol: device registration, the SSE doorbell over Redis |
201 | | - # pub/sub, presence, leased claims, Stop and isolation. The only group whose app gets Redis. |
| 201 | + # pub/sub, presence, leased claims, Stop and isolation. |
202 | 202 | desktop-inbox) |
203 | 203 | export REDIS_URL=redis://127.0.0.1:6379 |
204 | 204 | export NEXT_PUBLIC_FORCE_HOSTED=false |
@@ -228,6 +228,31 @@ case "$group" in |
228 | 228 | bun --no-env-file scripts/test-organization-search-e2e.ts |
229 | 229 | ;; |
230 | 230 |
|
| 231 | + browser-extension) |
| 232 | + export REDIS_URL=redis://127.0.0.1:6379 |
| 233 | + export NEXT_PUBLIC_FORCE_HOSTED=false |
| 234 | + export KNOWLEDGE_MEMBER_ACCESS=true CREDENTIAL_GROUPS=true ACCESS_CONTROL_ENABLED=true |
| 235 | + export NEXT_PUBLIC_ACCESS_CONTROL_ENABLED=true |
| 236 | + export API_ENCRYPTION_KEY="$ENCRYPTION_KEY" |
| 237 | + bunx --no-install playwright install --with-deps chromium |
| 238 | + extension_identity=$(bun - <<'JS' |
| 239 | + import { generateKeyPairSync, createHash } from 'node:crypto' |
| 240 | + const { publicKey } = generateKeyPairSync('rsa', { modulusLength: 2048 }) |
| 241 | + const der = publicKey.export({ type: 'spki', format: 'der' }) |
| 242 | + const id = [...createHash('sha256').update(der).digest('hex').slice(0, 32)] |
| 243 | + .map(c => String.fromCharCode(97 + parseInt(c, 16))).join('') |
| 244 | + process.stdout.write(`${der.toString('base64')}\n${id}`) |
| 245 | +JS |
| 246 | + ) |
| 247 | + export SIM_EXTENSION_KEY="${extension_identity%%$'\n'*}" |
| 248 | + export BROWSER_EXTENSION_IDS="${extension_identity#*$'\n'}" |
| 249 | + start_app browser-extension 3007 'browser extension' record-http-status |
| 250 | + EXTENSION_APP_E2E_BASE_URL="$local_app_url" \ |
| 251 | + EXTENSION_APP_E2E_DATABASE_URL="$DATABASE_URL" \ |
| 252 | + EXTENSION_APP_E2E_REPORT_PATH="$report_dir/browser-extension/report.json" \ |
| 253 | + bun run test:browser-extension:e2e |
| 254 | + ;; |
| 255 | + |
231 | 256 | project-files) |
232 | 257 | PROJECT_FILES_E2E_ADMIN_DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/postgres \ |
233 | 258 | PROJECT_FILES_E2E_REDIS_URL=redis://127.0.0.1:6379 \ |
|
0 commit comments