Skip to content

Commit 7c38338

Browse files
Updated license test to ensure demo license is used. Added yml file for github action
1 parent fcace57 commit 7c38338

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

.github/workflows/playwright.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: lts/*
16+
- name: Install dependencies
17+
run: npm i
18+
- name: Install Playwright Browsers
19+
run: npx playwright install --with-deps
20+
- name: Run Playwright tests
21+
run: npm test
22+
- uses: actions/upload-artifact@v4
23+
if: always()
24+
with:
25+
name: playwright-report
26+
path: playwright-report/
27+
retention-days: 30

tests/unittest/index.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ test.beforeEach(async ({ page }) => {
1515
});
1616

1717
test('License is valid', async ({ page }) => {
18-
// Check if license error is displayed
19-
const licenseError = await page.evaluate(() => {
20-
return cameraEnhancer === undefined;
18+
// Check if the demo project is using the correct license
19+
const useDemoLicense = await page.evaluate(() => {
20+
return Dynamsoft.License.LicenseManager.license == 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
2121
});
2222

23-
expect(licenseError).toBeFalsy();
23+
expect(useDemoLicense).toBeTruthy();
2424
});
2525

2626
test('CameraEnhancer is initialized and working', async ({ page }) => {

0 commit comments

Comments
 (0)