Skip to content

Commit

Permalink
chore: rename screenshots (#9894)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Dec 9, 2024
1 parent 332c32c commit b6dba0c
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test.describe('Breakpoint service', () => {
await tuiGoto(page, DemoRoute.BreakpointService);
const example = new TuiDocumentationPagePO(page).getExample('#basic');

await expect(example).toHaveScreenshot(`breakpoint_${width}x${height}.png`);
await expect(example).toHaveScreenshot(`breakpoint-${width}x${height}.png`);
});
});
});
18 changes: 9 additions & 9 deletions projects/demo-playwright/tests/core/dialogs/dialogs.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test.describe('Dialogs', () => {
await documentationPagePO.apiPageExample.locator('button').click();
await documentationPagePO.prepareBeforeScreenshot();

await expect(page).toHaveScreenshot(`01-prompt_${width}x${height}.png`);
await expect(page).toHaveScreenshot(`01-prompt-${width}x${height}.png`);
});

test.describe(`${width}x${height}`, () => {
Expand All @@ -39,13 +39,13 @@ test.describe('Dialogs', () => {
await documentationPagePO.prepareBeforeScreenshot();

await expect(page).toHaveScreenshot(
`02-dialogs-level-1_${width}x${height}.png`,
`02-dialogs-level-1-${width}x${height}.png`,
);

await page.locator('tui-dialog button').nth(1).click();

await expect(page).toHaveScreenshot(
`02-dialogs-level-2_${width}x${height}.png`,
`02-dialogs-level-2-${width}x${height}.png`,
);
});

Expand All @@ -58,7 +58,7 @@ test.describe('Dialogs', () => {
await documentationPagePO.prepareBeforeScreenshot();

await expect(page).toHaveScreenshot(
`03-mobile-dialog_${width}x${height}.png`,
`03-mobile-dialog-${width}x${height}.png`,
);
});

Expand All @@ -71,7 +71,7 @@ test.describe('Dialogs', () => {
await documentationPagePO.prepareBeforeScreenshot();

await expect(page).toHaveScreenshot(
`04-dialogs-dialog-directive_${width}x${height}.png`,
`04-dialogs-dialog-directive-${width}x${height}.png`,
);
});

Expand All @@ -84,7 +84,7 @@ test.describe('Dialogs', () => {
await documentationPagePO.prepareBeforeScreenshot();

await expect(page).toHaveScreenshot(
`05-default-button_${width}x${height}.png`,
`05-default-button-${width}x${height}.png`,
);
});

Expand All @@ -97,7 +97,7 @@ test.describe('Dialogs', () => {
await documentationPagePO.prepareBeforeScreenshot();

await expect(page).toHaveScreenshot(
`06-custom-button_${width}x${height}.png`,
`06-custom-button-${width}x${height}.png`,
);
});

Expand All @@ -113,7 +113,7 @@ test.describe('Dialogs', () => {

test('Prompt', async ({page}) => {
await expect(page).toHaveScreenshot(
`07-prompt_${width}x${height}.png`,
`07-prompt-${width}x${height}.png`,
);
});

Expand All @@ -128,7 +128,7 @@ test.describe('Dialogs', () => {
await page.locator('tui-dialog .t-close').click();

await expect(page).toHaveScreenshot(
`08-prompt-confirm_${width}x${height}.png`,
`08-prompt-confirm-${width}x${height}.png`,
);
});

Expand Down
12 changes: 6 additions & 6 deletions projects/demo-playwright/tests/core/hint/hint.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test.describe('TuiHint', () => {
await new TuiDocumentationPagePO(page).prepareBeforeScreenshot();

await expect(page).toHaveScreenshot(
`02-hint-manual-direction-${directionIndex}__${direction}-and-width__${width}.png`,
`02-hint-manual-direction-${directionIndex}-${direction}-and-width-${width}.png`,
);
});
});
Expand Down Expand Up @@ -80,19 +80,19 @@ test.describe('TuiHint', () => {
await example.apiPageExample.locator('span').hover();

await expect(page).toHaveScreenshot(
`03-hint-mode-${mode}-tuiHintShowDelay-1000__wait-0.png`,
`03-hint-mode-${mode}-tuiHintShowDelay-1000-wait-0.png`,
);

await page.waitForTimeout(500);

await expect(page).toHaveScreenshot(
`03-hint-mode-${mode}-tuiHintShowDelay-1000_wait-500.png`,
`03-hint-mode-${mode}-tuiHintShowDelay-1000-wait-500.png`,
);

await page.waitForTimeout(500);

await expect(page).toHaveScreenshot(
`03-hint-mode-${mode}-tuiHintShowDelay-1000_wait-1000.png`,
`03-hint-mode-${mode}-tuiHintShowDelay-1000-wait-1000.png`,
);
});
});
Expand Down Expand Up @@ -126,11 +126,11 @@ test.describe('TuiHint', () => {

await new TuiDocumentationPagePO(page).prepareBeforeScreenshot();

await expect(page).toHaveScreenshot('06-hint-direction__bottom.png');
await expect(page).toHaveScreenshot('06-hint-direction-bottom.png');

await page.setViewportSize({width: 1280, height: 150});

await expect(page).toHaveScreenshot('06-hint-direction__left.png');
await expect(page).toHaveScreenshot('06-hint-direction-left.png');
});

test('TuiHint customizing works', async ({page}) => {
Expand Down
2 changes: 1 addition & 1 deletion projects/demo-playwright/tests/deep/deep-select.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test.describe('Deep / Select', () => {
await page.waitForTimeout(100);

await expect(api.apiPageExample).toHaveScreenshot(
`deep-${path}__${name}-select-option-${index}.png`,
`deep-${path}-${name}-select-option-${index}.png`,
);

await select.click();
Expand Down
2 changes: 1 addition & 1 deletion projects/demo-playwright/tests/deep/deep-toggle.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.describe('Deep / Toggle', () => {
await page.waitForTimeout(100);

await expect(api.apiPageExample).toHaveScreenshot(
`deep-${path}__${name}-toggled.png`,
`deep-${path}-${name}-toggled.png`,
);

await toggle.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test.describe('CalendarRange', () => {
example.locator('p button[data-appearance="action"]');

await expect(example).toHaveScreenshot(
'05-calendar-range-correct-display-defaults-items-and-values_1.png',
'05-calendar-range-correct-display-defaults-items-and-values-1.png',
);

await calendarRange.selectItem(1);
Expand All @@ -61,7 +61,7 @@ test.describe('CalendarRange', () => {
await getRangeSwitcher().click();

await expect(example).toHaveScreenshot(
'05-calendar-range-correct-display-defaults-items-and-values_2.png',
'05-calendar-range-correct-display-defaults-items-and-values-2.png',
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ test.describe('InputTable', () => {

await page.waitForTimeout(300);

await expect(example).toHaveScreenshot(`01-input_table__${index}_1.png`);
await expect(example).toHaveScreenshot(`01-input-table-${index}-1.png`);

await example.locator('th').nth(index).click();

await expect(example).toHaveScreenshot(`01-input_table__${index}_2.png`);
await expect(example).toHaveScreenshot(`01-input-table-${index}-2.png`);

// eslint-disable-next-line playwright/no-conditional-in-test
if (index > 0) {
Expand All @@ -40,7 +40,7 @@ test.describe('InputTable', () => {
await page.waitForTimeout(300);

// eslint-disable-next-line playwright/no-conditional-expect
await expect(example).toHaveScreenshot(`01-input_table__${index}_3.png`);
await expect(example).toHaveScreenshot(`01-input-table-${index}-3.png`);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ test.describe('LineClamp', () => {
);
await pagePO.prepareBeforeScreenshot();

await expect(page).toHaveScreenshot(`05-1-line-clamp__${index}.png`);
await expect(page).toHaveScreenshot(`05-1-line-clamp-${index}.png`);

await pagePO.apiPageExample.locator('tui-line-clamp').hover();

await expect(page).toHaveScreenshot(`05-2-line-clamp__${index}.png`);
await expect(page).toHaveScreenshot(`05-2-line-clamp-${index}.png`);
});
});
});
Expand Down
32 changes: 12 additions & 20 deletions projects/demo-playwright/tests/kit/range/range.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,56 +234,48 @@ test.describe('TuiRange', () => {
await range.right.focus();

await expect(output).toContainText('[ 0, 100000 ]');
await expect(example).toHaveScreenshot('09-range-0-100_000.png');
await expect(example).toHaveScreenshot('09-range-0-100000.png');

await page.keyboard.down('ArrowUp');

await expect(output).toContainText('[ 0, 300000 ]');
await expect(example).toHaveScreenshot('09-range-0-300_000.png');
await expect(example).toHaveScreenshot('09-range-0-300000.png');

await page.keyboard.down('ArrowUp');

await expect(output).toContainText('[ 0, 500000 ]');
await expect(example).toHaveScreenshot('09-range-0-500_000.png');
await expect(example).toHaveScreenshot('09-range-0-500000.png');

await page.keyboard.down('ArrowUp');

await expect(output).toContainText('[ 0, 750000 ]');
await expect(example).toHaveScreenshot('09-range-0-750_000.png');
await expect(example).toHaveScreenshot('09-range-0-750000.png');

await page.keyboard.down('ArrowUp');

await expect(output).toContainText('[ 0, 1000000 ]');
await expect(example).toHaveScreenshot('09-range-0-1_000_000.png');
await expect(example).toHaveScreenshot('09-range-0-1_000000.png');

await range.left.focus();
await page.keyboard.down('ArrowUp');

await expect(output).toContainText('[ 5000, 1000000 ]');
await expect(example).toHaveScreenshot(
'09-range-5_000-1_000_000.png',
);
await expect(example).toHaveScreenshot('09-range-5-000-1-000000.png');

await page.keyboard.down('ArrowUp');

await expect(output).toContainText('[ 10000, 1000000 ]');
await expect(example).toHaveScreenshot(
'09-range-10_000-1_000_000.png',
);
await expect(example).toHaveScreenshot('09-range-10000-1000000.png');

await page.keyboard.down('ArrowUp');

await expect(output).toContainText('[ 55000, 1000000 ]');
await expect(example).toHaveScreenshot(
'09-range-55_000-1_000_000.png',
);
await expect(example).toHaveScreenshot('09-range-55000-1000000.png');

await page.keyboard.down('ArrowUp');

await expect(output).toContainText('[ 100000, 1000000 ]');
await expect(example).toHaveScreenshot(
'09-range-100_000-1_000_000.png',
);
await expect(example).toHaveScreenshot('09-range-100000-1000000.png');
});

test('ArrowDown decreases value of the focused slider', async ({
Expand All @@ -293,17 +285,17 @@ test.describe('TuiRange', () => {
await page.keyboard.down('ArrowDown');

await expect(output).toContainText('[ 0, 55000 ]');
await expect(example).toHaveScreenshot('10-range-0-55_000.png');
await expect(example).toHaveScreenshot('10-range-0-55000.png');

await page.keyboard.down('ArrowDown');

await expect(output).toContainText('[ 0, 10000 ]');
await expect(example).toHaveScreenshot('10-range-0-10_000.png');
await expect(example).toHaveScreenshot('10-range-0-10000.png');

await page.keyboard.down('ArrowDown');

await expect(output).toContainText('[ 0, 5000 ]');
await expect(example).toHaveScreenshot('10-range-0-5_000.png');
await expect(example).toHaveScreenshot('10-range-0-5000.png');
});

test('cannot set position of the LEFT slider MORE THAN position of the RIGHT slider (by ArrowUp)', async ({
Expand Down
4 changes: 2 additions & 2 deletions projects/demo-playwright/tests/kit/slider/slider.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test.describe('Slider', () => {
const {apiPageExample} = new TuiDocumentationPagePO(page);

await expect(apiPageExample).toHaveScreenshot(
'03-min_1__max_10__value_1__segments_9.png',
'03-min-1-max-10-value-1-segments-9.png',
);
});

Expand All @@ -77,7 +77,7 @@ test.describe('Slider', () => {
const {apiPageExample} = new TuiDocumentationPagePO(page);

await expect(apiPageExample).toHaveScreenshot(
'04-min_-5__max_5__value_1__segments_5.png',
'04-min--5-max-5-value-1-segments_5.png',
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test.describe('InputTime', () => {

await inputTime.textfield.click();

await expect(apiPageExample).toHaveScreenshot(`time_mode_${mode}.png`);
await expect(apiPageExample).toHaveScreenshot(`time-mode-${mode}.png`);
});
});

Expand Down

0 comments on commit b6dba0c

Please sign in to comment.