Skip to content

Commit ccee173

Browse files
eugene-dynamsoftfelixindrawan
authored andcommitted
Initial Commit - Playwright test
Updated license test to ensure demo license is used. Added yml file for github action Change playwright config back to headless and added test setup in the README. Configure playwright test to be executed on github Adding scan mode button selection UI Test to MRZ Scanner Use fake media stream for github action test Do not fail the test if the license warning dialog does not display, just print an error log Commented out manually mock the camera script remove the waitfor visible for the license warning dialog Removing grantCameraPermission scrpit, added extra timeout to wait for dom content to be loaded Added debug log to see the status of indexedDB during github action firefox execution Try out not using headless for firefox Update userAgent string to use firefox v130 Added extra long timeout after clicked on start button to ensure firefox loads all relevant objects Removing extra wait, removing the grantPermission script as it only produced warning log. Added a new firefoxuserpref value "datareporting.policy.firstRunURL": "" use clean install for github action and added root location for github firefox issue. Changed chrome project to use real camera instead of fake. Added container image and remove master branch from triggering the github action attempt to fix the Error: Failed to open indexedDB: Timeout. issue by granting permission to indexedDB for firefox. revert the changes for granting chrome indexedDB permission. Update firefox to headless Adding fake video file as fake video capture input and use it in chrome. Cleaned up and use a 2D QR Code video as fake stream. Added manual trigger for playwright github action
1 parent 6a6a93d commit ccee173

File tree

11 files changed

+1287
-0
lines changed

11 files changed

+1287
-0
lines changed

.github/workflows/playwright.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
jobs:
11+
test:
12+
env:
13+
HOME: /root
14+
name: 'Playwright Tests'
15+
runs-on: ubuntu-latest
16+
container:
17+
image: mcr.microsoft.com/playwright:v1.46.1-jammy
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: lts/*
23+
- name: Install dependencies (clean install)
24+
run: npm ci
25+
- name: Install Playwright Browsers
26+
run: npx playwright install --with-deps
27+
- name: Run Playwright tests
28+
run: npm test
29+
- name: Upload test results
30+
uses: actions/upload-artifact@v4
31+
if: always()
32+
with:
33+
name: playwright-report
34+
path: playwright-report
35+
retention-days: 30

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
/test-results/
3+
/playwright-report/
4+
/blob-report/
5+
/playwright/.cache/

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,21 @@ The following table is a list of supported browsers based on the above requireme
103103
<sup>1</sup> devices running iOS needs to be on iOS 14.3+ for camera video streaming to work in Chrome, Firefox or other Apps using webviews.
104104

105105
Apart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.
106+
107+
108+
## Test Setup
109+
110+
To set up and run the tests for this project, follow these steps:
111+
112+
1. Install the project dependencies:
113+
```
114+
npm install
115+
```
116+
117+
2. Run the tests:
118+
```
119+
npm test
120+
```
121+
122+
This will install all necessary dependencies, including Playwright for end-to-end testing, and then execute the test suite defined in the project.
123+

0 commit comments

Comments
 (0)