Skip to content

Commit

Permalink
Initial Commit - Playwright test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eugene-dynamsoft authored and felixindrawan committed Oct 15, 2024
1 parent 6a6a93d commit ccee173
Show file tree
Hide file tree
Showing 11 changed files with 1,287 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Playwright Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
test:
env:
HOME: /root
name: 'Playwright Tests'
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.46.1-jammy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies (clean install)
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm test
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report
retention-days: 30
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,21 @@ The following table is a list of supported browsers based on the above requireme
<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.

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.


## Test Setup

To set up and run the tests for this project, follow these steps:

1. Install the project dependencies:
```
npm install
```

2. Run the tests:
```
npm test
```

This will install all necessary dependencies, including Playwright for end-to-end testing, and then execute the test suite defined in the project.

Loading

0 comments on commit ccee173

Please sign in to comment.