Skip to content

Commit 9e4dfd7

Browse files
committed
header screenshots
1 parent 7c90a63 commit 9e4dfd7

8 files changed

+40
-0
lines changed

special-pages/pages/history/integration-tests/history.page.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,12 @@ export class HistoryTestPage {
336336
const rows = this.page.locator('main').locator('[aria-selected]');
337337
await rows.nth(nth).locator('[data-action="entries_menu"]').hover();
338338
}
339+
/**
340+
*
341+
*/
342+
async hoversDeleteAllBtn() {
343+
await this.page.getByRole('button', { name: 'Delete All', exact: true }).hover();
344+
}
339345

340346
/**
341347
* @param {number} nth
@@ -485,6 +491,9 @@ export class HistoryTestPage {
485491
main() {
486492
return this.page.locator('main');
487493
}
494+
header() {
495+
return this.page.locator('header');
496+
}
488497

489498
async hoversRange(range) {
490499
await this.page.getByLabel(`Show history for ${range}`).hover();

special-pages/pages/history/integration-tests/history.screenshots.spec.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,34 @@ test.describe('history item selections', { tag: ['@screenshots'] }, () => {
7979
await expect(hp.main()).toHaveScreenshot('main.select+hover.dark.png', { maxDiffPixels });
8080
});
8181
});
82+
83+
test.describe('history header', { tag: ['@screenshots'] }, () => {
84+
test.use({ viewport: { width: 1080, height: 400 } });
85+
test.skip(process.env.CI === 'true');
86+
test('idle header', async ({ page }, workerInfo) => {
87+
const hp = HistoryTestPage.create(page, workerInfo).withEntries(12);
88+
await hp.openPage();
89+
await hp.didMakeNthQuery({ nth: 0, query: { term: '' } });
90+
await expect(hp.header()).toHaveScreenshot('header.idle.light.png', { maxDiffPixels });
91+
await hp.darkMode();
92+
await expect(hp.header()).toHaveScreenshot('header.idle.dark.png', { maxDiffPixels });
93+
});
94+
test('search', async ({ page }, workerInfo) => {
95+
const hp = HistoryTestPage.create(page, workerInfo).withEntries(12);
96+
await hp.openPage();
97+
await hp.didMakeNthQuery({ nth: 0, query: { term: '' } });
98+
await hp.types('example.com');
99+
await expect(hp.header()).toHaveScreenshot('header.search.light.png', { maxDiffPixels });
100+
await hp.darkMode();
101+
await expect(hp.header()).toHaveScreenshot('header.search.dark.png', { maxDiffPixels });
102+
});
103+
test('delete button', async ({ page }, workerInfo) => {
104+
const hp = HistoryTestPage.create(page, workerInfo).withEntries(12);
105+
await hp.openPage();
106+
await hp.didMakeNthQuery({ nth: 0, query: { term: '' } });
107+
await hp.hoversDeleteAllBtn();
108+
await expect(hp.header()).toHaveScreenshot('header.delete.light.png', { maxDiffPixels });
109+
await hp.darkMode();
110+
await expect(hp.header()).toHaveScreenshot('header.delete.dark.png', { maxDiffPixels });
111+
});
112+
});

0 commit comments

Comments
 (0)