Skip to content

Commit b5dc5c7

Browse files
committed
Attempt to stabilize the visual tests
1 parent 976dea5 commit b5dc5c7

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

app/components/primer/alpha/select_panel_element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ export class SelectPanelElement extends HTMLElement {
176176
side: this.side,
177177
anchorOffset: 4,
178178
})
179-
this.dialog.style.top = `${top}px`
180-
this.dialog.style.left = `${left}px`
179+
this.dialog.style.top = `${Math.round(top)}px`
180+
this.dialog.style.left = `${Math.round(left)}px`
181181
this.dialog.style.bottom = 'auto'
182182
this.dialog.style.right = 'auto'
183183
}

playwright.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ const config: PlaywrightTestConfig = {
2424
browserName: 'chromium',
2525
headless: true,
2626
screenshot: 'only-on-failure',
27+
launchOptions: {
28+
args: [
29+
'--font-render-hinting=none',
30+
'--disable-lcd-text',
31+
],
32+
},
2733
},
2834
expect: {
2935
toHaveScreenshot: {

test/playwright/snapshots.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test.describe('generate snapshots', () => {
5353
// Wait a bit for animations etc to resolve
5454
await new Promise(resolve => setTimeout(resolve, 500))
5555

56-
const focusedScreenshot = await page.screenshot({animations: 'disabled'})
56+
const focusedScreenshot = await page.screenshot({animations: 'disabled', caret: 'hide'})
5757
expect(focusedScreenshot).toMatchSnapshot([example.preview_path, `${theme}.png`])
5858
})
5959
}

0 commit comments

Comments
 (0)