diff --git a/playwright.config.js b/playwright.config.js index 34cb1911011aba187951cf11ba934dab2bb22147..b5a66ba201312a128866ee36395254d75787d5cb 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -22,7 +22,10 @@ module.exports = defineConfig({ * Maximum time expect() should wait for the condition to be met. * For example in `await expect(locator).toHaveText();` */ - timeout: 5000 + timeout: 5000, + toHaveScreenshot: { + stylePath: './screenshots.css' + } }, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, @@ -36,8 +39,6 @@ module.exports = defineConfig({ use: { /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ actionTimeout: 0, - /* Base URL to use in actions like `await page.goto('/')`. */ - // baseURL: 'http://localhost:3000', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: 'on-first-retry', @@ -58,36 +59,10 @@ module.exports = defineConfig({ { name: 'webkit', use: { ...devices['Desktop Safari'] }, - }, - - /* Test against mobile viewports. */ - // { - // name: 'Mobile Chrome', - // use: { ...devices['Pixel 5'] }, - // }, - // { - // name: 'Mobile Safari', - // use: { ...devices['iPhone 12'] }, - // }, - - /* Test against branded browsers. */ - // { - // name: 'Microsoft Edge', - // use: { channel: 'msedge' }, - // }, - // { - // name: 'Google Chrome', - // use: { channel: 'chrome' }, - // }, + } ], /* Folder for test artifacts such as screenshots, videos, traces, etc. */ - outputDir: 'test-results/', - - /* Run your local dev server before starting the tests */ - // webServer: { - // command: 'npm run start', - // port: 3000, - // }, + outputDir: 'test-results/' }); diff --git a/screenshot.config.js b/screenshot.config.js index 3565bdab30be0dfb0f38ab8f4fbfc0ec64bd7937..96b1b00486350011cf246ea5eae11dc9d3a6734b 100644 --- a/screenshot.config.js +++ b/screenshot.config.js @@ -19,7 +19,10 @@ module.exports = defineConfig({ * Maximum time expect() should wait for the condition to be met. * For example in `await expect(locator).toHaveText();` */ - timeout: 5000 + timeout: 5000, + toHaveScreenshot: { + stylePath: './screenshots.css' + } }, /* Run tests in files in parallel */ fullyParallel: true, diff --git a/screenshots.css b/screenshots.css new file mode 100644 index 0000000000000000000000000000000000000000..53ef9775b2a9de47a310fbeb388bd694289ec2d2 --- /dev/null +++ b/screenshots.css @@ -0,0 +1,10 @@ +#playerbar { display: none !important;} +#header {position: relative !important;} +#header.nav-down, +#header.nav-up { top: 0; animation: none;} + +#header-main-navi-header#header-main-navi-header, #header-main-navi-header#header-main-navi-header.search-open { + position: relative; + left: initial; + transform: initial; +} \ No newline at end of file