Skip to content

Commit 5645418

Browse files
committed
dx: steadier test
1 parent 6b2a7bc commit 5645418

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

e2e/frontend.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { test, expect, Page } from '@playwright/test'
22
import fs from 'fs'
3+
import { wait } from '../src/cross'
34

45
const username = 'rejetto'
56
const password = 'password'
@@ -287,8 +288,9 @@ test('admin1', async ({ page }) => {
287288
await screenshot(page);
288289
});
289290

290-
function screenshot(page: Page, selectorForMask='') {
291+
async function screenshot(page: Page, selectorForMask='') {
291292
if (selectorForMask)
292293
selectorForMask = ',' + selectorForMask
294+
await wait(1000) // this accounts especially for our DataTable component which takes time to set the layout
293295
return expect(page).toHaveScreenshot({ fullPage: true, mask: [page.locator(`.maskInTests${selectorForMask}`)] });
294296
}

e2e/screenshot.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@
33
main *:hover { background: none !important; }
44

55
.hideInTests, /* use for elements with variable size, where masking would produce changes anyway */
6-
.list-wrapper:not([uri="/"]) .entry-ts { display: none } /* ignore changing timestamps inside folders */
6+
.list-wrapper:not([uri="/"]) .entry-ts { display: none } /* ignore changing timestamps inside folders */
7+
8+
.MuiTooltip-tooltip { /* tooltips are subjected to small displacements */
9+
visibility: hidden !important;
10+
pointer-events: none !important;
11+
}

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { defineConfig, devices } from '@playwright/test';
1313
*/
1414
export default defineConfig({
1515
testDir: './e2e',
16-
timeout: 15_000,
16+
timeout: 20_000,
1717
fullyParallel: true, // Run tests in files in parallel
1818
forbidOnly: !!process.env.CI, // Fail the build on CI if you accidentally left test.only in the source code.
1919
retries: process.env.CI ? 2 : 0, // Retry on CI only

0 commit comments

Comments
 (0)