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
55 changes: 36 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
tags:
- 'v*'
- "v*"
pull_request:
branches:
- main
Expand All @@ -20,8 +20,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
node-version: "lts/*"
cache: "npm"

- name: Install dependencies
run: npm ci
Expand All @@ -38,8 +38,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24.15.0'
cache: 'npm'
node-version: "24.15.0"
cache: "npm"

- name: Install dependencies
run: npm ci
Expand All @@ -49,16 +49,33 @@ jobs:
timeout-minutes: 5

- name: Test
run: npm run test
run: |
npx tsc -p tsconfig.test.json
npm run build:test-react-bundle
npx wtr

edge-integration:
runs-on: windows-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
name: coverage-report
path: coverage
if-no-files-found: ignore
retention-days: 1
node-version: "24.15.0"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Run Edge integration test
env:
EMBEDDED_WEB_TEST_BROWSERS: chromium
EMBEDDED_WEB_CHROMIUM_CHANNEL: msedge
run: |
npx tsc -p tsconfig.test.json
npx wtr .tmp/test-dist/test/corti-embedded.integration.test.js

build:
runs-on: ubuntu-latest
Expand All @@ -69,8 +86,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
node-version: "lts/*"
cache: "npm"

- name: Install dependencies
run: npm ci
Expand All @@ -79,7 +96,7 @@ jobs:
run: npm run prerelease

publish:
needs: [typecheck, test, build]
needs: [typecheck, test, edge-integration, build]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
Expand All @@ -92,9 +109,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
node-version: "lts/*"
cache: "npm"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci
Expand Down
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,48 @@ A web component and React component library that provides an embedded interface
npm install @corti/embedded-web
```

## Testing

Install dependencies before running tests:

```bash
npm install
```

Run the full test suite:

```bash
npm test
```

Run tests in watch mode while developing:

```bash
npm run test:watch
```

Run only the embedded component communication integration test:

```bash
npx tsc -p tsconfig.test.json && npx wtr .tmp/test-dist/test/corti-embedded.integration.test.js
```

Run the integration test across Chromium, Firefox, and WebKit:

```bash
npx tsc -p tsconfig.test.json && EMBEDDED_WEB_TEST_BROWSERS=chromium,firefox,webkit npx wtr .tmp/test-dist/test/corti-embedded.integration.test.js
```

Run the integration test against an installed Microsoft Edge channel:

```bash
npx tsc -p tsconfig.test.json && EMBEDDED_WEB_TEST_BROWSERS=chromium EMBEDDED_WEB_CHROMIUM_CHANNEL=msedge npx wtr .tmp/test-dist/test/corti-embedded.integration.test.js
```

The integration test runs in Playwright Chromium by default and can be expanded to Firefox, WebKit, or an installed Edge channel. It validates the public web component API against a real iframe `postMessage` boundary and uses the local test runner setup, so it does not require access to the live embedded Assistant service.

Pull requests also run the integration test against Microsoft Edge on a Windows GitHub Actions runner.

## Usage

### Web Component
Expand Down
Loading
Loading