Integration qr recognition test#3
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end Playwright integration test harness to validate webcam-based QR recognition using a fake camera stream, and wires it into CI along with updated documentation.
Changes:
- Add Playwright config, integration spec, and an HTML harness page to exercise QR scanning via a fake camera stream.
- Add a minimal static HTTP server used by Playwright’s
webServerto serve the repo artifacts during the test run. - Add
@playwright/test, atest:integrationscript, CI workflow execution, and README instructions for running the integration test.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents how to run the new Playwright integration test. |
| playwright/support/static-server.cjs | Adds a local static file server used by Playwright’s webServer. |
| playwright/qr-recognition.integration.spec.js | New Playwright test asserting QR payload decode from the fake camera stream. |
| playwright/fixtures/qr-camera-harness.html | Browser harness page that starts QrScanner and exposes scan state for the test. |
| playwright.config.js | Playwright configuration: fake camera stream flags, webServer, baseURL, permissions. |
| package.json | Adds @playwright/test and test:integration script. |
| .github/workflows/release-branch.yml | Runs build + integration test on push; creates GitHub release on release branch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+21
to
+28
| const requestUrl = new URL(request.url, `http://${request.headers.host}`); | ||
| let filePath = path.normalize(path.join(rootDir, decodeURIComponent(requestUrl.pathname))); | ||
|
|
||
| if (!filePath.startsWith(rootDir)) { | ||
| response.writeHead(403); | ||
| response.end('Forbidden'); | ||
| return; | ||
| } |
|
|
||
| ```batch | ||
| npx playwright install chromium | ||
| npm run test:integration |
Comment on lines
+19
to
+26
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
|
|
Comment on lines
+8
to
+10
| permissions: | ||
| contents: write | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.