Skip to content
Merged
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
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ export default tseslint.config(
],
},
],
'perfectionist/sort-classes': [
'error',
{
partitionByComment: true,
},
],
},
},
);
49 changes: 41 additions & 8 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ import { screenshotFolder } from './tests/automation/constants/variables';

dotenv.config({ quiet: true });

function repeatEach() {
return process.env.PLAYWRIGHT_REPEAT_COUNT
? toNumber(process.env.PLAYWRIGHT_REPEAT_COUNT)
: 0;
}

function retryEach() {
return process.env.PLAYWRIGHT_RETRIES_COUNT
? toNumber(process.env.PLAYWRIGHT_RETRIES_COUNT)
: 0;
}

function workersCount() {
return process.env.PLAYWRIGHT_WORKERS_COUNT
? toNumber(process.env.PLAYWRIGHT_WORKERS_COUNT)
: 1;
}

export default defineConfig({
timeout: 350000,
globalTimeout: 6000000,
Expand All @@ -20,15 +38,30 @@ export default defineConfig({
testDir: './tests/automation',
testIgnore: '*.js',
outputDir: './tests/automation/test-results',
retries: process.env.PLAYWRIGHT_RETRIES_COUNT
? toNumber(process.env.PLAYWRIGHT_RETRIES_COUNT)
: 0,
repeatEach: process.env.PLAYWRIGHT_REPEAT_COUNT
? toNumber(process.env.PLAYWRIGHT_REPEAT_COUNT)
: 0,
workers: toNumber(process.env.PLAYWRIGHT_WORKERS_COUNT) || 1,
retries: retryEach(),
repeatEach: repeatEach(),
reportSlowTests: null,
fullyParallel: true, // otherwise, tests in the same file are not run in parallel
globalSetup: './global.setup', // clean leftovers of previous test runs on start, runs only once
snapshotPathTemplate: `${screenshotFolder}/{testName}/{arg}-{platform}{ext}`,
projects: [
Comment thread
Bilb marked this conversation as resolved.
/**
* The community tests relying on sending/receiving messages are unreliable when run in parallel.
* I think it comes down to the jump that happens when a new message is received, and also
* because receiving a new message closes an open context menu.
*/
{
name: 'Community tests',
// Those needs to be run sequentially as they are making each others unreliable
// (they all are using the same community)
testMatch: '**/*community*tests.spec.ts',
fullyParallel: false,
workers: 1, // those community tests need to be run sequentially
},
{
name: 'All other tests',
testMatch: '**/!(*community*tests).spec.ts',
fullyParallel: true, // set this to true so that tests in the same file are not run in parallel
workers: workersCount(),
},
],
});
Loading