Skip to content

Commit

Permalink
ci: update playwright config
Browse files Browse the repository at this point in the history
  • Loading branch information
SSShooter committed Jan 13, 2024
1 parent 82d4767 commit fe6af7c
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import { defineConfig, devices } from '@playwright/test'
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}',
timeout: 10000,
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* 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,
// retries: process.env.CI ? 2 : 0,
retries: 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
Expand Down
4 changes: 3 additions & 1 deletion tests/MindElixirFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export class MindElixirFixture {
})
}
async toHaveScreenshot(locator?: Locator) {
await expect(locator || this.page.locator('me-nodes')).toHaveScreenshot()
await expect(locator || this.page.locator('me-nodes')).toHaveScreenshot({
maxDiffPixelRatio: 0.08,
})
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions tests/mind-elixir-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ type MyFixtures = {
// Extend base test by providing "todoPage" and "settingsPage".
// This new "test" can be used in multiple test files, and each of them will get the fixtures.
export const test = base.extend<MyFixtures>({
me: async ({ page }, use, testInfo) => {
me: async ({ page }, use) => {
// Set up the fixture.
testInfo.snapshotSuffix = ''
const me = new MindElixirFixture(page)
await me.goto()

Expand Down

0 comments on commit fe6af7c

Please sign in to comment.