Skip to content

Test/word api test#446

Open
MaryChen68 wants to merge 5 commits into
mainfrom
test/wordAPI-test
Open

Test/word api test#446
MaryChen68 wants to merge 5 commits into
mainfrom
test/wordAPI-test

Conversation

@MaryChen68

Copy link
Copy Markdown
Contributor

E2E tests run only in the browser demo editor (not Office.js). A mock Office/Word global covers three things:

  • getDocContext reads surrounding text and replaces \r with \n; throws on error
  • selectPhrase selects the first match; throws "Phrase not found" if missing
  • Selection change listeners are correctly registered and unregistered

Comment on lines +27 to +41
name: Unit tests (Vitest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm test

e2e:
Comment on lines +42 to +66
name: E2E tests (Playwright)
timeout-minutes: 60
runs-on: ubuntu-latest
# Pinned to match the installed @playwright/test version (1.60.0); bump both
# together so the committed visual snapshots keep matching.
container:
image: mcr.microsoft.com/playwright:v1.60.0-noble
options: --user 1001
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Build Frontend
run: npm run build
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: playwright-report
path: frontend/playwright-report/
retention-days: 30
@kcarnold

kcarnold commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

How does this relate to #444 that also changes some of the same GitHub Actions files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants