Skip to content

Commit

Permalink
Merge branch 'Playwright-test' of https://github.com/Dynamsoft/captur…
Browse files Browse the repository at this point in the history
…e-vision-javascript-samples into Playwright-test
  • Loading branch information
eugene-dynamsoft committed Aug 27, 2024
2 parents 3a97264 + c16f3de commit e2d2136
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions VINScanner/tests/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig, devices } from '@playwright/test';
import { defineConfig, devices } from "@playwright/test";

export default defineConfig({
testDir: './',
testDir: "./",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand All @@ -11,61 +11,59 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

headless: true,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry'
trace: "on-first-retry",
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'],
name: "chromium",
use: {
...devices["Desktop Chrome"],
launchOptions: {
args: [
'--disable-web-security',
'--enable-web-rtc',
'--use-fake-ui-for-media-stream',
'--use-fake-device-for-media-stream'
]
"--disable-web-security",
"--enable-web-rtc",
"--use-fake-ui-for-media-stream",
"--use-fake-device-for-media-stream",
],
},
contextOptions: {
/* Camera permission */
permissions: ['camera'],
ignoreHTTPSErrors: true
permissions: ["camera"],
ignoreHTTPSErrors: true,
},
},
},
{
name: 'firefox',
name: "firefox",
use: {
...devices['Desktop Firefox'],
...devices["Desktop Firefox"],
launchOptions: {
args: [
'--use-fake-device-for-media-stream',
'--use-fake-ui-for-media-stream'
],
args: ["--use-fake-device-for-media-stream", "--use-fake-ui-for-media-stream"],
firefoxUserPrefs: {
'permissions.default.camera': 1, // Allow camera access automatically
'media.navigator.streams.fake': true // Use fake streams if needed
}
}
}
"permissions.default.camera": 1, // Allow camera access automatically
"media.navigator.streams.fake": true, // Use fake streams if needed
},
},
},
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'],
name: "webkit",
use: {
...devices["Desktop Safari"],
launchOptions: {
args: ['--disable-web-security',
'--enable-web-rtc'
]
args: ["--disable-web-security", "--enable-web-rtc"],
},
},
},
},
],
});

0 comments on commit e2d2136

Please sign in to comment.