chore: add flaky tests and enable retries

This commit is contained in:
Liam DeBeasi
2023-05-18 11:39:44 -04:00
parent 6326a3a9c1
commit b734de0aa0
2 changed files with 11 additions and 1 deletions

View File

@ -65,7 +65,7 @@ const config: PlaywrightTestConfig = {
/* Fail fast on CI */ /* Fail fast on CI */
maxFailures: process.env.CI ? 1 : 0, maxFailures: process.env.CI ? 1 : 0,
/* Flaky test should be either addressed or disabled until we can address them */ /* Flaky test should be either addressed or disabled until we can address them */
retries: 0, retries: 3,
/* Opt out of parallel tests on CI. */ /* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined, workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ /* Reporter to use. See https://playwright.dev/docs/test-reporters */

View File

@ -1,6 +1,16 @@
import { expect } from '@playwright/test'; import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright'; import { configs, test } from '@utils/test/playwright';
configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
test.describe.only(title('my describe block'), () => {
test('test', () => {
if (Math.random() > 0.6) {
throw new Error('flaky')
}
});
});
});
configs().forEach(({ config, screenshot, title }) => { configs().forEach(({ config, screenshot, title }) => {
test.describe(title('button: basic'), () => { test.describe(title('button: basic'), () => {
test('should not have visual regressions', async ({ page }) => { test('should not have visual regressions', async ({ page }) => {