Skip to content

Commit 02a00c6

Browse files
committed
chore: Updated some of the code
1 parent 363e300 commit 02a00c6

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

.github/workflows/playwright.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,4 @@ jobs:
4040
with:
4141
name: test-results
4242
path: tests/test-results/
43-
retention-days: 3
44-
- name: Update the screenshots based on Ubuntu env on GH
45-
id: test-visual-update
46-
if: ${{ failure() && steps.test-visual.conclusion == 'failure' }}
47-
run: make tests-update-screenshots
48-
- name: Upload updated Playwright screenshots
49-
uses: actions/upload-artifact@v4
50-
if: ${{ failure() && steps.test-visual-update.conclusion == 'success' }}
51-
with:
52-
name: playwright-screenshots-updated
53-
path: tests/src/__screenshots__/**/*.png
54-
retention-days: 3
43+
retention-days: 3

tests/playwright.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,22 @@ export default defineConfig({
1717
timezoneId: 'America/Los_Angeles',
1818
},
1919
projects: [
20+
{
21+
name: 'chromium',
22+
use: { ...devices['Desktop Chrome'] },
23+
},
2024
{
2125
name: 'firefox',
2226
use: { ...devices['Desktop Firefox'] },
2327
},
28+
{
29+
name: 'webkit',
30+
use: { ...devices['Desktop Safari'] },
31+
},
32+
{
33+
name: 'Mobile Chrome',
34+
use: { ...devices['Pixel 5'] },
35+
},
2436
],
2537
webServer: {
2638
command: `cd ../exampleSite && hugo mod get && hugo --gc -e production && hugo serve --port ${PORT}`,
@@ -31,6 +43,7 @@ export default defineConfig({
3143
toHaveScreenshot: {
3244
pathTemplate:
3345
'{testDir}/__screenshots__{/projectName}/{testFilePath}/{arg}{ext}',
46+
maxDiffPixels: 10,
3447
},
3548
},
3649
});

tests/src/visual-regression.spec.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ test.describe('Testing old theme', () => {
1212
window.scrollTo(0, 0);
1313
});
1414
await page.waitForFunction(() => window.scrollY === 0);
15-
await page.screenshot({
16-
path: './test-results/example-site-snapshot.png',
17-
fullPage: true,
18-
});
19-
2015
await expect(page).toHaveScreenshot('example-site-screenshot.png');
2116
});
2217
});

0 commit comments

Comments
 (0)