Skip to content

test #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'path';
import type { PlaywrightTestConfig } from '@playwright/test';
import { devices } from '@playwright/test';
import * as path from "path";
import type { PlaywrightTestConfig } from "@playwright/test";
import { devices } from "@playwright/test";

/**
* Read environment variables from file.
Expand All @@ -12,26 +12,26 @@ import { devices } from '@playwright/test';
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
testDir: './tests',
testDir: "./tests",
/* Maximum time one test can run for. */
timeout: 30 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000
timeout: 5000,
},
/* Run tests in files in parallel */
fullyParallel: true,
fullyParallel: false,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* 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: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
Expand All @@ -40,23 +40,27 @@ const config: PlaywrightTestConfig = {
// baseURL: 'http://localhost:3000',

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

headless: false,
trace: "on-first-retry",

permissions: ['camera'],
channel: 'chromium',
...devices['Desktop Chrome'],
headless: true,

permissions: ["camera"],
channel: "chromium",
...devices["Desktop Chrome"],
launchOptions: {
args: [
// LIGHTHOUSE
'--remote-debugging-port=9222',
"--remote-debugging-port=9222",

// Video WEB CAM
'--allow-file-access-from-files', // allows getUserMedia() to be called from file:// URLs
'--use-fake-ui-for-media-stream', // flag avoids grant the camera
'--use-fake-device-for-media-stream', // flag allow fake media stream
`--use-file-for-fake-video-capture=${path.join(__dirname, 'resources', 'demo.y4m')}`,
"--allow-file-access-from-files", // allows getUserMedia() to be called from file:// URLs
"--use-fake-ui-for-media-stream", // flag avoids grant the camera
"--use-fake-device-for-media-stream", // flag allow fake media stream
`--use-file-for-fake-video-capture=${path.join(
__dirname,
"resources",
"demo.y4m"
)}`,
],
},
},
Expand Down
Loading