diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0a8e5a6369bc..edc2838dfa02 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,6 +12,10 @@ /apps/demos/Demos/** @DevExpress/devextreme-components /e2e/testcafe-devextreme/tests/*/** @DevExpress/devextreme-components /e2e/playwright/tests/editors/** @DevExpress/devextreme-components +/e2e/playwright/tests/common/* @DevExpress/devextreme-components +/e2e/playwright/tests/common/etalons/** @DevExpress/devextreme-components +/e2e/playwright/tests/common/gantt/** @DevExpress/devextreme-components +/e2e/playwright/tests/common/pagination/** @DevExpress/devextreme-components /packages/devextreme/testing/tests/DevExpress.serverSide*/** @DevExpress/devextreme-components ## ui @@ -125,6 +129,7 @@ /packages/devextreme/testing/tests/*/draggable.* @DevExpress/devextreme-grids /e2e/testcafe-devextreme/tests/common/draggable.ts @DevExpress/devextreme-grids +/e2e/playwright/tests/common/draggable.spec.ts @DevExpress/devextreme-grids ## card_view /packages/devextreme/js/ui/card_view.d.ts @DevExpress/devextreme-grids diff --git a/e2e/playwright/eslint.config.mjs b/e2e/playwright/eslint.config.mjs index e3f6606e7da4..a7894979e6ec 100644 --- a/e2e/playwright/eslint.config.mjs +++ b/e2e/playwright/eslint.config.mjs @@ -68,7 +68,14 @@ export default [ }, }, { - files: ['helpers/**/*.ts', 'models/**/*.ts', 'tests/editors/**/*.ts'], + files: [ + 'helpers/**/*.ts', + 'models/**/*.ts', + 'tests/editors/**/*.ts', + 'tests/common/*.ts', + 'tests/common/gantt/**/*.ts', + 'tests/common/pagination/**/*.ts', + ], rules: { 'no-restricted-syntax': ['error', { selector: "CallExpression[callee.property.name='waitForTimeout'], CallExpression[callee.name='setTimeout'], CallExpression[callee.object.name=/^(window|globalThis)$/][callee.property.name='setTimeout']", diff --git a/e2e/playwright/models/pagination.ts b/e2e/playwright/models/pagination.ts new file mode 100644 index 000000000000..0469003a2a50 --- /dev/null +++ b/e2e/playwright/models/pagination.ts @@ -0,0 +1,21 @@ +import type { Locator } from '@playwright/test'; +import type { WidgetName } from './types'; +import Widget from './internal/widget'; + +const CLASS = { + page: 'dx-page', + pageSize: 'dx-page-size', +}; + +export default class Pagination extends Widget { + public getPageSize(index: number): Locator { + return this.element.locator(`.${CLASS.pageSize}`).nth(index); + } + + public getNavPage(pageText: string): Locator { + return this.element.locator(`.${CLASS.page}`).filter({ hasText: pageText }); + } + + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxPagination'; } +} diff --git a/e2e/playwright/models/types.ts b/e2e/playwright/models/types.ts index 95664ba3611f..02a6e58cdeb7 100644 --- a/e2e/playwright/models/types.ts +++ b/e2e/playwright/models/types.ts @@ -5,6 +5,8 @@ import type { Properties as GanttProperties } from 'devextreme/ui/gantt'; export type WidgetName = 'dxAccordion' | 'dxActionSheet' | 'dxAutocomplete' + | 'dxBarGauge' + | 'dxBullet' | 'dxButton' | 'dxButtonGroup' | 'dxCalendar' @@ -13,6 +15,7 @@ export type WidgetName = 'dxAccordion' | 'dxChart' | 'dxChat' | 'dxCheckBox' + | 'dxCircularGauge' | 'dxColorBox' | 'dxContextMenu' | 'dxDataGrid' @@ -27,8 +30,10 @@ export type WidgetName = 'dxAccordion' | 'dxFileUploader' | 'dxFilterBuilder' | 'dxForm' + | 'dxFunnel' | 'dxGallery' | 'dxHtmlEditor' + | 'dxLinearGauge' | 'dxList' | 'dxLoadIndicator' | 'dxLoadPanel' @@ -39,19 +44,24 @@ export type WidgetName = 'dxAccordion' | 'dxNumberBox' | 'dxOverlay' | 'dxPagination' + | 'dxPieChart' | 'dxPivotGrid' | 'dxPivotGridFieldChooser' + | 'dxPolarChart' | 'dxPopover' | 'dxPopup' | 'dxProgressBar' | 'dxRadioGroup' + | 'dxRangeSelector' | 'dxRangeSlider' + | 'dxSankey' | 'dxScheduler' | 'dxScrollable' | 'dxScrollView' | 'dxSelectBox' | 'dxSlider' | 'dxSortable' + | 'dxSparkline' | 'dxSpeechToText' | 'dxSpeedDialAction' | 'dxSplitter' @@ -67,9 +77,11 @@ export type WidgetName = 'dxAccordion' | 'dxToolbar' | 'dxTooltip' | 'dxTreeList' + | 'dxTreeMap' | 'dxTreeView' | 'dxValidationSummary' | 'dxValidator' + | 'dxVectorMap' | 'dxGantt'; export interface WidgetOptions { diff --git a/e2e/playwright/tests/common/accentColor.spec.ts b/e2e/playwright/tests/common/accentColor.spec.ts new file mode 100644 index 000000000000..42f187bc456c --- /dev/null +++ b/e2e/playwright/tests/common/accentColor.spec.ts @@ -0,0 +1,440 @@ +/* eslint-disable spellcheck/spell-checker */ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../fixtures'; +import { createWidget } from '../../helpers/createWidget'; +import { appendElementTo } from '../../helpers/domUtils'; +import { testScreenshot } from '../../helpers/screenshots'; +import { getThemeName } from '../../helpers/themeUtils'; + +const STEPS = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180]; + +const DESIGNED_PALETTE_TOLERANCE = 4; +const HUE_TOLERANCE = 0.01; + +interface Oklch { + l: number; + c: number; + h: number; +} + +interface MeasuredStep { + step: number; + resolved: string; + oklch: Oklch | null; +} + +interface MeasuredPalette { + measured: MeasuredStep[]; + source: Oklch | null; + settings: { lightnessMax: number; lightnessMin: number; chromaMin: number }; +} + +interface Painted { + painted: { selectedRange: string; handles: string[]; markers: string[] }; + primary: string; + inPlace: boolean; +} + +interface PaintedAccent extends Painted { + name: string; +} + +// The color probes below read a computed color back as hex; the page gets the reader once, +// because a function cannot travel into the page as an argument. +const installAsHex = (page: Page): Promise => page.evaluate(() => { + (window as any).asHex = (value: string): string => { + const probe = document.createElement('div'); + document.body.appendChild(probe); + probe.style.backgroundColor = `rgb(from ${value} r g b)`; + const resolved = getComputedStyle(probe).backgroundColor; + probe.remove(); + + const channels = (resolved.match(/[-\d.]+/g) ?? []).slice(0, 3); + const scale = resolved.startsWith('color(') ? 255 : 1; + + return channels.length === 3 + ? `#${channels + .map((raw) => Math.round(Math.min(255, Math.max(0, +raw * scale))).toString(16).padStart(2, '0')) + .join('')}` + : resolved; + }; +}); + +const measurePalette = ( + page: Page, + accent: string | null, + steps: number[], +): Promise => page.evaluate(({ accentColor, paletteSteps }) => { + const root = document.documentElement; + + if (accentColor) { + root.style.setProperty('--dx-accent-color', accentColor); + } else { + root.style.removeProperty('--dx-accent-color'); + } + + const probe = document.createElement('div'); + document.body.appendChild(probe); + + const asOklch = (color: string): Oklch | null => { + probe.style.backgroundColor = `oklch(from ${color} l c h)`; + const resolved = getComputedStyle(probe).backgroundColor; + const parts = /^oklch\(([-\d.]+) ([-\d.]+) ([-\d.]+|none)/.exec(resolved); + + if (!parts) { + return null; + } + + if (parts[3] !== 'none') { + return { l: +parts[1], c: +parts[2], h: +parts[3] }; + } + + // Chrome 157 reports the hue of a near-grey as "none"; the a and b axes still carry it. + probe.style.backgroundColor = `oklab(from ${color} l a b)`; + const [, , a, b] = (/^oklab\(([-\d.]+) ([-\d.e]+) ([-\d.e]+)/.exec(getComputedStyle(probe).backgroundColor) ?? []) + .map(Number); + const hue = (Math.atan2(b, a) * 180) / Math.PI; + + return { l: +parts[1], c: +parts[2], h: hue < 0 ? hue + 360 : hue }; + }; + + const read = (step: number): MeasuredStep => { + probe.style.backgroundColor = `var(--dxds-primary-${step})`; + const resolved = getComputedStyle(probe).backgroundColor; + + return { step, resolved, oklch: asOklch(resolved) }; + }; + + const setting = (name: string): number => +getComputedStyle(root).getPropertyValue(name).trim(); + const measured = paletteSteps.map(read); + const source = accentColor ? asOklch(accentColor) : null; + + probe.remove(); + + return { + measured, + source, + settings: { + lightnessMax: setting('--dx-accent-lightness-max'), + lightnessMin: setting('--dx-accent-lightness-min'), + chromaMin: setting('--dx-accent-chroma-min'), + }, + }; +}, { accentColor: accent, paletteSteps: steps }); + +const PALETTE_STRIP = 'accent-palette'; +const ACCENT_GRID = 'accent-grid'; +const ACCENT_RANGE = 'accent-range'; +const SELECTED_RANGE = `#${ACCENT_RANGE} .dxrs-slidersContainer > path`; +const SLIDER_HANDLES = `#${ACCENT_RANGE} .slider > path`; +const SLIDER_MARKERS = `#${ACCENT_RANGE} .slider-marker > path`; +const GRID_DATA = Array.from({ length: 5 }, (_, row) => ({ + field_0: `val_${row}_0`, + field_1: `val_${row}_1`, +})); +const SHIPPED_ACCENTS = [ + { palette: 'blue', color: '#0f6cbd' }, + { palette: 'rust', color: '#da3b01' }, + { palette: 'mint', color: '#018574' }, +]; + +const drawPaletteStrip = (page: Page, accent: string, steps: number[]): Promise => page + .evaluate(({ accentColor, paletteSteps, stripId }) => { + const { asHex } = window as any; + + document.documentElement.style.setProperty('--dx-accent-color', accentColor); + const strip = document.getElementById(stripId)!; + strip.textContent = ''; + + const swatches = paletteSteps.map((step) => { + const column = document.createElement('div'); + column.style.cssText = 'width: 60px; font: 10px/14px monospace; color: #000; text-align: center'; + + const swatch = document.createElement('div'); + swatch.style.cssText = 'height: 60px; border: 1px solid #000'; + swatch.style.backgroundColor = `var(--dxds-primary-${step})`; + + const caption = document.createElement('div'); + caption.textContent = `${step}`; + + column.appendChild(swatch); + column.appendChild(caption); + strip.appendChild(column); + + return { step, swatch, caption }; + }); + + for (const { step, swatch, caption } of swatches) { + caption.textContent = `${step}\n${asHex(getComputedStyle(swatch).backgroundColor)}`; + caption.style.whiteSpace = 'pre'; + } + }, { accentColor: accent, paletteSteps: steps, stripId: PALETTE_STRIP }); + +const oklchDistance = (first: Oklch, second: Oklch): number => { + const radians = Math.PI / 180; + const firstA = first.c * Math.cos(first.h * radians); + const firstB = first.c * Math.sin(first.h * radians); + const secondA = second.c * Math.cos(second.h * radians); + const secondB = second.c * Math.sin(second.h * radians); + const squared = (first.l - second.l) ** 2 + (firstA - secondA) ** 2 + (firstB - secondB) ** 2; + + return Math.sqrt(squared) * 100; +}; + +const accentThroughApi = ( + page: Page, + color: string | null, +): Promise<{ seed: string; reported: string }> => page.evaluate((accentColor) => { + const { asHex, DevExpress } = window as any; + const { themes } = DevExpress.ui; + + themes.customAccentColor(accentColor); + + const probe = document.createElement('div'); + document.body.appendChild(probe); + probe.style.backgroundColor = 'var(--dxds-primary-100)'; + const seed = asHex(getComputedStyle(probe).backgroundColor); + probe.remove(); + + return { seed, reported: themes.customAccentColor() }; +}, color); + +const declareBrandColor = (page: Page, color: string): Promise => page.evaluate((brand) => { + document.documentElement.style.setProperty('--brand', brand); +}, color); + +const createAccentRange = async (page: Page): Promise => { + await appendElementTo(page, '#container', 'div', ACCENT_RANGE, { marginTop: '8px' }); + await createWidget(page, 'dxRangeSelector', { + scale: { + startValue: 0, endValue: 100, tickInterval: 10, minorTickInterval: 2, + }, + value: [20, 60], + behavior: { animationEnabled: false }, + size: { width: 1080, height: 80 }, + }, `#${ACCENT_RANGE}`); +}; + +const rememberAccentRange = (page: Page): Promise => page.evaluate(({ + rangeId, selectedRangeSelector, +}) => { + const { DevExpress } = window as any; + const host = document.getElementById(rangeId); + + (window as any).accentRangeAsCreated = { + instance: DevExpress.viz.dxRangeSelector.getInstance(host), + selectedRange: document.querySelector(selectedRangeSelector), + }; +}, { rangeId: ACCENT_RANGE, selectedRangeSelector: SELECTED_RANGE }); + +const paintAccentRange = ( + page: Page, + color: string, + throughApi: boolean, +): Promise => page.evaluate(({ + accentColor, viaApi, rangeId, selectors, +}) => { + const { asHex, DevExpress, accentRangeAsCreated } = window as any; + + if (viaApi) { + DevExpress.ui.themes.customAccentColor(accentColor); + } else { + document.documentElement.style.setProperty('--dx-accent-color', accentColor); + } + + const host = document.getElementById(rangeId); + const selectedRange = document.querySelector(selectors.selectedRange)!; + const paintOf = (selector: string, property: 'fill' | 'stroke'): string[] => Array.from( + document.querySelectorAll(selector), + (element) => asHex(getComputedStyle(element)[property]), + ); + const probe = document.createElement('div'); + document.body.appendChild(probe); + probe.style.backgroundColor = 'var(--dxds-primary-100)'; + const primary = asHex(getComputedStyle(probe).backgroundColor); + probe.remove(); + + return { + painted: { + selectedRange: asHex(getComputedStyle(selectedRange).stroke), + handles: paintOf(selectors.handles, 'stroke'), + markers: paintOf(selectors.markers, 'fill'), + }, + primary, + inPlace: selectedRange === accentRangeAsCreated?.selectedRange + && DevExpress.viz.dxRangeSelector.getInstance(host) === accentRangeAsCreated?.instance, + }; +}, { + accentColor: color, + viaApi: throughApi, + rangeId: ACCENT_RANGE, + selectors: { selectedRange: SELECTED_RANGE, handles: SLIDER_HANDLES, markers: SLIDER_MARKERS }, +}); + +const RANGE_ACCENTS = [ + ...SHIPPED_ACCENTS.map(({ palette, color }) => ({ name: palette, color, throughApi: false })), + { name: 'custom', color: '#a703ff', throughApi: false }, + { name: 'custom through themes.customAccentColor', color: '#107c10', throughApi: true }, +]; + +const rounded = (value: number): number => Math.round(value * 1000) / 1000; +const stepOf = (measured: MeasuredStep[], step: number): Oklch => measured + .find((entry) => entry.step === step)!.oklch!; + +test.describe('Custom accent color', () => { + test.skip(({ theme }) => getThemeName(theme) !== 'fluent-next', 'fluent-next only'); + + test.beforeEach(async ({ page }) => { + await installAsHex(page); + }); + + test('the designed seed gives the palette back', async ({ page }) => { + const designed = await measurePalette(page, null, STEPS); + const designedSteps = designed.measured; + const seed = stepOf(designedSteps, 100); + const derived = await measurePalette(page, `oklch(${seed.l} ${seed.c} ${seed.h})`, STEPS); + + expect( + designedSteps.every((entry) => entry.resolved.startsWith('rgb')), + 'an unset accent must leave the designed values in place', + ).toBe(true); + + expect(derived.measured + .map((entry) => ({ + step: entry.step, + distance: rounded(oklchDistance(stepOf(designedSteps, entry.step), entry.oklch!)), + })) + .filter(({ distance }) => distance > DESIGNED_PALETTE_TOLERANCE)).toEqual([]); + }); + + test('an arbitrary accent keeps hue, order and clamps', async ({ page }) => { + const arbitraryAccent = '#a703ff'; + const { measured, source, settings } = await measurePalette(page, arbitraryAccent, STEPS); + const steps = measured; + const lightest = stepOf(steps, 10); + const darkest = stepOf(steps, 180); + const accentItself = stepOf(steps, 100); + + expect({ + lightest: { l: rounded(lightest.l), c: rounded(lightest.c) }, + darkest: { l: rounded(darkest.l), c: rounded(darkest.c) }, + accentItself: { l: rounded(accentItself.l), c: rounded(accentItself.c) }, + lighteningSteps: steps + .filter((entry, index) => index > 0 && entry.oklch!.l >= steps[index - 1].oklch!.l) + .map((entry) => entry.step), + stepsOffHue: steps + .filter((entry) => Math.abs(entry.oklch!.h - source!.h) > HUE_TOLERANCE) + .map((entry) => entry.step), + }).toEqual({ + lightest: { l: settings.lightnessMax, c: settings.chromaMin }, + darkest: { l: settings.lightnessMin, c: settings.chromaMin }, + accentItself: { l: rounded(source!.l), c: rounded(source!.c) }, + lighteningSteps: [], + stepsOffHue: [], + }); + }); + + test('the derived palette is drawn as designed', async ({ page }) => { + await appendElementTo(page, '#container', 'div', PALETTE_STRIP, { display: 'flex' }); + await appendElementTo(page, '#container', 'div', ACCENT_GRID, { marginTop: '8px', width: '1080px' }); + await createWidget(page, 'dxDataGrid', { + dataSource: GRID_DATA, + keyExpr: 'field_0', + selection: { mode: 'multiple' }, + selectedRowKeys: [GRID_DATA[0].field_0, GRID_DATA[1].field_0], + focusedRowEnabled: true, + focusedRowKey: GRID_DATA[2].field_0, + showBorders: true, + }, `#${ACCENT_GRID}`); + await createAccentRange(page); + + for (const { palette, color } of SHIPPED_ACCENTS) { + await drawPaletteStrip(page, color, STEPS); + await testScreenshot(page, `Accent palette ${palette}.png`, { + element: '#container', + }); + } + }); + + test('a range selector paints its selected range, handles and markers in the accent, repainting in place', async ({ page }) => { + await createAccentRange(page); + await rememberAccentRange(page); + + const results: PaintedAccent[] = []; + + for (const { name, color, throughApi } of RANGE_ACCENTS) { + results.push({ name, ...await paintAccentRange(page, color, throughApi) }); + } + + expect( + results.map(({ name, painted }) => ({ name, ...painted })), + 'the selected range, both slider handles and both marker plates are painted in --dxds-primary-100 of every accent', + ).toEqual( + results.map(({ name, primary }) => ({ + name, selectedRange: primary, handles: [primary, primary], markers: [primary, primary], + })), + ); + + expect( + new Set(results.map(({ painted }) => painted.selectedRange)).size, + 'no two accents paint the selected range alike', + ).toBe(RANGE_ACCENTS.length); + + expect( + results.filter(({ inPlace }) => !inPlace).map(({ name }) => name), + 'every accent repaints the widget drawn first, neither re-created nor reloaded', + ).toEqual([]); + }); + + test('a translucent accent still gives an opaque palette', async ({ page }) => { + const translucentAccent = '#a703ff80'; + const { measured } = await measurePalette(page, translucentAccent, STEPS); + + expect( + measured.filter((entry) => entry.resolved.includes('/')).map((entry) => entry.step), + 'no step may inherit the alpha of the accent', + ).toEqual([]); + }); + + test('themes.customAccentColor sets, keeps and clears the accent', async ({ page }) => { + const designedAccent = '#0f6cbd'; + const arbitraryAccent = '#a703ff'; + const designed = await accentThroughApi(page, null); + + expect(designed.reported, 'an accent nobody set is reported as unset').toBe(''); + expect(designed.seed, 'the theme starts on the accent it was drawn with').toBe(designedAccent); + + const applied = await accentThroughApi(page, arbitraryAccent); + + expect(applied.seed, 'the palette is built from the accent that was set').toBe(arbitraryAccent); + expect(applied.reported, 'the accent that was set is reported back').toBe(arbitraryAccent); + + const afterRefusedValue = await accentThroughApi(page, 'not-a-color'); + + expect(afterRefusedValue.seed, 'a refused value leaves the palette alone').toBe(arbitraryAccent); + expect(afterRefusedValue.reported, 'a refused value leaves the accent alone').toBe(arbitraryAccent); + + const afterReset = await accentThroughApi(page, null); + + expect(afterReset.seed, 'null brings the designed palette back').toBe(designed.seed); + expect(afterReset.reported, 'a cleared accent is reported as unset').toBe(''); + }); + + test('themes.customAccentColor takes an accent written as a reference', async ({ page }) => { + const brandAccent = '#a703ff'; + + await declareBrandColor(page, brandAccent); + const applied = await accentThroughApi(page, 'var(--brand)'); + + expect(applied.seed, 'the palette is built from the color the reference resolves to').toBe(brandAccent); + expect(applied.reported, 'a reference is reported back as the color it resolves to').toBe(brandAccent); + }); + + test('themes.customAccentColor takes an accent written by name', async ({ page }) => { + const namedAccent = 'rebeccapurple'; + const applied = await accentThroughApi(page, namedAccent); + + expect(applied.seed, 'the palette is built from the color the name stands for').toBe('#663399'); + expect(applied.reported, 'the accent is reported back as it was written, not as a hex').toBe(namedAccent); + }); +}); diff --git a/e2e/playwright/tests/common/draggable.spec.ts b/e2e/playwright/tests/common/draggable.spec.ts new file mode 100644 index 000000000000..da1090b565ef --- /dev/null +++ b/e2e/playwright/tests/common/draggable.spec.ts @@ -0,0 +1,106 @@ +import type { Locator, Page } from '@playwright/test'; +import { expect, test } from '../../fixtures'; +import { createWidget } from '../../helpers/createWidget'; + +const AUTO_SCROLLED = 60; + +const centerOf = async (element: Locator): Promise<{ x: number; y: number }> => { + const box = await element.boundingBox(); + + if (!box) { + throw new Error(`${element.toString()} has no box`); + } + + return { x: box.x + box.width / 2, y: box.y + box.height / 2 }; +}; + +// The ScrollView auto-scrolls only while the pointer stays at its edge, so the drag stops there +// until the content has scrolled, then goes on along the same line to the end point. +const dragThroughTheEdge = async ( + page: Page, + element: Locator, + container: Locator, + direction: 'down' | 'right', + scrolled: () => Promise, +): Promise => { + const start = await centerOf(element); + const box = await container.boundingBox(); + + if (!box) { + throw new Error(`${container.toString()} has no box`); + } + + const atTheEdge = direction === 'down' + ? { x: start.x, y: box.y + box.height - 1 } + : { x: box.x + box.width - 1, y: start.y }; + const end = direction === 'down' + ? { x: start.x, y: start.y + 400 } + : { x: start.x + 400, y: start.y }; + + await page.mouse.move(start.x, start.y); + await page.mouse.down(); + await page.mouse.move(atTheEdge.x, atTheEdge.y, { steps: 10 }); + + await expect.poll(scrolled).toBeGreaterThan(AUTO_SCROLLED); + + await page.mouse.move(end.x, end.y, { steps: 10 }); + await page.mouse.up(); +}; + +test.describe('Draggable', () => { + test('dxDraggable element should not loose its position on dragging with auto-scroll inside ScrollView (T1169590)', async ({ page }) => { + await page.evaluate(() => { + $('
', { + id: 'scrollview', + width: '400px', + height: '400px', + }) + .css({ + position: 'absolute', + top: 0, + padding: '20px', + background: '#f18787', + }) + .appendTo('#container'); + + $('
', { + id: 'scrollview-content', + height: '500px', + width: '500px', + }).appendTo('#scrollview'); + + $('
', { + id: 'drag-me', + }) + .css({ + 'background-color': 'blue', + display: 'inline-block', + }) + .appendTo('#scrollview-content'); + $('#drag-me').append('DRAG ME!!!'); + }); + await createWidget(page, 'dxScrollView', { + direction: 'both', + }, '#scrollview'); + await createWidget(page, 'dxDraggable', { }, '#drag-me'); + + const draggable = page.locator('#drag-me'); + const container = page.locator('#scrollview .dx-scrollable-container'); + const scrollTop = (): Promise => container.evaluate((element) => element.scrollTop); + const scrollLeft = (): Promise => container.evaluate((element) => element.scrollLeft); + const draggableRect = (): Promise => draggable + .evaluate((element) => element.getBoundingClientRect().toJSON()); + + await dragThroughTheEdge(page, draggable, container, 'down', scrollTop); + + await expect.poll(scrollTop).toBeGreaterThan(AUTO_SCROLLED); + await expect.poll(async () => (await draggableRect()).top).toBeGreaterThan(400); + + await draggable.scrollIntoViewIfNeeded(); + + await dragThroughTheEdge(page, draggable, container, 'right', scrollLeft); + + await expect.poll(scrollLeft).toBeGreaterThan(AUTO_SCROLLED); + await expect.poll(async () => (await draggableRect()).left).toBeGreaterThan(400); + }); +}); diff --git a/e2e/playwright/tests/common/etalons/Accent palette blue (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Accent palette blue (fluent-next.blue.light).png new file mode 100644 index 000000000000..1a11463dd5ee Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Accent palette blue (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Accent palette mint (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Accent palette mint (fluent-next.blue.light).png new file mode 100644 index 000000000000..62174cfc876a Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Accent palette mint (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Accent palette rust (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Accent palette rust (fluent-next.blue.light).png new file mode 100644 index 000000000000..f3f5f9f6477e Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Accent palette rust (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Icon set (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Icon set (fluent-next.blue.light).png new file mode 100644 index 000000000000..6464591d165f Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Icon set (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Icon set (fluent.blue.light).png b/e2e/playwright/tests/common/etalons/Icon set (fluent.blue.light).png new file mode 100644 index 000000000000..6464591d165f Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Icon set (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Icon set (generic.light).png b/e2e/playwright/tests/common/etalons/Icon set (generic.light).png new file mode 100644 index 000000000000..78fc8d1fec10 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Icon set (generic.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Icon set (material.blue.light).png b/e2e/playwright/tests/common/etalons/Icon set (material.blue.light).png new file mode 100644 index 000000000000..eb5bad4c0c92 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Icon set (material.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/SVG icon set (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/SVG icon set (fluent-next.blue.light).png new file mode 100644 index 000000000000..62ae90a999e4 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/SVG icon set (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/SVG icon set (fluent.blue.light).png b/e2e/playwright/tests/common/etalons/SVG icon set (fluent.blue.light).png new file mode 100644 index 000000000000..62ae90a999e4 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/SVG icon set (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/SVG icon set (generic.light).png b/e2e/playwright/tests/common/etalons/SVG icon set (generic.light).png new file mode 100644 index 000000000000..8256ff3a2037 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/SVG icon set (generic.light).png differ diff --git a/e2e/playwright/tests/common/etalons/SVG icon set (material.blue.light).png b/e2e/playwright/tests/common/etalons/SVG icon set (material.blue.light).png new file mode 100644 index 000000000000..1ec9f347cba2 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/SVG icon set (material.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz axis and legend (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz axis and legend (fluent-next.blue.light).png new file mode 100644 index 000000000000..215d613c4ac1 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz axis and legend (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz bar gauge shelf (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz bar gauge shelf (fluent-next.blue.light).png new file mode 100644 index 000000000000..37f50b505f15 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz bar gauge shelf (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz bullet target (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz bullet target (fluent-next.blue.light).png new file mode 100644 index 000000000000..a996631f8067 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz bullet target (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz candlestick reduction (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz candlestick reduction (fluent-next.blue.light).png new file mode 100644 index 000000000000..b6791259cdda Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz candlestick reduction (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz chart crosshair dark (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz chart crosshair dark (fluent-next.blue.light).png new file mode 100644 index 000000000000..0ede1750a14a Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz chart crosshair dark (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz chart crosshair light (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz chart crosshair light (fluent-next.blue.light).png new file mode 100644 index 000000000000..23eeb7483d41 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz chart crosshair light (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz gauge indicating set (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz gauge indicating set (fluent-next.blue.light).png new file mode 100644 index 000000000000..7b94eee48011 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz gauge indicating set (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz gauge indicators (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz gauge indicators (fluent-next.blue.light).png new file mode 100644 index 000000000000..a55e79a503d4 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz gauge indicators (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz map area (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz map area (fluent-next.blue.light).png new file mode 100644 index 000000000000..b4156bb70e1e Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz map area (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz map line (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz map line (fluent-next.blue.light).png new file mode 100644 index 000000000000..37196b81e4ee Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz map line (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz range selector invalid dark (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz range selector invalid dark (fluent-next.blue.light).png new file mode 100644 index 000000000000..c07c71b493e9 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz range selector invalid dark (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz range selector invalid light (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz range selector invalid light (fluent-next.blue.light).png new file mode 100644 index 000000000000..f84e89f40aa9 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz range selector invalid light (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz sankey link (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz sankey link (fluent-next.blue.light).png new file mode 100644 index 000000000000..747112d98f93 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz sankey link (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz sparkline extremes (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz sparkline extremes (fluent-next.blue.light).png new file mode 100644 index 000000000000..239ce0874aae Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz sparkline extremes (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz sparkline line (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz sparkline line (fluent-next.blue.light).png new file mode 100644 index 000000000000..e31460a107c5 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz sparkline line (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz sparkline winloss (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz sparkline winloss (fluent-next.blue.light).png new file mode 100644 index 000000000000..935c5f19cded Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz sparkline winloss (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz tree map tile border (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz tree map tile border (fluent-next.blue.light).png new file mode 100644 index 000000000000..0749b7b2b8a4 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz tree map tile border (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/etalons/Viz tree map tile fill (fluent-next.blue.light).png b/e2e/playwright/tests/common/etalons/Viz tree map tile fill (fluent-next.blue.light).png new file mode 100644 index 000000000000..9dfbc6b756d1 Binary files /dev/null and b/e2e/playwright/tests/common/etalons/Viz tree map tile fill (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/eventsEngine.spec.ts b/e2e/playwright/tests/common/eventsEngine.spec.ts new file mode 100644 index 000000000000..9a1a854a216b --- /dev/null +++ b/e2e/playwright/tests/common/eventsEngine.spec.ts @@ -0,0 +1,51 @@ +import { expect, test } from '../../fixtures'; +import { dragToOffset } from '../../helpers/dragUtils'; + +test.describe('Events', () => { + test('The `dxhoverstart` event should be triggered after dragging and dropping an HTML draggable element (T1260277)', async ({ page }) => { + await page.evaluate(() => { + const markup = `
+
+
+
hoverStartTriggerCount
+
0
+
hoverEndTriggerCount
+
0
+
`; + + $('#container').html(markup); + + const { DevExpress } = (window as any); + + let hoverStartTriggerCount = 0; + let hoverEndTriggerCount = 0; + + DevExpress.events.on($('#target'), 'dxhoverstart', () => { + hoverStartTriggerCount += 1; + + $('#hoverStartTriggerCount').text(hoverStartTriggerCount); + }); + + DevExpress.events.on($('#target'), 'dxhoverend', () => { + hoverEndTriggerCount += 1; + + $('#hoverEndTriggerCount').text(hoverEndTriggerCount); + }); + }); + + const draggable = page.locator('#draggable'); + const target = page.locator('#target'); + + await dragToOffset(page, draggable, 0, 400); + + // A native drag of an HTML draggable element ends the pointer stream with `pointercancel` + // instead of `pointerup`; the event is sent explicitly so the test does not depend on + // whether the browser input delivers it. + await draggable.dispatchEvent('pointercancel'); + + await dragToOffset(page, target, 0, 400); + + await expect(page.locator('#hoverStartTriggerCount')).toHaveText('1'); + await expect(page.locator('#hoverEndTriggerCount')).toHaveText('1'); + }); +}); diff --git a/e2e/testcafe-devextreme/tests/common/gantt/common.ts b/e2e/playwright/tests/common/gantt/common.spec.ts similarity index 57% rename from e2e/testcafe-devextreme/tests/common/gantt/common.ts rename to e2e/playwright/tests/common/gantt/common.spec.ts index 475d90d296cc..28c627716bc5 100644 --- a/e2e/testcafe-devextreme/tests/common/gantt/common.ts +++ b/e2e/playwright/tests/common/gantt/common.spec.ts @@ -1,18 +1,12 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import Guid from 'devextreme/core/guid'; -import { Selector } from 'testcafe'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; +import type { Page } from '@playwright/test'; +import { test } from '../../../fixtures'; import { createWidget } from '../../../helpers/createWidget'; import { appendElementTo, insertStylesheetRulesToPage } from '../../../helpers/domUtils'; -import { Themes } from '../../../helpers/themes'; +import { testScreenshot } from '../../../helpers/screenshots'; const TOOLBAR_ITEM_BUTTON = '.dx-button'; const HIDDEN_SCROLLBAR_THUMB_STYLE = '.dx-gantt .dx-scrollable-scroll { visibility: hidden !important; }'; -fixture`Gantt` - .page(url(__dirname, '../../container-extended.html')); - const data = { tasks: [{ id: 1, @@ -119,46 +113,32 @@ const data = { }], }; -test.meta({ themes: [Themes.materialBlue] })('Gantt - show resources button should not have focus state (T1264485)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await t - .click(Selector(TOOLBAR_ITEM_BUTTON)); - await testScreenshot(t, takeScreenshot, 'Gantt show resourced.png', { element: '#container' }); - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await insertStylesheetRulesToPage(HIDDEN_SCROLLBAR_THUMB_STYLE); - const id = `${new Guid()}`; - await appendElementTo('#container', 'div', id, {}); - await createWidget('dxGantt', { +const createGantt = async (page: Page, toolbarItem: 'showResources' | 'showDependencies'): Promise => { + await insertStylesheetRulesToPage(page, HIDDEN_SCROLLBAR_THUMB_STYLE); + await appendElementTo(page, '#container', 'div', 'gantt'); + await createWidget(page, 'dxGantt', { tasks: { dataSource: data.tasks }, - toolbar: { items: ['showResources'] }, + toolbar: { items: [toolbarItem] }, dependencies: { dataSource: data.dependencies }, resources: { dataSource: data.resources }, resourceAssignments: { dataSource: data.resourceAssignments }, - }, `#${id}`); -}); + }, '#gantt'); +}; -test('Gantt - show dependencies button should not have focus state (T1264485)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); +test.describe('Gantt', () => { + test('Gantt - show resources button should not have focus state (T1264485)', { tag: ['@material.blue.light'] }, async ({ page }) => { + await createGantt(page, 'showResources'); - await t - .click(Selector(TOOLBAR_ITEM_BUTTON)); - await testScreenshot(t, takeScreenshot, 'Gantt show dependencies.png', { element: '#container' }); - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await insertStylesheetRulesToPage(HIDDEN_SCROLLBAR_THUMB_STYLE); - const id = `${new Guid()}`; - await appendElementTo('#container', 'div', id, {}); - await createWidget('dxGantt', { - tasks: { dataSource: data.tasks }, - toolbar: { items: ['showDependencies'] }, - dependencies: { dataSource: data.dependencies }, - resources: { dataSource: data.resources }, - resourceAssignments: { dataSource: data.resourceAssignments }, - }, `#${id}`); + await page.locator(TOOLBAR_ITEM_BUTTON).first().click(); + + await testScreenshot(page, 'Gantt show resourced.png', { element: '#container' }); + }); + + test('Gantt - show dependencies button should not have focus state (T1264485)', async ({ page }) => { + await createGantt(page, 'showDependencies'); + + await page.locator(TOOLBAR_ITEM_BUTTON).first().click(); + + await testScreenshot(page, 'Gantt show dependencies.png', { element: '#container' }); + }); }); diff --git a/e2e/playwright/tests/common/gantt/etalons/Gantt show dependencies (fluent-next.blue.light).png b/e2e/playwright/tests/common/gantt/etalons/Gantt show dependencies (fluent-next.blue.light).png new file mode 100644 index 000000000000..5fc381489388 Binary files /dev/null and b/e2e/playwright/tests/common/gantt/etalons/Gantt show dependencies (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/gantt/etalons/Gantt show dependencies (fluent.blue.light).png b/e2e/playwright/tests/common/gantt/etalons/Gantt show dependencies (fluent.blue.light).png new file mode 100644 index 000000000000..1ea056cfe0f6 Binary files /dev/null and b/e2e/playwright/tests/common/gantt/etalons/Gantt show dependencies (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/gantt/etalons/Gantt show resourced (fluent-next.blue.light).png b/e2e/playwright/tests/common/gantt/etalons/Gantt show resourced (fluent-next.blue.light).png new file mode 100644 index 000000000000..8151bc534cc3 Binary files /dev/null and b/e2e/playwright/tests/common/gantt/etalons/Gantt show resourced (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/gantt/etalons/Gantt show resourced (fluent.blue.light).png b/e2e/playwright/tests/common/gantt/etalons/Gantt show resourced (fluent.blue.light).png new file mode 100644 index 000000000000..7b3c38b5f228 Binary files /dev/null and b/e2e/playwright/tests/common/gantt/etalons/Gantt show resourced (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/gantt/etalons/Gantt show resourced (material.blue.light).png b/e2e/playwright/tests/common/gantt/etalons/Gantt show resourced (material.blue.light).png new file mode 100644 index 000000000000..84830d9604a6 Binary files /dev/null and b/e2e/playwright/tests/common/gantt/etalons/Gantt show resourced (material.blue.light).png differ diff --git a/e2e/testcafe-devextreme/tests/common/icons.ts b/e2e/playwright/tests/common/icons.spec.ts similarity index 69% rename from e2e/testcafe-devextreme/tests/common/icons.ts rename to e2e/playwright/tests/common/icons.spec.ts index 32e37872163d..b87ba2da38b3 100644 --- a/e2e/testcafe-devextreme/tests/common/icons.ts +++ b/e2e/playwright/tests/common/icons.spec.ts @@ -1,14 +1,7 @@ /* eslint-disable spellcheck/spell-checker */ -/* eslint-disable no-restricted-syntax */ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import { ClientFunction } from 'testcafe'; -import Guid from 'devextreme/core/guid'; -import { getThemeName, isFluent, testScreenshot } from '../../helpers/themeUtils'; -import url from '../../helpers/getPageUrl'; -import { - appendElementTo, -} from '../../helpers/domUtils'; -import { Themes } from '../../helpers/themes'; +import { expect, test } from '../../fixtures'; +import { testScreenshot } from '../../helpers/screenshots'; +import { getThemeName, isFluent } from '../../helpers/themeUtils'; const ICON_CLASS = 'dx-icon'; const iconSet = { @@ -344,101 +337,93 @@ const iconSet = { wrench: '\f243', }; -fixture.disablePageReloads`Icons` - .page(url(__dirname, '../container.html')); +const THEMED = { tag: ['@material.blue.light', '@generic.light'] }; -test.meta({ themes: [Themes.materialBlue, Themes.genericLight] })('Icon set', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); +test.describe('Icons', () => { + test('Icon set', THEMED, async ({ page }) => { + const icons = Object.entries(iconSet).map(([iconName, glyph], index) => ({ + id: `dx-icon-${index}`, + iconName, + glyph, + })); - await testScreenshot(t, takeScreenshot, 'Icon set.png'); + await page.evaluate(({ items, iconClass }) => { + const container = document.querySelector('#container'); + if (!container) return; - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - const icons = Object.entries(iconSet).map(([iconName, glyph]) => ({ - id: `dx-${new Guid()}`, - iconName, - glyph, - })); + const fragment = document.createDocumentFragment(); - // eslint-disable-next-line @typescript-eslint/no-shadow - await ClientFunction((icons, ICON_CLASS) => { - const container = document.querySelector('#container'); - if (!container) return; + items.forEach(({ id, iconName, glyph }) => { + const element = document.createElement('div'); + element.id = id; + Object.assign(element.style, { + display: 'inline-flex', + padding: '3px', + border: '1px solid black', + alignItems: 'center', + flexDirection: 'column', + fontSize: '10px', + }); - const fragment = document.createDocumentFragment(); + const iconDiv = document.createElement('div'); + iconDiv.classList.add(iconClass, `${iconClass}-${iconName}`); - for (const { id, iconName, glyph } of icons) { - const element = document.createElement('div'); - element.id = id; - Object.assign(element.style, { - display: 'inline-flex', - padding: '3px', - border: '1px solid black', - alignItems: 'center', - flexDirection: 'column', - fontSize: '10px', - }); + const nameDiv = document.createElement('div'); + nameDiv.textContent = iconName; - const iconDiv = document.createElement('div'); - iconDiv.classList.add(ICON_CLASS, `${ICON_CLASS}-${iconName}`); + const glyphDiv = document.createElement('div'); + glyphDiv.textContent = glyph.replace('\f', '\\f'); - const nameDiv = document.createElement('div'); - nameDiv.textContent = iconName; + element.append(iconDiv, nameDiv, glyphDiv); + fragment.append(element); + }); - const glyphDiv = document.createElement('div'); - glyphDiv.textContent = glyph.replace('\f', '\\f'); + container.append(fragment); + }, { items: icons, iconClass: ICON_CLASS }); - element.append(iconDiv, nameDiv, glyphDiv); - fragment.append(element); - } + await testScreenshot(page, 'Icon set.png'); + }); - container.append(fragment); - }, { dependencies: { iconSet, ICON_CLASS } })(icons, ICON_CLASS); -}); + test('SVG icon set', THEMED, async ({ page, theme }) => { + const iconSetName = isFluent(theme) ? 'fluent' : getThemeName(theme); + const glyphs = Object.values(iconSet); + const icons = Object.entries(iconSet) + .filter(([, glyph], index) => glyphs.indexOf(glyph) === index) + .map(([iconName], index) => ({ + id: `dx-icon-${index}`, + iconName, + src: `../../../packages/devextreme-scss/images/icons/${iconSetName}/${iconName}.svg`, + })); -test.meta({ themes: [Themes.materialBlue, Themes.genericLight] })('SVG icon set', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); + await page.evaluate((items) => { + const container = document.querySelector('#container'); - await testScreenshot(t, takeScreenshot, 'SVG icon set.png'); + items.forEach(({ id, iconName, src }) => { + const element = document.createElement('div'); + element.id = id; + Object.assign(element.style, { + display: 'inline-flex', + padding: '3px', + border: '1px solid black', + alignItems: 'center', + flexDirection: 'column', + fontSize: '10px', + }); - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - const iconSetName = isFluent() ? 'fluent' : getThemeName(); - const glyphs = Object.values(iconSet); - const icons = Object.entries(iconSet) - .filter(([, glyph], index) => glyphs.indexOf(glyph) === index) - .map(([iconName]) => ({ - id: `dx-${new Guid()}`, - iconName, - src: `../../../packages/devextreme-scss/images/icons/${iconSetName}/${iconName}.svg`, - })); - - // eslint-disable-next-line @typescript-eslint/no-shadow - await ClientFunction((icons, appendElementTo) => { - for (const { id, iconName, src } of icons) { - appendElementTo('#container', 'div', id, { - display: 'inline-flex', - padding: '3px', - border: '1px solid black', - alignItems: 'center', - flexDirection: 'column', - fontSize: '10px', - }); - - const el = document.getElementById(id); - if (el) { const img = document.createElement('img'); img.src = src; const nameDiv = document.createElement('div'); nameDiv.textContent = iconName; - el.append(img, nameDiv); - } - } - }, { dependencies: { appendElementTo } })(icons, appendElementTo); + element.append(img, nameDiv); + container?.appendChild(element); + }); + }, icons); + + await expect.poll(() => page.evaluate(() => Array.from(document.images) + .every((image) => image.complete && image.naturalWidth > 0))).toBe(true); + + await testScreenshot(page, 'SVG icon set.png'); + }); }); diff --git a/e2e/playwright/tests/common/pagination/accessibility.spec.ts b/e2e/playwright/tests/common/pagination/accessibility.spec.ts new file mode 100644 index 000000000000..3db126781d15 --- /dev/null +++ b/e2e/playwright/tests/common/pagination/accessibility.spec.ts @@ -0,0 +1,37 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; + +const THEMED = { tag: ['@material.blue.light', '@generic.light'] }; + +test.describe('Pagination', () => { + ['full', 'compact'].forEach((displayMode) => { + [undefined, 'Total {2} items. Page {0} of {1}'].forEach((infoText) => { + [true, false].forEach((showInfo) => { + [true, false].forEach((showNavigationButtons) => { + [true, false].forEach((showPageSizeSelector) => { + const name = `dm_${displayMode}-` + + `${infoText ? 'has' : 'has_no'}_it-` + + `si_${showInfo.toString()}-` + + `snb_${showNavigationButtons.toString()}-` + + `spss_${showPageSizeSelector.toString()}`; + const isThemed = infoText && showInfo && showNavigationButtons && showPageSizeSelector; + + test(`Pagination ${name}`, isThemed ? THEMED : {}, async ({ page }) => { + await createWidget(page, 'dxPagination', { + itemCount: 50, + displayMode, + infoText, + showInfo, + showNavigationButtons, + showPageSizeSelector, + }); + + await testScreenshot(page, `pagination-${name}.png`); + }); + }); + }); + }); + }); + }); +}); diff --git a/e2e/playwright/tests/common/pagination/baseProperties.spec.ts b/e2e/playwright/tests/common/pagination/baseProperties.spec.ts new file mode 100644 index 000000000000..300576ad256f --- /dev/null +++ b/e2e/playwright/tests/common/pagination/baseProperties.spec.ts @@ -0,0 +1,122 @@ +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import Pagination from '../../../models/pagination'; + +test.describe('Pagination Base Properties', () => { + test('Pagination width and height property', async ({ page }) => { + await createWidget(page, 'dxPagination', { + width: 270, + height: '95px', + itemCount: 50, + }); + + const pagination = new Pagination(page, '#container'); + + await expect(pagination.element).toHaveCSS('width', '270px'); + await expect(pagination.element).toHaveCSS('height', '95px'); + await expect(pagination.element).not.toHaveAttribute('width'); + await expect(pagination.element).not.toHaveAttribute('height'); + }); + + test('Pagination elementAttr property', async ({ page }) => { + await createWidget(page, 'dxPagination', { + elementAttr: { + 'aria-label': 'some description', + 'data-test': 'custom data', + }, + }); + + const pagination = new Pagination(page, '#container'); + + await expect(pagination.element).toHaveAttribute('aria-label', 'some description'); + await expect(pagination.element).toHaveAttribute('data-test', 'custom data'); + }); + + test('Pagination hint and accessKey properties', async ({ page }) => { + await createWidget(page, 'dxPagination', { + hint: 'Best Pagination', + accessKey: 'F', + itemCount: 50, + focusStateEnabled: true, + }); + + const pagination = new Pagination(page, '#container'); + + await expect(pagination.element).toHaveAttribute('accesskey', 'F'); + await expect(pagination.element).toHaveAttribute('title', 'Best Pagination'); + }); + + test('Pagination disabled property', async ({ page }) => { + await createWidget(page, 'dxPagination', { + disabled: true, + itemCount: 50, + }); + + const pagination = new Pagination(page, '#container'); + + await expect(pagination.element).toHaveAttribute('aria-disabled', 'true'); + await pagination.expectDisabled(); + }); + + test('Pagination tabindex and state properties', async ({ page }) => { + await createWidget(page, 'dxPagination', { + itemCount: 50, + disabled: false, + width: '100%', + focusStateEnabled: true, + hoverStateEnabled: true, + activeStateEnabled: true, + tabIndex: 7, + }); + + const pagination = new Pagination(page, '#container'); + + await expect(pagination.element).toHaveAttribute('tabindex', '7'); + + await pagination.getNavPage('3').click(); + + await pagination.expectFocused(); + await pagination.expectHovered(); + await pagination.expectActive(false); + + await pagination.element.evaluate((element) => { + $(element).trigger($.Event('dxpointerdown', { + pointers: [{ pointerId: 1 }], + })); + }); + + await pagination.expectActive(); + }); + + test('Pagination focus method & accessKey propery without focusStateEnabled', async ({ page }) => { + await createWidget(page, 'dxPagination', { + focusStateEnabled: false, + accessKey: 'F', + itemCount: 50, + }); + + const pagination = new Pagination(page, '#container'); + + await expect(pagination.element).not.toHaveAttribute('accesskey'); + await expect(pagination.getPageSize(0)).not.toBeFocused(); + + await pagination.focus(); + + await expect(pagination.getPageSize(0)).toBeFocused(); + }); + + test('Pagination focus method with focusStateEnabled', async ({ page }) => { + await createWidget(page, 'dxPagination', { + focusStateEnabled: true, + itemCount: 50, + }); + + const pagination = new Pagination(page, '#container'); + + await expect(pagination.element).not.toBeFocused(); + + await pagination.focus(); + + await expect(pagination.element).toBeFocused(); + }); +}); diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..37188f7c4562 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..2c45bf818e93 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..7f78172a98e1 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..944a60025711 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..37188f7c4562 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..2c45bf818e93 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..7f78172a98e1 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..944a60025711 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..499bdf32b1cd Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..9b60e9b9c309 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..35a696757d9a Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..250371ee0722 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..499bdf32b1cd Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..9b60e9b9c309 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..35a696757d9a Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..250371ee0722 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (generic.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (generic.light).png new file mode 100644 index 000000000000..8968df4cd8f6 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (generic.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (material.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (material.blue.light).png new file mode 100644 index 000000000000..3a0484c1322b Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (material.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..37188f7c4562 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..2c45bf818e93 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..7f78172a98e1 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..944a60025711 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..37188f7c4562 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..2c45bf818e93 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..7f78172a98e1 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..944a60025711 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..c9c2e6b60803 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..4801b2dea556 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..85bb653d3e80 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..67d05ce1f668 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..c9c2e6b60803 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..4801b2dea556 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..85bb653d3e80 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..67d05ce1f668 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..5493797a0696 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..594144efb972 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..228e315fa2f2 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..d5d23c074480 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..ac306c69c1a4 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..e6f65cd704ba Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..a85d7ed158c2 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..076dfb75b73d Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..c1c6ea378184 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..db8ad6ec4fc3 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..409b2e257d10 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..5172b3a96eb4 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..3a6816a4f710 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..26d910b09d18 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..0c2c2ee0ee3f Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..1a28c36f9097 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (generic.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (generic.light).png new file mode 100644 index 000000000000..ef5ba838c67f Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (generic.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (material.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (material.blue.light).png new file mode 100644 index 000000000000..54936f03c4cf Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (material.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..5493797a0696 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..594144efb972 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..228e315fa2f2 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..d5d23c074480 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..ac306c69c1a4 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..e6f65cd704ba Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..a85d7ed158c2 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..076dfb75b73d Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..a19c8af7e28e Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..b3b0c8239720 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..851c6cfa992f Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..bf95c820bb81 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png new file mode 100644 index 000000000000..b37a33d8a796 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png new file mode 100644 index 000000000000..022cbdbae9be Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png new file mode 100644 index 000000000000..8471615d4f95 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png new file mode 100644 index 000000000000..b101e7512cd3 Binary files /dev/null and b/e2e/playwright/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/common/pagination/index.spec.ts b/e2e/playwright/tests/common/pagination/index.spec.ts new file mode 100644 index 000000000000..f6895a77ba78 --- /dev/null +++ b/e2e/playwright/tests/common/pagination/index.spec.ts @@ -0,0 +1,63 @@ +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import Pagination from '../../../models/pagination'; + +test.describe('Pagination Base Properties', () => { + test('Pagination visibile property', async ({ page }) => { + await createWidget(page, 'dxPagination', { + itemCount: 50, + visible: false, + }); + + const pagination = new Pagination(page, '#container'); + + await pagination.expectClass('dx-state-invisible'); + }); + + test('PageSize selector test', async ({ page }) => { + await createWidget(page, 'dxPagination', { + itemCount: 50, + pageIndex: 2, + pageSize: 8, + allowedPageSizes: [2, 4, 8], + }); + + const pagination = new Pagination(page, '#container'); + + await pagination.getPageSize(1).click(); + + await expect.poll(() => pagination.option('pageCount')).toBe(13); + }); + + test('PageIndex test', async ({ page }) => { + await createWidget(page, 'dxPagination', { + itemCount: 50, + pageIndex: 1, + pageSize: 5, + }); + + const pagination = new Pagination(page, '#container'); + + await expect.poll(() => pagination.option('pageIndex')).toBe(1); + + await pagination.getNavPage('5').click(); + + await expect.poll(() => pagination.option('pageIndex')).toBe(5); + }); + + test('PageIndex correction test', async ({ page }) => { + await createWidget(page, 'dxPagination', { + itemCount: 50, + pageIndex: 10, + pageSize: 5, + }); + + const pagination = new Pagination(page, '#container'); + + await expect.poll(() => pagination.option('pageIndex')).toBe(10); + + await pagination.getPageSize(1).click(); + + await expect.poll(() => pagination.option('pageIndex')).toBe(5); + }); +}); diff --git a/e2e/playwright/tests/common/shadowDOM.spec.ts b/e2e/playwright/tests/common/shadowDOM.spec.ts new file mode 100644 index 000000000000..8df48ce6f9b8 --- /dev/null +++ b/e2e/playwright/tests/common/shadowDOM.spec.ts @@ -0,0 +1,92 @@ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../fixtures'; + +const dxWidgetHostStyles = '.dx-widget-shadow { font-size: 20px; }'; +const dxWidgetShadowStyles = '.dx-widget-shadow { font-size: 40px; }'; + +const setupShadowDomTest = (page: Page, copyStylesToShadowDom: boolean): Promise => page + .evaluate(({ copyStyles, hostStyles, shadowStyles }) => { + if (!copyStyles) { + (window as any).DevExpress.config({ copyStylesToShadowDom: copyStyles }); + } + + const container = document.createElement('div'); + container.id = 'shadow-host'; + document.body.appendChild(container); + + const hostStyleElement = document.createElement('style'); + hostStyleElement.innerHTML = hostStyles; + document.head.appendChild(hostStyleElement); + + const shadowRoot = container.attachShadow({ mode: 'open' }); + + const shadowStyleElement = shadowRoot.ownerDocument.createElement('style'); + shadowStyleElement.innerHTML = shadowStyles; + shadowRoot.appendChild(shadowStyleElement); + + const shadowContainerElement = document.createElement('div'); + shadowContainerElement.id = 'shadow-container'; + shadowRoot.appendChild(shadowContainerElement); + + (window as any).testShadowRoot = shadowRoot; + + // eslint-disable-next-line new-cap, no-new + new (window as any).DevExpress.ui.dxButton(shadowContainerElement, { + text: 'Test button', + }); + }, { + copyStyles: copyStylesToShadowDom, + hostStyles: dxWidgetHostStyles, + shadowStyles: dxWidgetShadowStyles, + }); + +const getAdoptedStyleSheets = (page: Page): Promise<{ + firstSheetRules: string[] | null; + secondSheetRules: string[] | null; +}> => page.evaluate(() => { + const shadowRoot = (window as any).testShadowRoot; + const { adoptedStyleSheets } = shadowRoot; + + const results: { firstSheetRules: string[] | null; secondSheetRules: string[] | null } = { + firstSheetRules: null, + secondSheetRules: null, + }; + + if (adoptedStyleSheets.length > 1) { + results.firstSheetRules = Array + .from(adoptedStyleSheets[0].cssRules as CSSRuleList).map((rule) => rule.cssText); + + results.secondSheetRules = Array + .from(adoptedStyleSheets[1].cssRules as CSSRuleList).map((rule) => rule.cssText); + } + + return results; +}); + +test.describe('Shadow DOM - Adopted DX css styles', () => { + test('Copies DX css styles from the host to the shadow root when rendering a DX widget', async ({ page }) => { + await setupShadowDomTest(page, true); + + await expect.poll(async () => { + const { firstSheetRules } = await getAdoptedStyleSheets(page); + + return firstSheetRules?.some((rule) => rule === dxWidgetHostStyles); + }, { message: 'First adopted stylesheet contains host styles' }).toBe(true); + + await expect.poll(async () => { + const { secondSheetRules } = await getAdoptedStyleSheets(page); + + return secondSheetRules?.some((rule) => rule === dxWidgetShadowStyles); + }, { message: 'Second adopted stylesheet contains shadow styles' }).toBe(true); + }); + + test('Does not copy DX css styles when copyStylesToShadowDom is disabled', async ({ page }) => { + await setupShadowDomTest(page, false); + + await expect.poll(async () => { + const { firstSheetRules, secondSheetRules } = await getAdoptedStyleSheets(page); + + return firstSheetRules === null && secondSheetRules === null; + }, { message: 'No adopted stylesheets should be created when copyStylesToShadowDom is disabled' }).toBe(true); + }); +}); diff --git a/e2e/playwright/tests/common/themeModes.spec.ts b/e2e/playwright/tests/common/themeModes.spec.ts new file mode 100644 index 000000000000..b6ea78b74bcd --- /dev/null +++ b/e2e/playwright/tests/common/themeModes.spec.ts @@ -0,0 +1,1016 @@ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../fixtures'; +import { createWidget } from '../../helpers/createWidget'; +import { getThemeName } from '../../helpers/themeUtils'; + +const MODE_DEPENDENT = ['--dxds-color-bg', '--dxds-color-content']; +const SYSTEM_TIER = ['--dx-global-content', '--dx-surface-overlay', '--dx-focus-rect-outline']; + +const modesOf = (theme: string): { buildMode: string; oppositeMode: string } => { + const buildMode = theme.includes('.dark') ? 'dark' : 'light'; + + return { buildMode, oppositeMode: buildMode === 'dark' ? 'light' : 'dark' }; +}; + +const render = (page: Page, markup: string): Promise => page.evaluate((html) => { + const container = document.querySelector('#container'); + + if (container) container.innerHTML = html; +}, markup); + +const valueAt = async (page: Page, selector: string, property: string): Promise => ( + await page.evaluate(({ target, name }) => { + const element = document.querySelector(target) as Element; + + return window.getComputedStyle(element).getPropertyValue(name); + }, { target: selector, name: property }) +).trim(); + +const reportedMode = (page: Page, selector: string): Promise => page.evaluate( + (target) => (window as any).DevExpress.ui.themes.mode(document.querySelector(target)), + selector, +); + +const setScopeMode = ( + page: Page, + selector: string, + mode: string, + tell: boolean, +): Promise => page.evaluate(({ target, scopeMode, refresh }) => { + const scope = document.querySelector(target) as HTMLElement; + + scope.classList.remove('dx-theme-mode-light', 'dx-theme-mode-dark'); + scope.classList.add(`dx-theme-mode-${scopeMode}`); + + if (refresh) { + (window as any).DevExpress.ui.themes.refreshMode(); + } +}, { target: selector, scopeMode: mode, refresh: tell }); + +const CHART = { + dataSource: [{ month: 'a', sales: 1 }, { month: 'b', sales: 2 }], + series: [{ type: 'bar', argumentField: 'month', valueField: 'sales' }], + legend: { visible: false }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, +}; + +const MAP_WITH_LABELLED_MARKERS = { + layers: [{ + type: 'marker', + dataSource: { + type: 'FeatureCollection', + features: [{ + type: 'Feature', + geometry: { type: 'Point', coordinates: [0, 0] }, + properties: { text: 'a' }, + }], + }, + label: { enabled: true, dataField: 'text' }, + }], + size: { width: 220, height: 160 }, +}; + +const writeRootProperty = (page: Page, name: string, value: string): Promise => page + .evaluate(({ property, propertyValue }) => { + const root = document.documentElement; + + if (propertyValue) { + root.style.setProperty(property, propertyValue); + } else { + root.style.removeProperty(property); + } + }, { property: name, propertyValue: value }); + +interface Exported { references: number; painted: string } + +const exportedFrom = ( + page: Page, + selector: string, + widgetName: string, + paintedSelector: string, + paintedAttribute: string, +): Promise => page.evaluate(({ + target, name, paintedTarget, attribute, +}) => { + const instance = ($(target) as any)[name]('instance'); + const markup = (window as any).DevExpress.viz.getMarkup([instance]); + const painted = new DOMParser().parseFromString(markup, 'image/svg+xml').querySelector(paintedTarget); + + return { + references: (markup.match(/var\(--dx-/g) ?? []).length, + painted: painted?.getAttribute(attribute) ?? '', + }; +}, { + target: selector, name: widgetName, paintedTarget: paintedSelector, attribute: paintedAttribute, +}); + +const exportedChartFrom = (page: Page, selector: string): Promise => exportedFrom(page, selector, 'dxChart', 'text', 'style'); + +const exportedHaloFrom = (page: Page, selector: string): Promise => exportedFrom(page, selector, 'dxVectorMap', '[stroke-linejoin="round"]', 'stroke'); + +const DECLARED_BLUE = 'rgb(11, 7, 3)'; +const DECLARED_BG = 'rgb(22, 7, 3)'; +const HANDED_OUT_BLUE = '#0b0703'; + +const declareTheNamesTheWidgetsRead = ( + page: Page, + blue: string, + background: string, +): Promise => page.evaluate(({ vizBlue, vizBg }) => { + document.documentElement.style.setProperty('--dx-viz-blue', vizBlue); + document.documentElement.style.setProperty('--dx-viz-bg', vizBg); +}, { vizBlue: blue, vizBg: background }); + +const colorsHandedOutByTheWidget = (page: Page): Promise<(string | undefined)[]> => page + .evaluate(() => { + const { widget } = (window as any); + const series = widget.getAllSeries?.() ?? []; + const items = widget.getAllItems?.() ?? []; + + return [ + ...series.flatMap((one) => [ + one.getColor(), + ...one.getAllPoints().map((point) => point.getColor()), + ]), + ...items.map((item) => item.getColor()), + ]; + }); + +const markupOfTheWidget = (page: Page): Promise<{ svg: string; unresolved: string[] }> => page + .evaluate(() => { + const svg = (window as any).widget.svg(); + const left = (svg.match(/var\(--dx-[a-z-]+/g) ?? []) as string[]; + + return { svg, unresolved: left.filter((value, index) => left.indexOf(value) === index) }; + }); + +const expectPaintedFrom = async (page: Page, declared: string): Promise => { + await expect.poll( + async () => (await markupOfTheWidget(page)).svg, + { message: 'the markup carries what the cascade resolved, not the literal the theme writes beside the name' }, + ).toContain(declared); + await expect.poll( + async () => (await markupOfTheWidget(page)).unresolved, + { message: 'and no reference survives into the markup' }, + ).toEqual([]); +}; + +const expectHandedOut = async (page: Page, colors: (string | undefined)[]): Promise => { + await expect.poll( + () => colorsHandedOutByTheWidget(page), + { message: 'getColor answers with the colour the cascade resolved, normalised to hex' }, + ).toEqual(colors); +}; + +const DECLARED_IN_OKLCH = 'oklch(0.55 0.15 250)'; + +const declaredAsRgb = (page: Page, declared: string): Promise => page.evaluate((color) => { + const probe = document.createElement('div'); + + document.body.appendChild(probe); + probe.style.color = `color-mix(in srgb, ${color} 100%, transparent)`; + + const channels = (getComputedStyle(probe).color.match(/-?[\d.]+(?:e-?\d+)?/g) ?? []) + .slice(0, 3) + .map((value) => Math.round(Math.min(1, Math.max(0, Number(value))) * 255)); + + probe.remove(); + + return `#${channels.map((value) => value.toString(16).padStart(2, '0')).join('')}`; +}, declared); + +const WIDGETS_UNDER_TEST = [ + 'dxChart', 'dxPieChart', 'dxPolarChart', 'dxFunnel', 'dxSankey', 'dxTreeMap', 'dxVectorMap', + 'dxSparkline', 'dxBullet', 'dxBarGauge', 'dxCircularGauge', 'dxLinearGauge', 'dxRangeSelector', +]; + +const vizWidgetsExposed = (page: Page): Promise => page.evaluate( + () => Object.keys((window as any).DevExpress.viz) + .filter((name) => /^dx[A-Z]/.test(name)) + .sort(), +); + +const HANDED_OUT_BG = '#160703'; +const FLUENT_NEXT_THEMES = [ + 'fluent-next.blue.light', 'fluent-next.blue.light.compact', + 'fluent-next.blue.dark', 'fluent-next.blue.dark.compact', +]; +const EXTENSION_MODES = ['blend', 'alternate', 'extrapolate']; +const FINAL_COLOR = /^(#[0-9a-f]{6}|rgba\()/; + +const declareTheNames = (page: Page): Promise => declareTheNamesTheWidgetsRead( + page, + DECLARED_BLUE, + DECLARED_BG, +); + +const colorsHandedOutByTheNamespace = (page: Page): Promise> => page + .evaluate(() => { + const { viz } = (window as any).DevExpress; + const theme = viz.getTheme('fluent-next.blue.light'); + + return { + simpleSet: viz.getPalette('Fluent Next').simpleSet[0], + gradientSet: viz.getPalette('Fluent Next').gradientSet[0], + generated: viz.generateColors('Fluent Next', 6)[0], + marker: theme.map['layer:marker:dot'].color, + bullet: theme.bullet.color, + rangebar: theme.gauge.valueIndicators.rangebar.color, + background: theme.backgroundColor, + findTheme: viz.findTheme('fluent-next.blue.light').bullet.color, + }; + }); + +const valuesLeftToTheBrowser = ( + page: Page, + names: string[], +): Promise<{ leaves: number; left: string[] }> => page.evaluate((themeNames) => { + const { viz } = (window as any).DevExpress; + const leaves: string[] = []; + const walk = (value: unknown): void => { + if (typeof value === 'string') { + leaves.push(value); + } else if (value && typeof value === 'object') { + Object.values(value).forEach(walk); + } + }; + + themeNames.forEach((name) => walk(viz.getTheme(name))); + + return { leaves: leaves.length, left: leaves.filter((leaf) => /var\(|color-mix\(|from /.test(leaf)) }; +}, names); + +const generatedPastThePalette = (page: Page, mode: string): Promise => page.evaluate( + (extensionMode) => (window as any).DevExpress.viz + .generateColors('Fluent Next', 20, { paletteExtensionMode: extensionMode, useHighlight: true }) as string[], + mode, +); + +const CUSTOM_ACCENT = '#b02e0c'; + +const accentHandedOutByThePalette = (page: Page, accent: string): Promise => page + .evaluate((color) => { + const { ui, viz } = (window as any).DevExpress; + + ui.themes.customAccentColor(color); + + return viz.getPalette('Fluent Next').accentColor; + }, accent); + +const watchTheCallbacks = (page: Page): Promise => page.evaluate(() => { + (window as any).handedToTheCallbacks = {}; +}); + +const colorsHandedToTheCallbacks = (page: Page): Promise> => page + .evaluate(() => (window as any).handedToTheCallbacks); + +const gradientStopsExportedToTheCanvas = (page: Page): Promise<{ + stops: string[]; + stopColorAttribute: string; + failure: string; +}> => page.evaluate(() => new Promise((resolve) => { + const { widget } = (window as any); + const nativeAddColorStop = CanvasGradient.prototype.addColorStop; + const stops: string[] = []; + const stopColorAttribute = document.querySelector('#container stop')?.getAttribute('stop-color') ?? ''; + let settled = false; + + const settle = (failure = ''): void => { + if (settled) { + return; + } + + settled = true; + CanvasGradient.prototype.addColorStop = nativeAddColorStop; + resolve({ stops, stopColorAttribute, failure }); + }; + + CanvasGradient.prototype.addColorStop = function watchedAddColorStop(offset, color) { + stops.push(String(color)); + + try { + nativeAddColorStop.call(this, offset, color); + } catch (error) { + settle(String(error)); + throw error; + } + }; + + widget.on('fileSaving', (e: { cancel: boolean }) => { + e.cancel = true; + settle(); + }); + + try { + widget.exportTo('probe', 'PNG'); + } catch (error) { + settle(String(error)); + } +})); + +const TOOLTIP = '.dxc-tooltip'; +const CLOUD = `${TOOLTIP} path`; + +const hoverTheTallestBar = async (page: Page): Promise => { + const bars = page.locator('#chart .dxc-series rect'); + const tallest = await bars.evaluateAll((rects) => { + const heights = rects.map((rect) => rect.getBoundingClientRect().height); + + return heights.indexOf(Math.max(...heights)); + }); + + await bars.nth(tallest).hover(); +}; + +const chartWithTooltipInTheOtherMode = async (page: Page, oppositeMode: string): Promise => { + await render(page, `
`); + await createWidget(page, 'dxChart', { ...CHART, tooltip: { enabled: true } }, '#chart'); +}; + +const colorOfTheNameIn = (page: Page, selector: string, name: string): Promise => page + .evaluate(({ target, property }) => { + const probe = document.createElement('div'); + + probe.style.color = `var(${property})`; + document.querySelector(target)?.appendChild(probe); + + const { color } = window.getComputedStyle(probe); + + probe.remove(); + + return color; + }, { target: selector, property: name }); + +const cloudPlacement = (page: Page): Promise> => page.evaluate(() => { + const cloud = document.querySelector('.dxc-tooltip path'); + const box = cloud?.getBoundingClientRect(); + + return { + left: box?.left, + top: box?.top, + width: box?.width, + height: box?.height, + outline: cloud?.getAttribute('d'), + }; +}); + +const putTheTooltipInBody = (page: Page): Promise => page.evaluate(() => { + (window as any).widget.option('tooltip.container', 'body'); +}); + +const twoChartsInTwoModes = async (page: Page): Promise => { + await render(page, ` +
+
+ `); + + await createWidget(page, 'dxChart', CHART, '#light-chart'); + await createWidget(page, 'dxChart', CHART, '#dark-chart'); +}; + +test.describe('Theme modes', () => { + test.skip(({ theme }) => getThemeName(theme) !== 'fluent-next', 'fluent-next only'); + + test('dxChart paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxChart', { + ...{ + dataSource: [{ a: 'x', v: 1 }], + series: [{ argumentField: 'a', valueField: 'v' }], + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectHandedOut(page, [HANDED_OUT_BLUE, HANDED_OUT_BLUE]); + await expectPaintedFrom(page, DECLARED_BLUE); + }); + + test('dxChart hands out a name declared in another colour space as the sRGB colour it paints', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_IN_OKLCH, DECLARED_BG); + await createWidget(page, 'dxChart', { + dataSource: [{ a: 'x', v: 1 }], + series: [{ argumentField: 'a', valueField: 'v' }], + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + const expected = await declaredAsRgb(page, DECLARED_IN_OKLCH); + + await expect.poll( + () => colorsHandedOutByTheWidget(page), + { message: 'getColor brings the colour to sRGB instead of reading its channels as red, green and blue' }, + ).toEqual([expected, expected]); + }); + + test('dxPieChart paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxPieChart', { + ...{ + dataSource: [{ a: 'x', v: 1 }], + series: [{ argumentField: 'a', valueField: 'v' }], + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectHandedOut(page, [undefined, HANDED_OUT_BLUE]); + await expectPaintedFrom(page, DECLARED_BLUE); + }); + + test('dxPolarChart paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxPolarChart', { + ...{ + dataSource: [{ a: 'x', v: 1 }], + series: [{ argumentField: 'a', valueField: 'v' }], + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectHandedOut(page, [HANDED_OUT_BLUE, HANDED_OUT_BLUE]); + await expectPaintedFrom(page, DECLARED_BLUE); + }); + + test('dxFunnel paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxFunnel', { + ...{ + dataSource: [{ a: 'x', v: 3 }], + argumentField: 'a', + valueField: 'v', + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectHandedOut(page, [HANDED_OUT_BLUE]); + await expectPaintedFrom(page, DECLARED_BLUE); + }); + + test('dxSankey paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxSankey', { + ...{ + dataSource: [{ source: 'A', target: 'X', weight: 1 }], + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectPaintedFrom(page, DECLARED_BLUE); + }); + + test('dxTreeMap paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxTreeMap', { + ...{ + dataSource: [{ name: 'a', value: 1 }], + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectPaintedFrom(page, DECLARED_BLUE); + }); + + test('dxVectorMap paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxVectorMap', { + ...{ + layers: [{ + type: 'marker', + dataSource: { + type: 'FeatureCollection', + features: [{ type: 'Feature', geometry: { type: 'Point', coordinates: [0, 0] }, properties: { text: 'a' } }], + }, + label: { enabled: true, dataField: 'text' }, + }], + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectPaintedFrom(page, DECLARED_BLUE); + }); + + test('dxSparkline paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxSparkline', { + ...{ + dataSource: [1, 4, 2], + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectPaintedFrom(page, DECLARED_BG); + }); + + test('dxBullet paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxBullet', { + ...{ + value: 40, + target: 60, + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectPaintedFrom(page, DECLARED_BLUE); + }); + + test('dxBarGauge paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxBarGauge', { + ...{ + values: [30], + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectPaintedFrom(page, DECLARED_BLUE); + }); + + test('dxCircularGauge paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxCircularGauge', { + ...{ + value: 40, + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectPaintedFrom(page, DECLARED_BG); + }); + + test('dxLinearGauge paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxLinearGauge', { + ...{ + value: 40, + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectPaintedFrom(page, DECLARED_BLUE); + }); + + test('dxRangeSelector paints from a name the page declared, leaving no reference behind', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxRangeSelector', { + ...{ + scale: { startValue: 0, endValue: 10 }, + }, + behavior: { animationEnabled: false }, + size: { width: 220, height: 160 }, + }); + + await expectPaintedFrom(page, DECLARED_BG); + }); + + test('every viz widget the namespace exposes has a test of its own', async ({ page }) => { + await expect.poll(() => vizWidgetsExposed(page)).toEqual([...WIDGETS_UNDER_TEST].sort()); + }); + + test('the palette and theme functions hand out the colour the page declared, not the name', async ({ page }) => { + await declareTheNames(page); + + await expect.poll(() => colorsHandedOutByTheNamespace(page)).toEqual({ + simpleSet: HANDED_OUT_BLUE, + gradientSet: HANDED_OUT_BLUE, + generated: HANDED_OUT_BLUE, + marker: HANDED_OUT_BLUE, + bullet: HANDED_OUT_BLUE, + rangebar: HANDED_OUT_BLUE, + background: HANDED_OUT_BG, + findTheme: HANDED_OUT_BLUE, + }); + }); + + test('no fluent-next theme hands out a name, a mix or a relative colour', async ({ page }) => { + await declareTheNames(page); + + await expect.poll( + async () => (await valuesLeftToTheBrowser(page, FLUENT_NEXT_THEMES)).leaves, + { message: 'the walk reached the whole of every theme' }, + ).toBeGreaterThan(FLUENT_NEXT_THEMES.length * 100); + await expect.poll( + async () => (await valuesLeftToTheBrowser(page, FLUENT_NEXT_THEMES)).left, + { message: 'every value is one an application can use as it is' }, + ).toEqual([]); + }); + + test('generateColors extends the palette past its size into final colours only', async ({ page }) => { + await declareTheNames(page); + + for (const mode of EXTENSION_MODES) { + const colors = await generatedPastThePalette(page, mode); + + expect(colors.length, `${mode} hands out every colour asked for`).toBe(20); + expect( + colors.filter((color) => !FINAL_COLOR.test(color)), + `${mode} hands out only colours an application can parse`, + ).toEqual([]); + expect(new Set(colors).size, `${mode} extends the palette with colours of its own`).toBeGreaterThan(6); + } + }); + + test('a custom accent is handed out as the colour it paints, not the relative colour it is derived with', async ({ page }) => { + expect(await accentHandedOutByThePalette(page, CUSTOM_ACCENT)).toBe(CUSTOM_ACCENT); + await expect.poll( + async () => (await valuesLeftToTheBrowser(page, FLUENT_NEXT_THEMES)).left, + { message: 'no theme hands the accent out as a relative colour either' }, + ).toEqual([]); + }); + + test('the legend and tooltip callbacks hand out the colour a widget paints, not the name', async ({ page }) => { + await declareTheNames(page); + await watchTheCallbacks(page); + await render(page, '
'); + await createWidget(page, 'dxChart', () => ({ + dataSource: [{ a: 'x', v: 1 }], + series: [{ argumentField: 'a', valueField: 'v' }], + legend: { + customizeText(info) { + if (info.seriesIndex === 0) { + (window as any).handedToTheCallbacks.seriesColor = info.seriesColor; + } + return String(info.seriesName); + }, + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }), '#chart'); + await createWidget(page, 'dxPieChart', () => ({ + dataSource: [{ a: 'x', v: 1 }, { a: 'y', v: 2 }], + series: [{ argumentField: 'a', valueField: 'v' }], + legend: { + customizeText(info) { + if (info.pointIndex === 0) { + (window as any).handedToTheCallbacks.pointColor = info.pointColor; + } + return String(info.pointName); + }, + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }), '#pie'); + await createWidget(page, 'dxBarGauge', () => ({ + values: [30, 60], + legend: { + visible: true, + customizeText(info) { + if (info.item.index === 0) { + (window as any).handedToTheCallbacks.barColor = info.item.color; + } + return String(info.text); + }, + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }), '#bar-gauge'); + await createWidget(page, 'dxVectorMap', () => ({ + layers: [{ + name: 'markers', + type: 'marker', + elementType: 'bubble', + dataField: 'value', + colorGroupingField: 'value', + colorGroups: [0, 5, 10], + dataSource: { + type: 'FeatureCollection', + features: [ + { type: 'Feature', geometry: { type: 'Point', coordinates: [0, 0] }, properties: { value: 1 } }, + { type: 'Feature', geometry: { type: 'Point', coordinates: [20, 20] }, properties: { value: 8 } }, + ], + }, + }], + legends: [{ + source: { layer: 'markers', grouping: 'color' }, + customizeText(info) { + if (info.index === 0) { + (window as any).handedToTheCallbacks.groupColor = info.color; + } + return String(info.index); + }, + }], + size: { width: 220, height: 160 }, + }), '#map'); + await createWidget(page, 'dxLinearGauge', () => ({ + value: 40, + valueIndicator: { type: 'rangeBar' }, + tooltip: { + enabled: true, + customizeTooltip(info) { + (window as any).handedToTheCallbacks.indicatorColor = info.color; + return { text: String(info.valueText) }; + }, + }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }), '#linear-gauge'); + + await page.locator('#linear-gauge .dxg-tracker path').hover(); + + await expect.poll(() => colorsHandedToTheCallbacks(page)).toEqual({ + seriesColor: HANDED_OUT_BLUE, + pointColor: HANDED_OUT_BLUE, + barColor: HANDED_OUT_BLUE, + groupColor: HANDED_OUT_BLUE, + indicatorColor: HANDED_OUT_BLUE, + }); + }); + + test('a chart exported from a mode scope keeps the background of the scope', async ({ page, theme }) => { + const { oppositeMode } = modesOf(theme); + + await render(page, `
`); + await createWidget(page, 'dxChart', CHART, '#scoped-chart'); + + const scopeBackground = await valueAt(page, '#scoped-chart', '--dx-viz-bg'); + const pageBackground = await valueAt(page, 'html', '--dx-viz-bg'); + const painted = async (): Promise => (await exportedFrom(page, '#scoped-chart', 'dxChart', 'svg', 'data-backgroundcolor')).painted; + + await expect.poll(painted, { message: 'the markup carries the background the chart is painted on' }) + .toBe(scopeBackground); + await expect.poll(painted, { message: 'not the background of the page around the scope' }) + .not.toBe(pageBackground); + }); + + test('exportTo hands a gradient stop the colour the name resolved to', async ({ page }) => { + await declareTheNamesTheWidgetsRead(page, DECLARED_BLUE, DECLARED_BG); + await createWidget(page, 'dxSankey', { + dataSource: [{ source: 'A', target: 'X', weight: 1 }], + link: { colorMode: 'gradient' }, + animation: { enabled: false }, + size: { width: 220, height: 160 }, + }); + + const { stops, stopColorAttribute, failure } = await gradientStopsExportedToTheCanvas(page); + + expect(stopColorAttribute, 'the widget writes the name into the attribute, so the exporter is the one that has to resolve it').toBe('var(--dx-viz-blue, #0078d4)'); + expect(failure, 'the export reaches onFileSaving instead of failing in addColorStop').toBe(''); + expect(stops.filter((stop) => stop.includes('var(')), 'no stop reaches the canvas as a reference').toEqual([]); + expect(stops[0], 'the first stop carries what the page declared, neither the name nor the literal beside it').toBe(DECLARED_BLUE); + }); + + test('a named mode class re-resolves the roles under it', async ({ page, theme }) => { + const { buildMode } = modesOf(theme); + + await render(page, ` +
+
+
+ `); + + await expect.poll(() => valueAt(page, '#plain', '--dx-theme-mode')).toBe(buildMode); + await expect.poll(() => valueAt(page, '#light', '--dx-theme-mode')).toBe('light'); + await expect.poll(() => valueAt(page, '#dark', '--dx-theme-mode')).toBe('dark'); + + for (const role of MODE_DEPENDENT) { + const dark = await valueAt(page, '#dark', role); + const light = await valueAt(page, '#light', role); + + await expect.poll(() => valueAt(page, '#light', role), { message: `${role} must differ between the two named modes` }) + .not.toBe(dark); + await expect.poll(() => valueAt(page, '#plain', role), { message: `${role} without a class is the bundle's mode` }) + .toBe(buildMode === 'dark' ? dark : light); + } + }); + + test('inverted flips against the nearest named scope', async ({ page, theme }) => { + const { buildMode, oppositeMode } = modesOf(theme); + + await render(page, ` +
+
+
+
+
+
+
+
+
+
+
+ `); + + await expect.poll(() => valueAt(page, '#bare', '--dx-theme-mode'), { message: 'with no named scope above it, inverted opposes the bundle' }) + .toBe(oppositeMode); + await expect.poll(() => valueAt(page, '#in-dark', '--dx-theme-mode')).toBe('light'); + await expect.poll(() => valueAt(page, '#in-light', '--dx-theme-mode')).toBe('dark'); + await expect.poll(() => valueAt(page, '#nested', '--dx-theme-mode'), { message: 'inverted inside inverted flips back' }) + .toBe(buildMode); + await expect.poll(() => valueAt(page, '#nested-in-dark', '--dx-theme-mode'), { message: 'the pair resolves against the dark scope around it' }) + .toBe('dark'); + }); + + test('the system tier follows the mode instead of freezing at the bundle', async ({ page, theme }) => { + const { oppositeMode } = modesOf(theme); + + await render(page, `
`); + + for (const name of SYSTEM_TIER) { + const atTheRoot = await valueAt(page, 'html', name); + + await expect.poll(() => valueAt(page, '#probe', name), { message: `${name} must re-resolve inside a mode scope` }) + .not.toBe(atTheRoot); + } + }); + + test('themes.mode answers for the element, not for the loaded file', async ({ page, theme }) => { + const { buildMode, oppositeMode } = modesOf(theme); + + await render(page, ` +
+
+
+ `); + + await expect.poll(() => reportedMode(page, '#plain'), { message: 'no scope above it - the loaded theme answers' }) + .toBe(buildMode); + await expect.poll(() => reportedMode(page, '#scoped'), { message: 'the mode is inherited from the scope, not declared here' }) + .toBe(oppositeMode); + await expect.poll(() => reportedMode(page, '#back'), { message: 'and inverted inside it flips back' }) + .toBe(buildMode); + + for (const id of ['#plain', '#scoped', '#back']) { + const declared = await valueAt(page, id, '--dx-theme-mode'); + + await expect.poll(() => reportedMode(page, id)).toBe(declared); + } + }); + + test('an overlay is painted in the mode of the element that owns it', async ({ page, theme }) => { + const { oppositeMode } = modesOf(theme); + + await render(page, `
`); + + await createWidget(page, 'dxPopup', { + visible: true, width: 100, height: 100, animation: null, + }, '#owner'); + + await expect(page.locator('.dx-popup-wrapper')).not.toHaveCount(0); + await expect.poll(() => valueAt(page, '.dx-popup-wrapper', '--dx-theme-mode')).toBe(oppositeMode); + + const ownerBackground = await valueAt(page, '#owner', '--dxds-color-bg'); + + await expect.poll(() => valueAt(page, '.dx-popup-wrapper', '--dxds-color-bg'), { message: 'the overlay resolves the same roles as its owner' }) + .toBe(ownerBackground); + }); + + test('a chart tooltip is painted in the mode of the scope its chart is in', async ({ page, theme }) => { + const { oppositeMode } = modesOf(theme); + + await chartWithTooltipInTheOtherMode(page, oppositeMode); + + await hoverTheTallestBar(page); + + await expect(page.locator(CLOUD), 'the tooltip is drawn').not.toHaveCount(0); + + const painted = await valueAt(page, CLOUD, 'fill'); + + expect(painted, 'the cloud takes --dx-viz-tooltip-bg from the scope of its chart') + .toBe(await colorOfTheNameIn(page, '#scope', '--dx-viz-tooltip-bg')); + expect(painted, 'not from the page around the scope') + .not.toBe(await colorOfTheNameIn(page, '#container', '--dx-viz-tooltip-bg')); + await expect( + page.locator(`.dx-theme-mode-${oppositeMode}`).filter({ has: page.locator(TOOLTIP) }), + 'the tooltip is attached inside a scope of that mode', + ).not.toHaveCount(0); + }); + + test('a chart tooltip in a mode scope lands where the same tooltip lands in body', async ({ page, theme }) => { + const { oppositeMode } = modesOf(theme); + + await chartWithTooltipInTheOtherMode(page, oppositeMode); + + await hoverTheTallestBar(page); + + await expect(page.locator(CLOUD), 'the tooltip is drawn').not.toHaveCount(0); + + const inTheScope = await cloudPlacement(page); + + await putTheTooltipInBody(page); + await page.mouse.move(1, 1); + await hoverTheTallestBar(page); + + await expect(page.locator(`body > ${CLOUD}`), 'the same tooltip, now drawn in body').not.toHaveCount(0); + await expect.poll(() => cloudPlacement(page), { message: 'the scope neither moves the cloud nor turns its arrow' }) + .toEqual(inTheScope); + }); + + test('an open overlay follows its scope once the application says the mode changed', async ({ page, theme }) => { + const { buildMode, oppositeMode } = modesOf(theme); + + await render(page, `
`); + + await createWidget(page, 'dxPopup', { + visible: true, width: 100, height: 100, animation: null, + }, '#owner'); + + const painted = (): Promise => valueAt(page, '.dx-popup-wrapper', '--dxds-color-bg'); + const asOpened = await painted(); + + expect(asOpened, 'opens in the mode of its scope').toBe(await valueAt(page, '#owner', '--dxds-color-bg')); + + await setScopeMode(page, '#scope', buildMode, true); + + await expect.poll(() => valueAt(page, '#owner', '--dx-theme-mode'), { message: 'the scope did switch' }) + .toBe(buildMode); + await expect.poll(painted, { message: 'the open overlay repainted' }).not.toBe(asOpened); + + const ownerBackground = await valueAt(page, '#owner', '--dxds-color-bg'); + + await expect.poll(painted, { message: 'and matches its owner again' }).toBe(ownerBackground); + }); + + test('a chart takes its chrome from the scope and its data from the palette', async ({ page }) => { + await twoChartsInTwoModes(page); + + const darkAxis = await valueAt(page, '#dark-chart .dxc-arg-elements text', 'fill'); + const darkGrid = await valueAt(page, '#dark-chart .dxc-val-grid path', 'stroke'); + const darkSeries = await valueAt(page, '#dark-chart .dxc-series rect', 'fill'); + + await expect.poll(() => valueAt(page, '#light-chart .dxc-arg-elements text', 'fill'), { message: 'the axis reads against the surface under it' }) + .not.toBe(darkAxis); + await expect.poll(() => valueAt(page, '#light-chart .dxc-val-grid path', 'stroke'), { message: 'and so does the grid' }) + .not.toBe(darkGrid); + await expect.poll(() => valueAt(page, '#light-chart .dxc-series rect', 'fill'), { message: 'a blue series stays the same blue in both modes' }) + .toBe(darkSeries); + }); + + test('a chart repaints the moment a published name changes, with nothing asked of the widget', async ({ page }) => { + await render(page, '
'); + await createWidget(page, 'dxChart', CHART, '#chart'); + + const seriesFill = (): Promise => valueAt(page, '#chart .dxc-series rect', 'fill'); + const asPainted = await seriesFill(); + + await writeRootProperty(page, '--dx-viz-blue', 'rgb(1, 2, 3)'); + + const asWritten = await seriesFill(); + + await writeRootProperty(page, '--dx-viz-blue', ''); + + const asRestored = await seriesFill(); + + expect(asWritten, 'the cascade repainted the series, no call was made').toBe('rgb(1, 2, 3)'); + expect(asWritten).not.toBe(asPainted); + expect(asRestored, 'and the theme is back once the page stops writing it').toBe(asPainted); + }); + + test('a chart exports the colors it was painted in, not the ones written beside them', async ({ page }) => { + await twoChartsInTwoModes(page); + + const light = await exportedChartFrom(page, '#light-chart'); + const dark = await exportedChartFrom(page, '#dark-chart'); + + expect(light.references, 'nothing resolves a reference once the markup is out of the document').toBe(0); + expect(dark.references).toBe(0); + expect(light.painted, 'the exported text carries the colour it was painted with').not.toBe(''); + expect(dark.painted, 'each chart exports in the mode of its own scope').not.toBe(light.painted); + }); + + test('a map exports the halo behind its labels, not the name the halo was written with', async ({ page }) => { + await render(page, ` +
+
+ `); + + await createWidget(page, 'dxVectorMap', MAP_WITH_LABELLED_MARKERS, '#light-map'); + await createWidget(page, 'dxVectorMap', MAP_WITH_LABELLED_MARKERS, '#dark-map'); + + const light = await exportedHaloFrom(page, '#light-map'); + const dark = await exportedHaloFrom(page, '#dark-map'); + + expect(light.references, 'a stroke written outside the attribute path resolves too').toBe(0); + expect(dark.references).toBe(0); + expect(light.painted, 'the exported halo carries the colour it was painted with').not.toBe(''); + expect(dark.painted, 'each map exports in the mode of its own scope').not.toBe(light.painted); + }); + + test('an open overlay keeps its mode until the application says so', async ({ page, theme }) => { + const { buildMode, oppositeMode } = modesOf(theme); + + await render(page, `
`); + + await createWidget(page, 'dxPopup', { + visible: true, width: 100, height: 100, animation: null, + }, '#owner'); + + const asOpened = await valueAt(page, '.dx-popup-wrapper', '--dxds-color-bg'); + + await setScopeMode(page, '#scope', buildMode, false); + + expect(await valueAt(page, '.dx-popup-wrapper', '--dxds-color-bg'), 'still painted in the mode it was opened in') + .toBe(asOpened); + }); +}); diff --git a/e2e/playwright/tests/common/vizNamedColors.spec.ts b/e2e/playwright/tests/common/vizNamedColors.spec.ts new file mode 100644 index 000000000000..230c298c1d74 --- /dev/null +++ b/e2e/playwright/tests/common/vizNamedColors.spec.ts @@ -0,0 +1,332 @@ +import type { Page } from '@playwright/test'; +import { test } from '../../fixtures'; +import { createWidget } from '../../helpers/createWidget'; +import { startDragToOffset } from '../../helpers/dragUtils'; +import { testScreenshot } from '../../helpers/screenshots'; +import { getThemeName } from '../../helpers/themeUtils'; +import type { WidgetName } from '../../models/types'; + +const SPARKLINE_DATA = [5.1, 6.8, 4.2, 7.6, 5.5, 3.1, 6.2, 4.8, 8.4, 5.9] + .map((val, index) => ({ arg: String(index + 1), val })); + +const CANDLE_DATA = [ + { + arg: 1, open: 5, high: 7.2, low: 4.4, close: 6.6, + }, + { + arg: 2, open: 6.6, high: 7, low: 4.8, close: 5.1, + }, + { + arg: 3, open: 5.1, high: 6.4, low: 4.6, close: 6.2, + }, + { + arg: 4, open: 6.2, high: 6.8, low: 4.2, close: 4.5, + }, + { + arg: 5, open: 4.5, high: 6.6, low: 4.1, close: 6.3, + }, +]; + +const TILE_DATA = [ + { name: 'a', value: 9 }, { name: 'b', value: 5 }, { name: 'c', value: 4 }, + { name: 'd', value: 3 }, { name: 'e', value: 2 }, { name: 'f', value: 2 }, +]; + +const AREAS = { + type: 'FeatureCollection', + features: [ + { type: 'Feature', properties: { name: 'a' }, geometry: { type: 'Polygon', coordinates: [[[0, 0], [40, 0], [40, 30], [0, 30], [0, 0]]] } }, + { type: 'Feature', properties: { name: 'b' }, geometry: { type: 'Polygon', coordinates: [[[45, 0], [90, 0], [90, 30], [45, 30], [45, 0]]] } }, + { type: 'Feature', properties: { name: 'c' }, geometry: { type: 'Polygon', coordinates: [[[0, 35], [90, 35], [90, 60], [0, 60], [0, 35]]] } }, + ], +}; + +const LINES = { + type: 'FeatureCollection', + features: [ + { type: 'Feature', properties: { name: 'l1' }, geometry: { type: 'LineString', coordinates: [[0, 0], [30, 25], [60, 5], [90, 30]] } }, + { type: 'Feature', properties: { name: 'l2' }, geometry: { type: 'LineString', coordinates: [[0, 40], [30, 20], [60, 45], [90, 15]] } }, + ], +}; + +const HIDDEN_AXIS = { + visible: false, + grid: { visible: false }, + tick: { visible: false }, + label: { visible: false }, +}; + +const SCOPE = (mode: string, width: number, height: number): string => ` +
+
${mode} scope
+
+
`; + +const drawScopes = (page: Page, width: number, height: number): Promise => page.evaluate( + (markup) => { + const container = document.querySelector('#container') as HTMLElement; + + container.style.display = 'flex'; + container.style.gap = '8px'; + container.style.width = 'max-content'; + container.innerHTML = markup; + }, + ['light', 'dark'].map((mode) => SCOPE(mode, width, height)).join(''), +); + +const drawScope = (page: Page, mode: string, width: number, height: number): Promise => page + .evaluate((markup) => { + const container = document.querySelector('#container') as HTMLElement; + + container.style.display = 'flex'; + container.style.width = 'max-content'; + container.innerHTML = markup; + }, SCOPE(mode, width, height)); + +const inBothScopes = async ( + page: Page, + widget: WidgetName, + options: object, + size: { width: number; height: number }, +): Promise => { + await drawScopes(page, size.width, size.height); + await createWidget(page, widget, options, '#light'); + await createWidget(page, widget, options, '#dark'); +}; + +const shoot = (page: Page, name: string): Promise => testScreenshot(page, `${name}.png`, { element: '#container' }); + +test.describe('Viz named colors', () => { + test.skip(({ theme }) => getThemeName(theme) !== 'fluent-next', 'fluent-next only'); + + test('the sparkline line and its first and last point take the published blue', async ({ page }) => { + await inBothScopes(page, 'dxSparkline', { + dataSource: SPARKLINE_DATA, + tooltip: { enabled: false }, + }, { width: 240, height: 60 }); + + await shoot(page, 'Viz sparkline line'); + }); + + test('the lowest and the highest point of a sparkline take the published yellow and red', async ({ page }) => { + await inBothScopes(page, 'dxSparkline', { + dataSource: SPARKLINE_DATA, + showMinMax: true, + pointSize: 8, + tooltip: { enabled: false }, + }, { width: 240, height: 60 }); + + await shoot(page, 'Viz sparkline extremes'); + }); + + test('a win and a loss stay grey, from the published pair', async ({ page }) => { + await inBothScopes(page, 'dxSparkline', { + dataSource: [6, 7, 3, 6.5, 2, 4, 8, 6.2, 3.4, 7] + .map((val, index) => ({ arg: String(index + 1), val })), + type: 'winloss', + winlossThreshold: 5, + tooltip: { enabled: false }, + }, { width: 240, height: 60 }); + + await shoot(page, 'Viz sparkline winloss'); + }); + + test('a falling candlestick takes the published red', async ({ page }) => { + await inBothScopes(page, 'dxChart', { + dataSource: CANDLE_DATA, + series: [{ + type: 'candlestick', + argumentField: 'arg', + openValueField: 'open', + highValueField: 'high', + lowValueField: 'low', + closeValueField: 'close', + }], + legend: { visible: false }, + animation: { enabled: false }, + argumentAxis: HIDDEN_AXIS, + valueAxis: HIDDEN_AXIS, + tooltip: { enabled: false }, + }, { width: 240, height: 140 }); + + await shoot(page, 'Viz candlestick reduction'); + }); + + test('the bullet target takes the published content colour', async ({ page }) => { + await inBothScopes(page, 'dxBullet', { + value: 68, + target: 82, + startScaleValue: 0, + endScaleValue: 100, + tooltip: { enabled: false }, + }, { width: 240, height: 40 }); + + await shoot(page, 'Viz bullet target'); + }); + + test('the bar gauge shelf is lifted off the surface', async ({ page }) => { + await inBothScopes(page, 'dxBarGauge', { + startValue: 0, + endValue: 100, + values: [72, 54, 38], + label: { visible: false }, + legend: { visible: false }, + animation: { enabled: false }, + tooltip: { enabled: false }, + }, { width: 240, height: 130 }); + + await shoot(page, 'Viz bar gauge shelf'); + }); + + test('a gauge range container takes the published indicating set', async ({ page }) => { + await inBothScopes(page, 'dxCircularGauge', { + scale: { startValue: 0, endValue: 100, label: { visible: false } }, + value: 62, + rangeContainer: { + width: 14, + ranges: [ + { startValue: 0, endValue: 40 }, + { startValue: 40, endValue: 70 }, + { startValue: 70, endValue: 100 }, + ], + }, + animation: { enabled: false }, + tooltip: { enabled: false }, + }, { width: 240, height: 150 }); + + await shoot(page, 'Viz gauge indicating set'); + }); + + test('the axis, its labels and its title, and the legend read a step quieter', async ({ page }) => { + await inBothScopes(page, 'dxChart', { + dataSource: [4, 7, 5, 9].map((val, index) => ({ arg: index + 1, val })), + series: [{ + type: 'line', argumentField: 'arg', valueField: 'val', name: 'Series', + }], + title: { text: 'Title', subtitle: { text: 'Subtitle' } }, + valueAxis: { title: 'Value' }, + animation: { enabled: false }, + tooltip: { enabled: false }, + }, { width: 240, height: 260 }); + + await shoot(page, 'Viz axis and legend'); + }); + + test('a tree map tile with no palette colour takes the published blue', async ({ page }) => { + await inBothScopes(page, 'dxTreeMap', { + dataSource: TILE_DATA, + valueField: 'value', + colorizer: { type: 'none' }, + tile: { label: { visible: false } }, + tooltip: { enabled: false }, + }, { width: 240, height: 120 }); + + await shoot(page, 'Viz tree map tile fill'); + }); + + test('a map area takes the published quiet grey', async ({ page }) => { + await inBothScopes(page, 'dxVectorMap', { + layers: [{ dataSource: AREAS, type: 'area' }], + bounds: [-4, 64, 94, -4], + panningEnabled: false, + zoomingEnabled: false, + controlBar: { enabled: false }, + tooltip: { enabled: false }, + }, { width: 240, height: 130 }); + + await shoot(page, 'Viz map area'); + }); + + test('a map line takes the published orange', async ({ page }) => { + await inBothScopes(page, 'dxVectorMap', { + layers: [{ dataSource: LINES, type: 'line' }], + bounds: [-4, 49, 94, -4], + panningEnabled: false, + zoomingEnabled: false, + controlBar: { enabled: false }, + tooltip: { enabled: false }, + }, { width: 240, height: 130 }); + + await shoot(page, 'Viz map line'); + }); + + test('a sankey link takes the published grey', async ({ page }) => { + await inBothScopes(page, 'dxSankey', { + dataSource: [ + { source: 'A', target: 'X', weight: 4 }, + { source: 'A', target: 'Y', weight: 2 }, + { source: 'B', target: 'Y', weight: 3 }, + ], + label: { visible: false }, + tooltip: { enabled: false }, + }, { width: 240, height: 130 }); + + await shoot(page, 'Viz sankey link'); + }); + + test('the two-colour needle and the subvalue marker take the published names', async ({ page }) => { + await inBothScopes(page, 'dxCircularGauge', { + scale: { startValue: 0, endValue: 100, label: { visible: false } }, + value: 62, + subvalues: [24], + valueIndicator: { type: 'twocolorneedle' }, + animation: { enabled: false }, + tooltip: { enabled: false }, + }, { width: 240, height: 150 }); + + await shoot(page, 'Viz gauge indicators'); + }); + + ['light', 'dark'].forEach((mode) => { + test(`the crosshair is drawn with its own published name: ${mode}`, async ({ page }) => { + await drawScope(page, mode, 240, 140); + await createWidget(page, 'dxChart', { + dataSource: [4, 7, 5, 9].map((val, index) => ({ arg: index + 1, val })), + series: [{ type: 'line', argumentField: 'arg', valueField: 'val' }], + legend: { visible: false }, + animation: { enabled: false }, + crosshair: { enabled: true }, + tooltip: { enabled: false }, + }, `#${mode}`); + + await startDragToOffset(page, page.locator(`#${mode}`), 30, 0); + + await shoot(page, `Viz chart crosshair ${mode}`); + }); + }); + + ['light', 'dark'].forEach((mode) => { + test(`a range that is not allowed marks the slider with the published danger: ${mode}`, async ({ page }) => { + await drawScope(page, mode, 400, 90); + await createWidget(page, 'dxRangeSelector', { + scale: { + startValue: 0, endValue: 100, tickInterval: 25, minRange: 30, + }, + value: [20, 70], + behavior: { animationEnabled: false }, + }, `#${mode}`); + + await startDragToOffset(page, page.locator('#container .slider-tracker').first(), 130, 0); + + await shoot(page, `Viz range selector invalid ${mode}`); + }); + }); + + test('the hairline between tree map tiles stays the same colour in both scopes', async ({ page }) => { + await inBothScopes(page, 'dxTreeMap', { + dataSource: TILE_DATA, + valueField: 'value', + colorizer: { type: 'gradient', range: [0, 9] }, + tile: { label: { visible: false } }, + interactWithGroup: false, + tooltip: { enabled: false }, + }, { width: 240, height: 120 }); + + await shoot(page, 'Viz tree map tile border'); + }); +}); diff --git a/e2e/playwright/tests/common/vizPalettes.spec.ts b/e2e/playwright/tests/common/vizPalettes.spec.ts new file mode 100644 index 000000000000..e71b9cb4dbc0 --- /dev/null +++ b/e2e/playwright/tests/common/vizPalettes.spec.ts @@ -0,0 +1,90 @@ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../fixtures'; +import { createWidget } from '../../helpers/createWidget'; +import { getThemeName } from '../../helpers/themeUtils'; + +const COUNT = 50; +const ROUNDING_APART = 2; +const LITERALS = ['#0078d4', '#c83d3d', '#008f04', '#eaa300', '#e43ba6', '#865cbf']; + +const distancesOver = (page: Page, extensionMode: string): Promise => page.evaluate(({ + mode, count, literals, +}) => { + const { viz } = (window as any).DevExpress; + + viz.registerPalette('legacy literals', { + simpleSet: literals, + indicatingSet: [literals[2], literals[3], literals[1]], + gradientSet: [literals[0], literals[2]], + accentColor: '#0f6cbd', + }); + + const channelsOf = (color: string): number[] => { + const probe = document.createElement('div'); + + probe.style.cssText = 'position: absolute; visibility: hidden'; + probe.style.backgroundColor = color; + document.body.appendChild(probe); + + const painted = getComputedStyle(probe).backgroundColor; + + probe.remove(); + + const scale = painted.startsWith('color(') ? 255 : 1; + + return (painted.match(/-?[\d.]+/g) ?? []).slice(0, 3) + .map((channel) => Math.round(Math.min(255, Math.max(0, Number(channel) * scale)))); + }; + + const generated = (palette: string): string[] => viz + .generateColors(palette, count, { paletteExtensionMode: mode, useHighlight: true }); + + const fromNames = generated('Fluent Next').map(channelsOf); + const fromLiterals = generated('legacy literals').map(channelsOf); + + return fromNames.map((channels: number[], index: number) => Math.max( + ...channels.map((channel, at) => Math.abs(channel - fromLiterals[index][at])), + )); +}, { mode: extensionMode, count: COUNT, literals: LITERALS }); + +const handedOut = (page: Page): Promise => page.evaluate(() => { + const series = (window as any).widget.getAllSeries(); + + return [ + ...series.map((one: { getColor: () => string }) => one.getColor()), + ...series[0].getAllPoints().map((point: { getColor: () => string }) => point.getColor()), + ]; +}); + +test.describe('Viz palettes', () => { + test.skip(({ theme }) => getThemeName(theme) !== 'fluent-next', 'fluent-next only'); + + test('a chart hands out colours an application can draw with, not references', async ({ page }) => { + await createWidget(page, 'dxChart', { + dataSource: [{ arg: 'a', val: 1 }, { arg: 'b', val: 2 }], + series: [{ type: 'bar' }, { type: 'bar' }], + animation: { enabled: false }, + size: { width: 300, height: 200 }, + }); + + await expect.poll(async () => (await handedOut(page)).length, { message: 'the chart answered with colours' }) + .toBeGreaterThan(0); + await expect.poll(async () => (await handedOut(page)) + .filter((color) => !/^(#[0-9a-f]{6}|rgba?\()/i.test(color)), { message: 'every colour is one an application can parse' }) + .toEqual([]); + }); + + ['blend', 'alternate', 'extrapolate'].forEach((extensionMode) => { + test(`the browser mixes ${extensionMode} into the same colors the old arithmetic did`, async ({ page }) => { + const distances = await distancesOver(page, extensionMode); + const furthest = Math.max(...distances); + const drifted = distances.filter((distance) => distance > ROUNDING_APART).length; + + expect(distances.length, 'every colour of the run was compared').toBe(COUNT); + expect( + drifted, + `${drifted} of ${COUNT} colours differ by more than ${ROUNDING_APART} of 255, the furthest by ${furthest}`, + ).toBe(0); + }); + }); +}); diff --git a/e2e/playwright/tests/container.html b/e2e/playwright/tests/container.html index 7207c8b44dc1..01f2f9ecc4ad 100644 --- a/e2e/playwright/tests/container.html +++ b/e2e/playwright/tests/container.html @@ -15,7 +15,10 @@ + + + diff --git a/e2e/testcafe-devextreme/tests/common/accentColor.ts b/e2e/testcafe-devextreme/tests/common/accentColor.ts deleted file mode 100644 index 756e20527b9d..000000000000 --- a/e2e/testcafe-devextreme/tests/common/accentColor.ts +++ /dev/null @@ -1,391 +0,0 @@ -/* eslint-disable spellcheck/spell-checker */ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import { ClientFunction } from 'testcafe'; -import { createWidget } from '../../helpers/createWidget'; -import { appendElementTo } from '../../helpers/domUtils'; -import url from '../../helpers/getPageUrl'; -import { getData } from '../dataGrid/helpers/generateDataSourceData'; -import { isFluentNext, testScreenshot } from '../../helpers/themeUtils'; - -const STEPS = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180]; - -const DESIGNED_PALETTE_TOLERANCE = 4; -const HUE_TOLERANCE = 0.01; - -interface Oklch { - l: number; - c: number; - h: number; -} - -interface MeasuredStep { - step: number; - resolved: string; - oklch: Oklch | null; -} - -interface PaintedAccent { - name: string; - painted: { selectedRange: string; handles: string[]; markers: string[] }; - primary: string; - inPlace: boolean; -} - -const asHex = (value: string): string => { - const probe = document.createElement('div'); - document.body.appendChild(probe); - probe.style.backgroundColor = `rgb(from ${value} r g b)`; - const resolved = getComputedStyle(probe).backgroundColor; - probe.remove(); - - const channels = (resolved.match(/[-\d.]+/g) ?? []).slice(0, 3); - const scale = resolved.startsWith('color(') ? 255 : 1; - - return channels.length === 3 - ? `#${channels - .map((raw) => Math.round(Math.min(255, Math.max(0, +raw * scale))).toString(16).padStart(2, '0')) - .join('')}` - : resolved; -}; - -const measurePalette = ClientFunction((accent: string | null, steps: number[]) => { - const root = document.documentElement; - - if (accent) { - root.style.setProperty('--dx-accent-color', accent); - } else { - root.style.removeProperty('--dx-accent-color'); - } - - const probe = document.createElement('div'); - document.body.appendChild(probe); - - const asOklch = (color: string): Oklch | null => { - probe.style.backgroundColor = `oklch(from ${color} l c h)`; - const resolved = getComputedStyle(probe).backgroundColor; - const parts = /^oklch\(([-\d.]+) ([-\d.]+) ([-\d.]+)/.exec(resolved); - - return parts ? { l: +parts[1], c: +parts[2], h: +parts[3] } : null; - }; - - const read = (step: number): MeasuredStep => { - probe.style.backgroundColor = `var(--dxds-primary-${step})`; - const resolved = getComputedStyle(probe).backgroundColor; - - return { step, resolved, oklch: asOklch(resolved) }; - }; - - const setting = (name: string): number => +getComputedStyle(root).getPropertyValue(name).trim(); - const measured = steps.map(read); - const source = accent ? asOklch(accent) : null; - - probe.remove(); - - return { - measured, - source, - settings: { - lightnessMax: setting('--dx-accent-lightness-max'), - lightnessMin: setting('--dx-accent-lightness-min'), - chromaMin: setting('--dx-accent-chroma-min'), - }, - }; -}); - -const PALETTE_STRIP = 'accent-palette'; -const ACCENT_GRID = 'accent-grid'; -const ACCENT_RANGE = 'accent-range'; -const SELECTED_RANGE = `#${ACCENT_RANGE} .dxrs-slidersContainer > path`; -const SLIDER_HANDLES = `#${ACCENT_RANGE} .slider > path`; -const SLIDER_MARKERS = `#${ACCENT_RANGE} .slider-marker > path`; -const GRID_DATA = getData(5, 2); -const SHIPPED_ACCENTS = [ - { palette: 'blue', color: '#0f6cbd' }, - { palette: 'rust', color: '#da3b01' }, - { palette: 'mint', color: '#018574' }, -]; - -const drawPaletteStrip = ClientFunction((accent: string, steps: number[]) => { - document.documentElement.style.setProperty('--dx-accent-color', accent); - const strip = document.getElementById(PALETTE_STRIP)!; - strip.textContent = ''; - - const swatches = steps.map((step) => { - const column = document.createElement('div'); - column.style.cssText = 'width: 60px; font: 10px/14px monospace; color: #000; text-align: center'; - - const swatch = document.createElement('div'); - swatch.style.cssText = 'height: 60px; border: 1px solid #000'; - swatch.style.backgroundColor = `var(--dxds-primary-${step})`; - - const caption = document.createElement('div'); - caption.textContent = `${step}`; - - column.appendChild(swatch); - column.appendChild(caption); - strip.appendChild(column); - - return { step, swatch, caption }; - }); - - swatches.forEach(({ step, swatch, caption }) => { - caption.textContent = `${step}\n${asHex(getComputedStyle(swatch).backgroundColor)}`; - caption.style.whiteSpace = 'pre'; - }); -}, { dependencies: { PALETTE_STRIP, asHex } }); -const oklchDistance = (first: Oklch, second: Oklch): number => { - const radians = Math.PI / 180; - const firstA = first.c * Math.cos(first.h * radians); - const firstB = first.c * Math.sin(first.h * radians); - const secondA = second.c * Math.cos(second.h * radians); - const secondB = second.c * Math.sin(second.h * radians); - const squared = (first.l - second.l) ** 2 + (firstA - secondA) ** 2 + (firstB - secondB) ** 2; - - return Math.sqrt(squared) * 100; -}; - -const accentThroughApi = ClientFunction((color: string | null) => { - const { themes } = (window as any).DevExpress.ui; - - themes.customAccentColor(color); - - const probe = document.createElement('div'); - document.body.appendChild(probe); - probe.style.backgroundColor = 'var(--dxds-primary-100)'; - const seed = asHex(getComputedStyle(probe).backgroundColor); - probe.remove(); - - return { seed, reported: themes.customAccentColor() }; -}, { dependencies: { asHex } }); - -const declareBrandColor = ClientFunction((color: string) => { - document.documentElement.style.setProperty('--brand', color); -}); - -const createAccentRange = async (): Promise => { - await appendElementTo('#container', 'div', ACCENT_RANGE, { marginTop: '8px' }); - await createWidget('dxRangeSelector', { - scale: { - startValue: 0, endValue: 100, tickInterval: 10, minorTickInterval: 2, - }, - value: [20, 60], - behavior: { animationEnabled: false }, - size: { width: 1080, height: 80 }, - }, `#${ACCENT_RANGE}`); -}; - -const rememberAccentRange = ClientFunction(() => { - const { DevExpress } = window as any; - const host = document.getElementById(ACCENT_RANGE); - - (window as any).accentRangeAsCreated = { - instance: DevExpress.viz.dxRangeSelector.getInstance(host), - selectedRange: document.querySelector(SELECTED_RANGE), - }; -}, { dependencies: { ACCENT_RANGE, SELECTED_RANGE } }); - -const paintAccentRange = ClientFunction((color: string, throughApi: boolean) => { - const { DevExpress, accentRangeAsCreated } = window as any; - - if (throughApi) { - DevExpress.ui.themes.customAccentColor(color); - } else { - document.documentElement.style.setProperty('--dx-accent-color', color); - } - - const host = document.getElementById(ACCENT_RANGE); - const selectedRange = document.querySelector(SELECTED_RANGE)!; - const paintOf = (selector: string, property: 'fill' | 'stroke'): string[] => Array.from( - document.querySelectorAll(selector), - (element) => asHex(getComputedStyle(element)[property]), - ); - const probe = document.createElement('div'); - document.body.appendChild(probe); - probe.style.backgroundColor = 'var(--dxds-primary-100)'; - const primary = asHex(getComputedStyle(probe).backgroundColor); - probe.remove(); - - return { - painted: { - selectedRange: asHex(getComputedStyle(selectedRange).stroke), - handles: paintOf(SLIDER_HANDLES, 'stroke'), - markers: paintOf(SLIDER_MARKERS, 'fill'), - }, - primary, - inPlace: selectedRange === accentRangeAsCreated?.selectedRange - && DevExpress.viz.dxRangeSelector.getInstance(host) === accentRangeAsCreated?.instance, - }; -}, { - dependencies: { - ACCENT_RANGE, SELECTED_RANGE, SLIDER_HANDLES, SLIDER_MARKERS, asHex, - }, -}); - -const RANGE_ACCENTS = [ - ...SHIPPED_ACCENTS.map(({ palette, color }) => ({ name: palette, color, throughApi: false })), - { name: 'custom', color: '#a703ff', throughApi: false }, - { name: 'custom through themes.customAccentColor', color: '#107c10', throughApi: true }, -]; - -const rounded = (value: number): number => Math.round(value * 1000) / 1000; -const stepOf = (measured: MeasuredStep[], step: number): Oklch => measured - .find((entry) => entry.step === step)!.oklch!; - -fixture`Custom accent color` - .page(url(__dirname, '../container.html')) - .afterEach(async () => { - await measurePalette(null, []); - }); - -(isFluentNext() ? test : test.skip)('the designed seed gives the palette back', async (t) => { - const designed = await measurePalette(null, STEPS); - const designedSteps = designed.measured; - const seed = stepOf(designedSteps, 100); - const derived = await measurePalette(`oklch(${seed.l} ${seed.c} ${seed.h})`, STEPS); - - await t - .expect(designedSteps.every((entry) => entry.resolved.startsWith('rgb'))) - .ok('an unset accent must leave the designed values in place'); - - await t - .expect(derived.measured - .map((entry) => ({ - step: entry.step, - distance: rounded(oklchDistance(stepOf(designedSteps, entry.step), entry.oklch!)), - })) - .filter(({ distance }) => distance > DESIGNED_PALETTE_TOLERANCE)) - .eql([]); -}); - -(isFluentNext() ? test : test.skip)('an arbitrary accent keeps hue, order and clamps', async (t) => { - const arbitraryAccent = '#a703ff'; - const { measured, source, settings } = await measurePalette(arbitraryAccent, STEPS); - const steps = measured; - const lightest = stepOf(steps, 10); - const darkest = stepOf(steps, 180); - const accentItself = stepOf(steps, 100); - - await t.expect({ - lightest: { l: rounded(lightest.l), c: rounded(lightest.c) }, - darkest: { l: rounded(darkest.l), c: rounded(darkest.c) }, - accentItself: { l: rounded(accentItself.l), c: rounded(accentItself.c) }, - lighteningSteps: steps - .filter((entry, index) => index > 0 && entry.oklch!.l >= steps[index - 1].oklch!.l) - .map((entry) => entry.step), - stepsOffHue: steps - .filter((entry) => Math.abs(entry.oklch!.h - source!.h) > HUE_TOLERANCE) - .map((entry) => entry.step), - }).eql({ - lightest: { l: settings.lightnessMax, c: settings.chromaMin }, - darkest: { l: settings.lightnessMin, c: settings.chromaMin }, - accentItself: { l: rounded(source!.l), c: rounded(source!.c) }, - lighteningSteps: [], - stepsOffHue: [], - }); -}); - -(isFluentNext() ? test : test.skip)('the derived palette is drawn as designed', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - for (const { palette, color } of SHIPPED_ACCENTS) { - await drawPaletteStrip(color, STEPS); - await testScreenshot(t, takeScreenshot, `Accent palette ${palette}.png`, { - element: '#container', - }); - } - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', PALETTE_STRIP, { display: 'flex' }); - await appendElementTo('#container', 'div', ACCENT_GRID, { marginTop: '8px', width: '1080px' }); - await createWidget('dxDataGrid', { - dataSource: GRID_DATA, - keyExpr: 'field_0', - selection: { mode: 'multiple' }, - selectedRowKeys: [GRID_DATA[0].field_0, GRID_DATA[1].field_0], - focusedRowEnabled: true, - focusedRowKey: GRID_DATA[2].field_0, - showBorders: true, - }, `#${ACCENT_GRID}`); - await createAccentRange(); -}); - -(isFluentNext() ? test : test.skip)('a range selector paints its selected range, handles and markers in the accent, repainting in place', async (t) => { - await rememberAccentRange(); - - const results: PaintedAccent[] = []; - - for (const { name, color, throughApi } of RANGE_ACCENTS) { - results.push({ name, ...await paintAccentRange(color, throughApi) }); - } - - await t - .expect(results.map(({ name, painted }) => ({ name, ...painted }))) - .eql( - results.map(({ name, primary }) => ({ - name, selectedRange: primary, handles: [primary, primary], markers: [primary, primary], - })), - 'the selected range, both slider handles and both marker plates are painted in --dxds-primary-100 of every accent', - ); - - await t - .expect(new Set(results.map(({ painted }) => painted.selectedRange)).size) - .eql(RANGE_ACCENTS.length, 'no two accents paint the selected range alike'); - - await t - .expect(results.filter(({ inPlace }) => !inPlace).map(({ name }) => name)) - .eql([], 'every accent repaints the widget drawn first, neither re-created nor reloaded'); -}).before(createAccentRange); - -(isFluentNext() ? test : test.skip)('a translucent accent still gives an opaque palette', async (t) => { - const translucentAccent = '#a703ff80'; - const { measured } = await measurePalette(translucentAccent, STEPS); - - await t - .expect(measured.filter((entry) => entry.resolved.includes('/')).map((entry) => entry.step)) - .eql([], 'no step may inherit the alpha of the accent'); -}); - -(isFluentNext() ? test : test.skip)('themes.customAccentColor sets, keeps and clears the accent', async (t) => { - const designedAccent = '#0f6cbd'; - const arbitraryAccent = '#a703ff'; - const designed = await accentThroughApi(null); - - await t.expect(designed.reported).eql('', 'an accent nobody set is reported as unset'); - await t.expect(designed.seed).eql(designedAccent, 'the theme starts on the accent it was drawn with'); - - const applied = await accentThroughApi(arbitraryAccent); - - await t.expect(applied.seed).eql(arbitraryAccent, 'the palette is built from the accent that was set'); - await t.expect(applied.reported).eql(arbitraryAccent, 'the accent that was set is reported back'); - - const afterRefusedValue = await accentThroughApi('not-a-color'); - - await t.expect(afterRefusedValue.seed).eql(arbitraryAccent, 'a refused value leaves the palette alone'); - await t.expect(afterRefusedValue.reported).eql(arbitraryAccent, 'a refused value leaves the accent alone'); - - const afterReset = await accentThroughApi(null); - - await t.expect(afterReset.seed).eql(designed.seed, 'null brings the designed palette back'); - await t.expect(afterReset.reported).eql('', 'a cleared accent is reported as unset'); -}); - -(isFluentNext() ? test : test.skip)('themes.customAccentColor takes an accent written as a reference', async (t) => { - const brandAccent = '#a703ff'; - - await declareBrandColor(brandAccent); - const applied = await accentThroughApi('var(--brand)'); - - await t.expect(applied.seed).eql(brandAccent, 'the palette is built from the color the reference resolves to'); - await t.expect(applied.reported).eql(brandAccent, 'a reference is reported back as the color it resolves to'); -}); - -(isFluentNext() ? test : test.skip)('themes.customAccentColor takes an accent written by name', async (t) => { - const namedAccent = 'rebeccapurple'; - const applied = await accentThroughApi(namedAccent); - - await t.expect(applied.seed).eql('#663399', 'the palette is built from the color the name stands for'); - await t.expect(applied.reported).eql(namedAccent, 'the accent is reported back as it was written, not as a hex'); -}); diff --git a/e2e/testcafe-devextreme/tests/common/draggable.ts b/e2e/testcafe-devextreme/tests/common/draggable.ts deleted file mode 100644 index f1b207630be0..000000000000 --- a/e2e/testcafe-devextreme/tests/common/draggable.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { ClientFunction, Selector } from 'testcafe'; -import Scrollable from 'devextreme-testcafe-models/scrollView/scrollable'; -import url from '../../helpers/getPageUrl'; -import { createWidget } from '../../helpers/createWidget'; - -fixture`Draggable` - .page(url(__dirname, '../container.html')); - -const init = ClientFunction(() => { - $('
', { - id: 'scrollview', - width: '400px', - height: '400px', - }) - .css({ - position: 'absolute', - top: 0, - padding: '20px', - background: '#f18787', - }) - .appendTo('#container'); - - $('
', { - id: 'scrollview-content', - height: '500px', - width: '500px', - }).appendTo('#scrollview'); - - $('
', { - id: 'drag-me', - }) - .css({ - 'background-color': 'blue', - display: 'inline-block', - }) - .appendTo('#scrollview-content'); - $('#drag-me').append('DRAG ME!!!'); -}); - -test('dxDraggable element should not loose its position on dragging with auto-scroll inside ScrollView (T1169590)', async (t) => { - const draggable = Selector('#drag-me'); - const scrollable = new Scrollable('#scrollview'); - - await t - .drag(draggable, 0, 400, { speed: 0.1 }) - - .expect(scrollable.getContainer()().scrollTop) - .gt(60); - - await t - .expect((await draggable().boundingClientRect).top) - .gt(400); - - await t.scrollIntoView(draggable); - - await t - .drag(draggable, 400, 0, { speed: 0.1 }) - - .expect(scrollable.getContainer()().scrollLeft) - .gt(60); - - await t - .expect((await draggable().boundingClientRect).left) - .gt(400); -}).before(async () => { - await init(); - await createWidget('dxScrollView', { - direction: 'both', - }, '#scrollview'); - await createWidget('dxDraggable', { }, '#drag-me'); -}); diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Accent palette blue (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Accent palette blue (fluent-next.blue.light).png deleted file mode 100644 index 30d8077a5cda..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Accent palette blue (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Accent palette mint (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Accent palette mint (fluent-next.blue.light).png deleted file mode 100644 index a5cf92484de2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Accent palette mint (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Accent palette rust (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Accent palette rust (fluent-next.blue.light).png deleted file mode 100644 index cec1c55e96f2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Accent palette rust (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Icon set (fluent-next.blue.light).png deleted file mode 100644 index 15035554101e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Icon set (fluent.blue.light).png deleted file mode 100644 index 15035554101e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (generic.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Icon set (generic.light).png deleted file mode 100644 index 5e2f28b97999..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (generic.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (material.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Icon set (material.blue.light).png deleted file mode 100644 index 283051acee10..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (material.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (fluent-next.blue.light).png deleted file mode 100644 index a385d84b8090..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (fluent.blue.light).png deleted file mode 100644 index a385d84b8090..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (generic.light).png b/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (generic.light).png deleted file mode 100644 index a5414820681f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (generic.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (material.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (material.blue.light).png deleted file mode 100644 index 20031efb6138..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (material.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz axis and legend (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz axis and legend (fluent-next.blue.light).png deleted file mode 100644 index 66bc8f086d2c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz axis and legend (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz bar gauge shelf (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz bar gauge shelf (fluent-next.blue.light).png deleted file mode 100644 index 0d9f9aa94fa0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz bar gauge shelf (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz bullet target (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz bullet target (fluent-next.blue.light).png deleted file mode 100644 index 1cd038774d63..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz bullet target (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz candlestick reduction (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz candlestick reduction (fluent-next.blue.light).png deleted file mode 100644 index d3fd075059ef..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz candlestick reduction (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz chart crosshair dark (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz chart crosshair dark (fluent-next.blue.light).png deleted file mode 100644 index 17f1e9783286..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz chart crosshair dark (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz chart crosshair light (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz chart crosshair light (fluent-next.blue.light).png deleted file mode 100644 index 4bace04ac4ea..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz chart crosshair light (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz gauge indicating set (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz gauge indicating set (fluent-next.blue.light).png deleted file mode 100644 index 7689ed7d5a93..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz gauge indicating set (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz gauge indicators (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz gauge indicators (fluent-next.blue.light).png deleted file mode 100644 index 8b8791dc2bea..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz gauge indicators (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz map area (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz map area (fluent-next.blue.light).png deleted file mode 100644 index b5a5c05d2c93..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz map area (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz map line (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz map line (fluent-next.blue.light).png deleted file mode 100644 index 14219b60ff79..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz map line (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz range selector invalid dark (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz range selector invalid dark (fluent-next.blue.light).png deleted file mode 100644 index 4ce02c8f1aa0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz range selector invalid dark (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz range selector invalid light (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz range selector invalid light (fluent-next.blue.light).png deleted file mode 100644 index 431e87665697..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz range selector invalid light (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz sankey link (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz sankey link (fluent-next.blue.light).png deleted file mode 100644 index e55097bda279..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz sankey link (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz sparkline extremes (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz sparkline extremes (fluent-next.blue.light).png deleted file mode 100644 index 9567db1f82f1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz sparkline extremes (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz sparkline line (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz sparkline line (fluent-next.blue.light).png deleted file mode 100644 index 5c5e843ccf40..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz sparkline line (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz sparkline winloss (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz sparkline winloss (fluent-next.blue.light).png deleted file mode 100644 index 89cf87651333..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz sparkline winloss (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz tree map tile border (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz tree map tile border (fluent-next.blue.light).png deleted file mode 100644 index c56d7d858dda..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz tree map tile border (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Viz tree map tile fill (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/etalons/Viz tree map tile fill (fluent-next.blue.light).png deleted file mode 100644 index c96572bfd776..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Viz tree map tile fill (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/eventsEngine.ts b/e2e/testcafe-devextreme/tests/common/eventsEngine.ts deleted file mode 100644 index fc3d070ac956..000000000000 --- a/e2e/testcafe-devextreme/tests/common/eventsEngine.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { ClientFunction, Selector } from 'testcafe'; -import url from '../../helpers/getPageUrl'; - -fixture.disablePageReloads`Events` - .page(url(__dirname, '../container.html')); - -const init = ClientFunction(() => { - const markup = `
-
-
-
hoverStartTriggerCount
-
0
-
hoverEndTriggerCount
-
0
-
`; - - $('#container').html(markup); - - const { DevExpress } = (window as any); - - let hoverStartTriggerCount = 0; - let hoverEndTriggerCount = 0; - - DevExpress.events.on($('#target'), 'dxhoverstart', () => { - hoverStartTriggerCount += 1; - - $('#hoverStartTriggerCount').text(hoverStartTriggerCount); - }); - - DevExpress.events.on($('#target'), 'dxhoverend', () => { - hoverEndTriggerCount += 1; - - $('#hoverEndTriggerCount').text(hoverEndTriggerCount); - }); -}); - -test('The `dxhoverstart` event should be triggered after dragging and dropping an HTML draggable element (T1260277)', async (t) => { - const draggable = Selector('#draggable'); - const target = Selector('#target'); - const hoverStartTriggerCount = Selector('#hoverStartTriggerCount'); - const hoverEndTriggerCount = Selector('#hoverEndTriggerCount'); - - await t - .drag(draggable, 0, 400, { speed: 1 }); - - // `.drag` does not trigger the `pointercancel` event. - // A sequence of `.drag` calls behaves like a single drag&drop operation, - // and each call does not trigger the `pointerup` event. - // Even if it did, the `pointercancel` event would not be triggered as specified in: - // https://www.w3.org/TR/pointerevents/#suppressing-a-pointer-event-stream - // This is a hack to test the event engine's logic. - await t.dispatchEvent(draggable, 'pointercancel'); - - await t - .drag(target, 0, 400, { speed: 1 }); - - await t.expect(hoverStartTriggerCount.textContent).eql('1'); - await t.expect(hoverEndTriggerCount.textContent).eql('1'); -}).before(async () => { - await init(); -}); diff --git a/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show dependencies (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show dependencies (fluent-next.blue.light).png deleted file mode 100644 index 797461b71e73..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show dependencies (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show dependencies (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show dependencies (fluent.blue.light).png deleted file mode 100644 index 862f42eec6d3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show dependencies (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show resourced (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show resourced (fluent-next.blue.light).png deleted file mode 100644 index a52a63979843..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show resourced (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show resourced (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show resourced (fluent.blue.light).png deleted file mode 100644 index e9a69f3d788e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show resourced (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show resourced (material.blue.light).png b/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show resourced (material.blue.light).png deleted file mode 100644 index 5cc458adbdd8..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/gantt/etalons/Gantt show resourced (material.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/accessibility.ts b/e2e/testcafe-devextreme/tests/common/pagination/accessibility.ts deleted file mode 100644 index 09b78f34752b..000000000000 --- a/e2e/testcafe-devextreme/tests/common/pagination/accessibility.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import url from '../../../helpers/getPageUrl'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { createWidget } from '../../../helpers/createWidget'; -import { Themes } from '../../../helpers/themes'; - -fixture.disablePageReloads`Pagination` - .page(url(__dirname, '../../container.html')); - -['full', 'compact'].forEach((displayMode) => { - [undefined, 'Total {2} items. Page {0} of {1}'].forEach((infoText) => { - [true, false].forEach((showInfo) => { - [true, false].forEach((showNavigationButtons) => { - [true, false].forEach((showPageSizeSelector) => { - test.meta({ - themes: infoText && showInfo && showNavigationButtons && showPageSizeSelector - ? [Themes.materialBlue, Themes.genericLight] - : [], - })(`Pagination dm_${displayMode}-` - + `${infoText ? 'has' : 'has_no'}_it-` - + `si_${showInfo.toString()}-` - + `snb_${showNavigationButtons.toString()}-` - + `spss_${showPageSizeSelector.toString()}`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot( - t, - takeScreenshot, - `pagination-dm_${displayMode}-` - + `${infoText ? 'has' : 'has_no'}_it-` - + `si_${showInfo.toString()}-` - + `snb_${showNavigationButtons.toString()}-` - + `spss_${showPageSizeSelector.toString()}` - + '.png', - ); - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => createWidget('dxPagination', { - itemCount: 50, - displayMode, - infoText, - showInfo, - showNavigationButtons, - showPageSizeSelector, - })); - }); - }); - }); - }); -}); diff --git a/e2e/testcafe-devextreme/tests/common/pagination/baseProperties.ts b/e2e/testcafe-devextreme/tests/common/pagination/baseProperties.ts deleted file mode 100644 index b20f1cb46614..000000000000 --- a/e2e/testcafe-devextreme/tests/common/pagination/baseProperties.ts +++ /dev/null @@ -1,138 +0,0 @@ -import Pagination from 'devextreme-testcafe-models/pagination'; -import { ClientFunction } from 'testcafe'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -fixture.disablePageReloads`Pagination Base Properties` - .page(url(__dirname, '../../container.html')); - -test('Pagination width and height property', async (t) => { - const pagination = new Pagination('#container'); - await t - .expect(pagination.element.getStyleProperty('width')) - .eql('270px') - .expect(pagination.element.getStyleProperty('height')) - .eql('95px') - .expect(pagination.element.getAttribute('width')) - .eql(null) - .expect(pagination.element.getAttribute('height')) - .eql(null); -}).before(async () => createWidget('dxPagination', { - width: 270, - height: '95px', - itemCount: 50, -})); - -test('Pagination elementAttr property', async (t) => { - const pagination = new Pagination('#container'); - await t - .expect(pagination.element.getAttribute('aria-label')) - .eql('some description') - .expect(pagination.element.getAttribute('data-test')) - .eql('custom data'); -}).before(async () => createWidget('dxPagination', { - elementAttr: { - 'aria-label': 'some description', - 'data-test': 'custom data', - }, -})); - -test('Pagination hint and accessKey properties', async (t) => { - const pagination = new Pagination('#container'); - await t - .expect(pagination.element.getAttribute('accesskey')) - .eql('F') - .expect(pagination.element.getAttribute('title')) - .eql('Best Pagination'); -}).before(async () => createWidget('dxPagination', { - hint: 'Best Pagination', - accessKey: 'F', - itemCount: 50, - focusStateEnabled: true, -})); - -test('Pagination disabled property', async (t) => { - const pagination = new Pagination('#container'); - await t - .expect(pagination.element.getAttribute('aria-disabled')) - .eql('true') - .expect(pagination.element.hasClass('dx-state-disabled')) - .ok(); -}).before(async () => createWidget('dxPagination', { - disabled: true, - itemCount: 50, -})); - -test('Pagination tabindex and state properties', async (t) => { - const pagination = new Pagination('#container'); - await t - .expect(pagination.element.getAttribute('tabindex')) - .eql('7') - - .click(pagination.getNavPage('3').element) - .expect(pagination.element.hasClass('dx-state-focused')) - .ok() - .expect(pagination.element.hasClass('dx-state-hover')) - .ok() - .expect(pagination.element.hasClass('dx-state-active')) - .notOk(); - - await ClientFunction((_pagination) => { - const $root = $(_pagination.element()); - - $root.trigger($.Event('dxpointerdown', { - pointers: [{ pointerId: 1 }], - })); - })(pagination); - - await t - .expect(pagination.element.hasClass('dx-state-active')) - .ok(); -}).before(async () => createWidget('dxPagination', { - itemCount: 50, - disabled: false, - width: '100%', - focusStateEnabled: true, - hoverStateEnabled: true, - activeStateEnabled: true, - tabIndex: 7, -})); - -test('Pagination focus method & accessKey propery without focusStateEnabled', async (t) => { - const pagination = new Pagination('#container'); - await t - .expect(pagination.element.getAttribute('accesskey')) - .eql(null) - .expect(pagination.getPageSize(0).element.focused) - .notOk(); - - await ClientFunction((_pagination) => { - _pagination.getInstance().focus(); - })(pagination); - - await t - .expect(pagination.getPageSize(0).element.focused) - .ok(); -}).before(async () => createWidget('dxPagination', { - focusStateEnabled: false, - accessKey: 'F', - itemCount: 50, -})); - -test('Pagination focus method with focusStateEnabled', async (t) => { - const pagination = new Pagination('#container'); - await t - .expect(pagination.element.focused) - .notOk(); - - await ClientFunction((_pagination) => { - _pagination.getInstance().focus(); - })(pagination); - - await t - .expect(pagination.element.focused) - .ok(); -}).before(async () => createWidget('dxPagination', { - focusStateEnabled: true, - itemCount: 50, -})); diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png deleted file mode 100644 index be5321f94fc5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent.blue.light).png deleted file mode 100644 index 58bd01c0211f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 54a0aa0c6949..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent.blue.light).png deleted file mode 100644 index bd4fa40f9f0b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_false-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png deleted file mode 100644 index be5321f94fc5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent.blue.light).png deleted file mode 100644 index 58bd01c0211f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 54a0aa0c6949..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent.blue.light).png deleted file mode 100644 index bd4fa40f9f0b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_false-snb_true-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png deleted file mode 100644 index 3abce767b546..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent.blue.light).png deleted file mode 100644 index 31122db16c0e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 747c6a31e99e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent.blue.light).png deleted file mode 100644 index 0d3d74d24ec0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_false-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png deleted file mode 100644 index 3abce767b546..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent.blue.light).png deleted file mode 100644 index 31122db16c0e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 747c6a31e99e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent.blue.light).png deleted file mode 100644 index 0d3d74d24ec0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (generic.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (generic.light).png deleted file mode 100644 index bac5c20b0f23..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (generic.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (material.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (material.blue.light).png deleted file mode 100644 index 54966fa1831c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_it-si_true-snb_true-spss_true (material.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png deleted file mode 100644 index be5321f94fc5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png deleted file mode 100644 index 58bd01c0211f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 54a0aa0c6949..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png deleted file mode 100644 index bd4fa40f9f0b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png deleted file mode 100644 index be5321f94fc5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png deleted file mode 100644 index 58bd01c0211f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 54a0aa0c6949..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png deleted file mode 100644 index bd4fa40f9f0b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png deleted file mode 100644 index ef859d11a1c1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png deleted file mode 100644 index 5963b24de194..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 8efe5a3b6c0a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png deleted file mode 100644 index 76c869b2c83c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png deleted file mode 100644 index ef859d11a1c1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png deleted file mode 100644 index 5963b24de194..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 8efe5a3b6c0a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png deleted file mode 100644 index 76c869b2c83c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_compact-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png deleted file mode 100644 index 872462b1c330..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent.blue.light).png deleted file mode 100644 index f2db5a88140a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 8b30f018a565..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent.blue.light).png deleted file mode 100644 index bca7abc6c169..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_false-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png deleted file mode 100644 index ce377768b821..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent.blue.light).png deleted file mode 100644 index 985d78a75f1e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png deleted file mode 100644 index f1976207e68b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent.blue.light).png deleted file mode 100644 index b5ece800e34f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_false-snb_true-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png deleted file mode 100644 index 018e2006133c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent.blue.light).png deleted file mode 100644 index 3c459a624c30..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 388544f0dac0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent.blue.light).png deleted file mode 100644 index 0b694e0fd708..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_false-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png deleted file mode 100644 index 91ef7ce3d3a0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent.blue.light).png deleted file mode 100644 index 2c0162182b00..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 4fde830da7a1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent.blue.light).png deleted file mode 100644 index a12f98400fcf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (generic.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (generic.light).png deleted file mode 100644 index a67a6a961f5d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (generic.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (material.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (material.blue.light).png deleted file mode 100644 index a5ea30f5e3c2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_it-si_true-snb_true-spss_true (material.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png deleted file mode 100644 index 872462b1c330..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png deleted file mode 100644 index f2db5a88140a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 8b30f018a565..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png deleted file mode 100644 index bca7abc6c169..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_false-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png deleted file mode 100644 index ce377768b821..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png deleted file mode 100644 index 985d78a75f1e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png deleted file mode 100644 index f1976207e68b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png deleted file mode 100644 index b5ece800e34f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_false-snb_true-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png deleted file mode 100644 index f1a9fc31a41d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png deleted file mode 100644 index 6a2a60254cef..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png deleted file mode 100644 index 323ab1e43e1a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png deleted file mode 100644 index 24adbfc1ce2a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_false-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png deleted file mode 100644 index d78ea3f135e3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png deleted file mode 100644 index 1494ccd380b1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png deleted file mode 100644 index f8392c5b68d1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png deleted file mode 100644 index b8e0bef7142e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/common/pagination/etalons/pagination-dm_full-has_no_it-si_true-snb_true-spss_true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/common/pagination/index.ts b/e2e/testcafe-devextreme/tests/common/pagination/index.ts deleted file mode 100644 index 62ce692cfb0b..000000000000 --- a/e2e/testcafe-devextreme/tests/common/pagination/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -import Pagination from 'devextreme-testcafe-models/pagination'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -fixture.disablePageReloads`Pagination Base Properties` - .page(url(__dirname, '../../container.html')); - -test('Pagination visibile property', async (t) => { - const pagination = new Pagination('#container'); - await t - .expect(pagination.element.hasClass('dx-state-invisible')) - .ok(); -}).before(async () => createWidget('dxPagination', { - itemCount: 50, - visible: false, -})); - -test('PageSize selector test', async (t) => { - const pagination = new Pagination('#container'); - - await t - .click(pagination.getPageSize(1).element) - .expect(pagination.option('pageCount')) - .eql(13); -}).before(async () => createWidget('dxPagination', { - itemCount: 50, - pageIndex: 2, - pageSize: 8, // pageCount: 7 - allowedPageSizes: [2, 4, 8], -})); - -test('PageIndex test', async (t) => { - const pagination = new Pagination('#container'); - - await t - .expect(pagination.option('pageIndex')) - .eql(1) - .click(pagination.getNavPage('5').element) - .expect(pagination.option('pageIndex')) - .eql(5); -}).before(async () => createWidget('dxPagination', { - itemCount: 50, - pageIndex: 1, - pageSize: 5, // pageCount: 10 -})); - -test('PageIndex correction test', async (t) => { - const pagination = new Pagination('#container'); - - await t - .expect(pagination.option('pageIndex')) - .eql(10) - .click(pagination.getPageSize(1).element) - .expect(pagination.option('pageIndex')) - .eql(5); -}).before(async () => createWidget('dxPagination', { - itemCount: 50, - pageIndex: 10, - pageSize: 5, // pageCount: 10 -})); diff --git a/e2e/testcafe-devextreme/tests/common/shadowDOM.ts b/e2e/testcafe-devextreme/tests/common/shadowDOM.ts deleted file mode 100644 index a2686b8be25d..000000000000 --- a/e2e/testcafe-devextreme/tests/common/shadowDOM.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { ClientFunction } from 'testcafe'; -import url from '../../helpers/getPageUrl'; - -fixture.disablePageReloads`Shadow DOM - Adopted DX css styles` - .page(url(__dirname, '../container.html')); - -const dxWidgetHostStyles = '.dx-widget-shadow { font-size: 20px; }'; -const dxWidgetShadowStyles = '.dx-widget-shadow { font-size: 40px; }'; - -const setupShadowDomTest = (copyStylesToShadowDom) => ClientFunction((copyStyles) => { - if (!copyStyles) { - (window as any).DevExpress.config({ copyStylesToShadowDom: copyStyles }); - } - - const container = document.createElement('div'); - container.id = 'shadow-host'; - document.body.appendChild(container); - - const hostStyleElement = document.createElement('style'); - hostStyleElement.innerHTML = dxWidgetHostStyles; - document.head.appendChild(hostStyleElement); - - const shadowRoot = container.attachShadow({ mode: 'open' }); - - const shadowStyleElement = shadowRoot.ownerDocument.createElement('style'); - shadowStyleElement.innerHTML = dxWidgetShadowStyles; - shadowRoot.appendChild(shadowStyleElement); - - const shadowContainerElement = document.createElement('div'); - shadowContainerElement.id = 'shadow-container'; - shadowRoot.appendChild(shadowContainerElement); - - (window as any).testShadowRoot = shadowRoot; - - // eslint-disable-next-line new-cap, no-new - new (window as any).DevExpress.ui.dxButton(shadowContainerElement, { - text: 'Test button', - }); -}, { - dependencies: { - dxWidgetHostStyles, - dxWidgetShadowStyles, - }, -})(copyStylesToShadowDom); - -const getAdoptedStyleSheets = ClientFunction(() => { - const shadowRoot = (window as any).testShadowRoot; - const { adoptedStyleSheets } = shadowRoot; - - const results: { [key: string]: string[] | null } = { - firstSheetRules: null, - secondSheetRules: null, - }; - - if (adoptedStyleSheets.length > 1) { - results.firstSheetRules = Array - .from(adoptedStyleSheets[0].cssRules).map((rule) => (rule as CSSRule).cssText); - - results.secondSheetRules = Array - .from(adoptedStyleSheets[1].cssRules).map((rule) => (rule as CSSRule).cssText); - } - - return results; -}); - -test('Copies DX css styles from the host to the shadow root when rendering a DX widget', async (t) => { - await setupShadowDomTest(true); - - const { firstSheetRules, secondSheetRules } = await getAdoptedStyleSheets(); - - const hasHostStyle = firstSheetRules?.some((rule) => rule === dxWidgetHostStyles); - await t.expect(hasHostStyle).ok('First adopted stylesheet contains host styles'); - - const hasShadowStyle = secondSheetRules?.some((rule) => rule === dxWidgetShadowStyles); - await t.expect(hasShadowStyle).ok('Second adopted stylesheet contains shadow styles'); -}); - -test('Does not copy DX css styles when copyStylesToShadowDom is disabled', async (t) => { - await setupShadowDomTest(false); - - const { firstSheetRules, secondSheetRules } = await getAdoptedStyleSheets(); - await t.expect(firstSheetRules === null && secondSheetRules === null) - .ok('No adopted stylesheets should be created when copyStylesToShadowDom is disabled'); -}); diff --git a/e2e/testcafe-devextreme/tests/common/themeModes.ts b/e2e/testcafe-devextreme/tests/common/themeModes.ts deleted file mode 100644 index 986d1ea8fdb5..000000000000 --- a/e2e/testcafe-devextreme/tests/common/themeModes.ts +++ /dev/null @@ -1,934 +0,0 @@ -import { ClientFunction, Selector } from 'testcafe'; -import url from '../../helpers/getPageUrl'; -import { createWidget } from '../../helpers/createWidget'; -import { getComputedPropertyValue } from '../../helpers/domUtils'; -import { clearTestPage } from '../../helpers/testPageUtils'; -import { getFullThemeName, getThemeName } from '../../helpers/themeUtils'; - -if (getThemeName() === 'fluent-next') { - fixture`Theme modes` - .page(url(__dirname, '../container.html')) - .afterEach(async (t) => { await clearTestPage(t); }); - - const buildMode = getFullThemeName().includes('.dark') ? 'dark' : 'light'; - const oppositeMode = buildMode === 'dark' ? 'light' : 'dark'; - - const MODE_DEPENDENT = ['--dxds-color-bg', '--dxds-color-content']; - const SYSTEM_TIER = ['--dx-global-content', '--dx-surface-overlay', '--dx-focus-rect-outline']; - - const render = ClientFunction((markup: string) => { - const container = document.querySelector('#container'); - - if (container) container.innerHTML = markup; - }); - - const valueAt = async (selector: string, property: string): Promise => ( - await getComputedPropertyValue(selector, property) - ).trim(); - - const reportedMode = ClientFunction((selector: string) => (window as any).DevExpress.ui.themes - .mode(document.querySelector(selector))); - - const setScopeMode = ClientFunction((selector: string, mode: string, tell: boolean) => { - const scope = document.querySelector(selector) as HTMLElement; - - scope.classList.remove('dx-theme-mode-light', 'dx-theme-mode-dark'); - scope.classList.add(`dx-theme-mode-${mode}`); - - if (tell) { - (window as any).DevExpress.ui.themes.refreshMode(); - } - }); - - const CHART = { - dataSource: [{ month: 'a', sales: 1 }, { month: 'b', sales: 2 }], - series: [{ type: 'bar', argumentField: 'month', valueField: 'sales' }], - legend: { visible: false }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }; - - const MAP_WITH_LABELLED_MARKERS = { - layers: [{ - type: 'marker', - dataSource: { - type: 'FeatureCollection', - features: [{ - type: 'Feature', - geometry: { type: 'Point', coordinates: [0, 0] }, - properties: { text: 'a' }, - }], - }, - label: { enabled: true, dataField: 'text' }, - }], - size: { width: 220, height: 160 }, - }; - - const writeRootProperty = ClientFunction((name: string, value: string) => { - const root = document.documentElement; - - if (value) { - root.style.setProperty(name, value); - } else { - root.style.removeProperty(name); - } - }); - - const exportedFrom = ClientFunction(( - selector: string, - widgetName: string, - paintedSelector: string, - paintedAttribute: string, - ) => { - const instance = ($(selector) as any)[widgetName]('instance'); - const markup = (window as any).DevExpress.viz.getMarkup([instance]); - const painted = new DOMParser().parseFromString(markup, 'image/svg+xml').querySelector(paintedSelector); - - return { - references: (markup.match(/var\(--dx-/g) ?? []).length, - painted: painted?.getAttribute(paintedAttribute) ?? '', - }; - }); - - type Exported = Promise<{ references: number; painted: string }>; - - const exportedChartFrom = (selector: string): Exported => exportedFrom(selector, 'dxChart', 'text', 'style'); - - const exportedHaloFrom = (selector: string): Exported => exportedFrom(selector, 'dxVectorMap', '[stroke-linejoin="round"]', 'stroke'); - - const DECLARED_BLUE = 'rgb(11, 7, 3)'; - const DECLARED_BG = 'rgb(22, 7, 3)'; - const HANDED_OUT_BLUE = '#0b0703'; - - const declareTheNamesTheWidgetsRead = ClientFunction((blue: string, background: string) => { - document.documentElement.style.setProperty('--dx-viz-blue', blue); - document.documentElement.style.setProperty('--dx-viz-bg', background); - }); - - const colorsHandedOutByTheWidget = ClientFunction(() => { - const { widget } = (window as any); - const series = widget.getAllSeries?.() ?? []; - const items = widget.getAllItems?.() ?? []; - - return [ - ...series.flatMap((one) => [ - one.getColor(), - ...one.getAllPoints().map((point) => point.getColor()), - ]), - ...items.map((item) => item.getColor()), - ]; - }); - - const markupOfTheWidget = ClientFunction(() => { - const svg = (window as any).widget.svg(); - const left = (svg.match(/var\(--dx-[a-z-]+/g) ?? []) as string[]; - - return { svg, unresolved: left.filter((value, index) => left.indexOf(value) === index) }; - }); - - test('dxChart paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(await colorsHandedOutByTheWidget()).eql([HANDED_OUT_BLUE, HANDED_OUT_BLUE], 'getColor answers with the colour the cascade resolved, normalised to hex'); - await t.expect(svg).contains(DECLARED_BLUE, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxChart', { - ...{ - dataSource: [{ a: 'x', v: 1 }], - series: [{ argumentField: 'a', valueField: 'v' }], - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - const DECLARED_IN_OKLCH = 'oklch(0.55 0.15 250)'; - - const declaredAsRgb = ClientFunction((declared: string) => { - const probe = document.createElement('div'); - - document.body.appendChild(probe); - probe.style.color = `color-mix(in srgb, ${declared} 100%, transparent)`; - - const channels = (getComputedStyle(probe).color.match(/-?[\d.]+(?:e-?\d+)?/g) ?? []) - .slice(0, 3) - .map((value) => Math.round(Math.min(1, Math.max(0, Number(value))) * 255)); - - probe.remove(); - - return `#${channels.map((value) => value.toString(16).padStart(2, '0')).join('')}`; - }); - - test('dxChart hands out a name declared in another colour space as the sRGB colour it paints', async (t) => { - const expected = await declaredAsRgb(DECLARED_IN_OKLCH); - - await t.expect(await colorsHandedOutByTheWidget()) - .eql([expected, expected], 'getColor brings the colour to sRGB instead of reading its channels as red, green and blue'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_IN_OKLCH, DECLARED_BG); - await createWidget('dxChart', { - dataSource: [{ a: 'x', v: 1 }], - series: [{ argumentField: 'a', valueField: 'v' }], - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxPieChart paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(await colorsHandedOutByTheWidget()).eql([undefined, HANDED_OUT_BLUE], 'getColor answers with the colour the cascade resolved, normalised to hex'); - await t.expect(svg).contains(DECLARED_BLUE, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxPieChart', { - ...{ - dataSource: [{ a: 'x', v: 1 }], - series: [{ argumentField: 'a', valueField: 'v' }], - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxPolarChart paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(await colorsHandedOutByTheWidget()).eql([HANDED_OUT_BLUE, HANDED_OUT_BLUE], 'getColor answers with the colour the cascade resolved, normalised to hex'); - await t.expect(svg).contains(DECLARED_BLUE, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxPolarChart', { - ...{ - dataSource: [{ a: 'x', v: 1 }], - series: [{ argumentField: 'a', valueField: 'v' }], - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxFunnel paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(await colorsHandedOutByTheWidget()).eql([HANDED_OUT_BLUE], 'getColor answers with the colour the cascade resolved, normalised to hex'); - await t.expect(svg).contains(DECLARED_BLUE, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxFunnel', { - ...{ - dataSource: [{ a: 'x', v: 3 }], - argumentField: 'a', - valueField: 'v', - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxSankey paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(svg).contains(DECLARED_BLUE, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxSankey', { - ...{ - dataSource: [{ source: 'A', target: 'X', weight: 1 }], - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxTreeMap paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(svg).contains(DECLARED_BLUE, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxTreeMap', { - ...{ - dataSource: [{ name: 'a', value: 1 }], - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxVectorMap paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(svg).contains(DECLARED_BLUE, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxVectorMap', { - ...{ - layers: [{ - type: 'marker', - dataSource: { - type: 'FeatureCollection', - features: [{ type: 'Feature', geometry: { type: 'Point', coordinates: [0, 0] }, properties: { text: 'a' } }], - }, - label: { enabled: true, dataField: 'text' }, - }], - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxSparkline paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(svg).contains(DECLARED_BG, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxSparkline', { - ...{ - dataSource: [1, 4, 2], - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxBullet paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(svg).contains(DECLARED_BLUE, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxBullet', { - ...{ - value: 40, - target: 60, - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxBarGauge paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(svg).contains(DECLARED_BLUE, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxBarGauge', { - ...{ - values: [30], - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxCircularGauge paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(svg).contains(DECLARED_BG, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxCircularGauge', { - ...{ - value: 40, - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxLinearGauge paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(svg).contains(DECLARED_BLUE, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxLinearGauge', { - ...{ - value: 40, - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('dxRangeSelector paints from a name the page declared, leaving no reference behind', async (t) => { - const { svg, unresolved } = await markupOfTheWidget(); - - await t.expect(svg).contains(DECLARED_BG, 'the markup carries what the cascade resolved, not the literal the theme writes beside the name'); - await t.expect(unresolved).eql([], 'and no reference survives into the markup'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxRangeSelector', { - ...{ - scale: { startValue: 0, endValue: 10 }, - }, - behavior: { animationEnabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - const WIDGETS_UNDER_TEST = [ - 'dxChart', 'dxPieChart', 'dxPolarChart', 'dxFunnel', 'dxSankey', 'dxTreeMap', 'dxVectorMap', - 'dxSparkline', 'dxBullet', 'dxBarGauge', 'dxCircularGauge', 'dxLinearGauge', 'dxRangeSelector', - ]; - - const vizWidgetsExposed = ClientFunction(() => Object.keys((window as any).DevExpress.viz) - .filter((name) => /^dx[A-Z]/.test(name)) - .sort()); - - test('every viz widget the namespace exposes has a test of its own', async (t) => { - await t.expect(await vizWidgetsExposed()).eql([...WIDGETS_UNDER_TEST].sort()); - }); - - const HANDED_OUT_BG = '#160703'; - const FLUENT_NEXT_THEMES = [ - 'fluent-next.blue.light', 'fluent-next.blue.light.compact', - 'fluent-next.blue.dark', 'fluent-next.blue.dark.compact', - ]; - const EXTENSION_MODES = ['blend', 'alternate', 'extrapolate']; - const FINAL_COLOR = /^(#[0-9a-f]{6}|rgba\()/; - - const declareTheNames = async (): Promise => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - }; - - const colorsHandedOutByTheNamespace = ClientFunction(() => { - const { viz } = (window as any).DevExpress; - const theme = viz.getTheme('fluent-next.blue.light'); - - return { - simpleSet: viz.getPalette('Fluent Next').simpleSet[0], - gradientSet: viz.getPalette('Fluent Next').gradientSet[0], - generated: viz.generateColors('Fluent Next', 6)[0], - marker: theme.map['layer:marker:dot'].color, - bullet: theme.bullet.color, - rangebar: theme.gauge.valueIndicators.rangebar.color, - background: theme.backgroundColor, - findTheme: viz.findTheme('fluent-next.blue.light').bullet.color, - }; - }); - - const valuesLeftToTheBrowser = ClientFunction((names: string[]) => { - const { viz } = (window as any).DevExpress; - const leaves: string[] = []; - const walk = (value: unknown): void => { - if (typeof value === 'string') { - leaves.push(value); - } else if (value && typeof value === 'object') { - Object.values(value).forEach(walk); - } - }; - - names.forEach((name) => walk(viz.getTheme(name))); - - return { leaves: leaves.length, left: leaves.filter((leaf) => /var\(|color-mix\(|from /.test(leaf)) }; - }); - - const generatedPastThePalette = ClientFunction((mode: string) => (window as any).DevExpress.viz - .generateColors('Fluent Next', 20, { paletteExtensionMode: mode, useHighlight: true }) as string[]); - - test('the palette and theme functions hand out the colour the page declared, not the name', async (t) => { - await t.expect(await colorsHandedOutByTheNamespace()).eql({ - simpleSet: HANDED_OUT_BLUE, - gradientSet: HANDED_OUT_BLUE, - generated: HANDED_OUT_BLUE, - marker: HANDED_OUT_BLUE, - bullet: HANDED_OUT_BLUE, - rangebar: HANDED_OUT_BLUE, - background: HANDED_OUT_BG, - findTheme: HANDED_OUT_BLUE, - }); - }).before(declareTheNames); - - test('no fluent-next theme hands out a name, a mix or a relative colour', async (t) => { - const { leaves, left } = await valuesLeftToTheBrowser(FLUENT_NEXT_THEMES); - - await t.expect(leaves).gt(FLUENT_NEXT_THEMES.length * 100, 'the walk reached the whole of every theme'); - await t.expect(left).eql([], 'every value is one an application can use as it is'); - }).before(declareTheNames); - - test('generateColors extends the palette past its size into final colours only', async (t) => { - for (const mode of EXTENSION_MODES) { - const colors = await generatedPastThePalette(mode); - - await t.expect(colors.length).eql(20, `${mode} hands out every colour asked for`); - await t.expect(colors.filter((color) => !FINAL_COLOR.test(color))) - .eql([], `${mode} hands out only colours an application can parse`); - await t.expect(new Set(colors).size).gt(6, `${mode} extends the palette with colours of its own`); - } - }).before(declareTheNames); - - const CUSTOM_ACCENT = '#b02e0c'; - - const accentHandedOutByThePalette = ClientFunction((accent: string) => { - const { ui, viz } = (window as any).DevExpress; - - ui.themes.customAccentColor(accent); - - return viz.getPalette('Fluent Next').accentColor; - }); - - test('a custom accent is handed out as the colour it paints, not the relative colour it is derived with', async (t) => { - await t.expect(await accentHandedOutByThePalette(CUSTOM_ACCENT)).eql(CUSTOM_ACCENT); - await t.expect((await valuesLeftToTheBrowser(FLUENT_NEXT_THEMES)).left) - .eql([], 'no theme hands the accent out as a relative colour either'); - }); - - const watchTheCallbacks = ClientFunction(() => { - (window as any).handedToTheCallbacks = {}; - }); - - const colorsHandedToTheCallbacks = ClientFunction(() => (window as any).handedToTheCallbacks); - - test('the legend and tooltip callbacks hand out the colour a widget paints, not the name', async (t) => { - await t.hover('#linear-gauge .dxg-tracker path'); - - await t.expect(colorsHandedToTheCallbacks()).eql({ - seriesColor: HANDED_OUT_BLUE, - pointColor: HANDED_OUT_BLUE, - barColor: HANDED_OUT_BLUE, - groupColor: HANDED_OUT_BLUE, - indicatorColor: HANDED_OUT_BLUE, - }); - }).before(async () => { - await declareTheNames(); - await watchTheCallbacks(); - await render('
'); - await createWidget('dxChart', () => ({ - dataSource: [{ a: 'x', v: 1 }], - series: [{ argumentField: 'a', valueField: 'v' }], - legend: { - customizeText(info) { - if (info.seriesIndex === 0) { - (window as any).handedToTheCallbacks.seriesColor = info.seriesColor; - } - return String(info.seriesName); - }, - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }), '#chart'); - await createWidget('dxPieChart', () => ({ - dataSource: [{ a: 'x', v: 1 }, { a: 'y', v: 2 }], - series: [{ argumentField: 'a', valueField: 'v' }], - legend: { - customizeText(info) { - if (info.pointIndex === 0) { - (window as any).handedToTheCallbacks.pointColor = info.pointColor; - } - return String(info.pointName); - }, - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }), '#pie'); - await createWidget('dxBarGauge', () => ({ - values: [30, 60], - legend: { - visible: true, - customizeText(info) { - if (info.item.index === 0) { - (window as any).handedToTheCallbacks.barColor = info.item.color; - } - return String(info.text); - }, - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }), '#bar-gauge'); - await createWidget('dxVectorMap', () => ({ - layers: [{ - name: 'markers', - type: 'marker', - elementType: 'bubble', - dataField: 'value', - colorGroupingField: 'value', - colorGroups: [0, 5, 10], - dataSource: { - type: 'FeatureCollection', - features: [ - { type: 'Feature', geometry: { type: 'Point', coordinates: [0, 0] }, properties: { value: 1 } }, - { type: 'Feature', geometry: { type: 'Point', coordinates: [20, 20] }, properties: { value: 8 } }, - ], - }, - }], - legends: [{ - source: { layer: 'markers', grouping: 'color' }, - customizeText(info) { - if (info.index === 0) { - (window as any).handedToTheCallbacks.groupColor = info.color; - } - return String(info.index); - }, - }], - size: { width: 220, height: 160 }, - }), '#map'); - await createWidget('dxLinearGauge', () => ({ - value: 40, - valueIndicator: { type: 'rangeBar' }, - tooltip: { - enabled: true, - customizeTooltip(info) { - (window as any).handedToTheCallbacks.indicatorColor = info.color; - return { text: String(info.valueText) }; - }, - }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }), '#linear-gauge'); - }); - - test('a chart exported from a mode scope keeps the background of the scope', async (t) => { - const { painted } = await exportedFrom('#scoped-chart', 'dxChart', 'svg', 'data-backgroundcolor'); - - await t.expect(painted) - .eql(await valueAt('#scoped-chart', '--dx-viz-bg'), 'the markup carries the background the chart is painted on'); - await t.expect(painted) - .notEql(await valueAt('html', '--dx-viz-bg'), 'not the background of the page around the scope'); - }).before(async () => { - await render(`
`); - await createWidget('dxChart', CHART, '#scoped-chart'); - }); - - const gradientStopsExportedToTheCanvas = ClientFunction(() => new Promise<{ - stops: string[]; - stopColorAttribute: string; - failure: string; - }>((resolve) => { - const { widget } = (window as any); - const nativeAddColorStop = CanvasGradient.prototype.addColorStop; - const stops: string[] = []; - const stopColorAttribute = document.querySelector('#container stop')?.getAttribute('stop-color') ?? ''; - let settled = false; - - const settle = (failure = ''): void => { - if (settled) { - return; - } - - settled = true; - CanvasGradient.prototype.addColorStop = nativeAddColorStop; - resolve({ stops, stopColorAttribute, failure }); - }; - - CanvasGradient.prototype.addColorStop = function watchedAddColorStop(offset, color) { - stops.push(String(color)); - - try { - nativeAddColorStop.call(this, offset, color); - } catch (error) { - settle(String(error)); - throw error; - } - }; - - widget.on('fileSaving', (e: { cancel: boolean }) => { - e.cancel = true; - settle(); - }); - - try { - widget.exportTo('probe', 'PNG'); - } catch (error) { - settle(String(error)); - } - })); - - test('exportTo hands a gradient stop the colour the name resolved to', async (t) => { - const { stops, stopColorAttribute, failure } = await gradientStopsExportedToTheCanvas(); - - await t.expect(stopColorAttribute).eql('var(--dx-viz-blue, #0078d4)', 'the widget writes the name into the attribute, so the exporter is the one that has to resolve it'); - await t.expect(failure).eql('', 'the export reaches onFileSaving instead of failing in addColorStop'); - await t.expect(stops.filter((stop) => stop.includes('var('))).eql([], 'no stop reaches the canvas as a reference'); - await t.expect(stops[0]).eql(DECLARED_BLUE, 'the first stop carries what the page declared, neither the name nor the literal beside it'); - }).before(async () => { - await declareTheNamesTheWidgetsRead(DECLARED_BLUE, DECLARED_BG); - await createWidget('dxSankey', { - dataSource: [{ source: 'A', target: 'X', weight: 1 }], - link: { colorMode: 'gradient' }, - animation: { enabled: false }, - size: { width: 220, height: 160 }, - }); - }); - - test('a named mode class re-resolves the roles under it', async (t) => { - await render(` -
-
-
- `); - - await t.expect(await valueAt('#plain', '--dx-theme-mode')).eql(buildMode); - await t.expect(await valueAt('#light', '--dx-theme-mode')).eql('light'); - await t.expect(await valueAt('#dark', '--dx-theme-mode')).eql('dark'); - - for (const role of MODE_DEPENDENT) { - const [light, dark, plain] = [ - await valueAt('#light', role), - await valueAt('#dark', role), - await valueAt('#plain', role), - ]; - - await t.expect(light) - .notEql(dark, `${role} must differ between the two named modes`); - await t.expect(plain) - .eql(buildMode === 'dark' ? dark : light, `${role} without a class is the bundle's mode`); - } - }); - - test('inverted flips against the nearest named scope', async (t) => { - await render(` -
-
-
-
-
-
-
-
-
-
-
- `); - - await t.expect(await valueAt('#bare', '--dx-theme-mode')) - .eql(oppositeMode, 'with no named scope above it, inverted opposes the bundle'); - await t.expect(await valueAt('#in-dark', '--dx-theme-mode')).eql('light'); - await t.expect(await valueAt('#in-light', '--dx-theme-mode')).eql('dark'); - await t.expect(await valueAt('#nested', '--dx-theme-mode')) - .eql(buildMode, 'inverted inside inverted flips back'); - await t.expect(await valueAt('#nested-in-dark', '--dx-theme-mode')) - .eql('dark', 'the pair resolves against the dark scope around it'); - }); - - test('the system tier follows the mode instead of freezing at the bundle', async (t) => { - await render(`
`); - - for (const name of SYSTEM_TIER) { - await t.expect(await valueAt('#probe', name)) - .notEql(await valueAt('html', name), `${name} must re-resolve inside a mode scope`); - } - }); - - test('themes.mode answers for the element, not for the loaded file', async (t) => { - await render(` -
-
-
- `); - - await t.expect(await reportedMode('#plain')).eql(buildMode, 'no scope above it - the loaded theme answers'); - await t.expect(await reportedMode('#scoped')).eql(oppositeMode, 'the mode is inherited from the scope, not declared here'); - await t.expect(await reportedMode('#back')).eql(buildMode, 'and inverted inside it flips back'); - - for (const id of ['#plain', '#scoped', '#back']) { - await t.expect(await reportedMode(id)).eql(await valueAt(id, '--dx-theme-mode')); - } - }); - - test('an overlay is painted in the mode of the element that owns it', async (t) => { - await render(`
`); - - await createWidget('dxPopup', { - visible: true, width: 100, height: 100, animation: null, - }, '#owner'); - - const wrapper = Selector('.dx-popup-wrapper'); - - await t.expect(wrapper.exists).ok(); - await t.expect(await valueAt('.dx-popup-wrapper', '--dx-theme-mode')).eql(oppositeMode); - await t.expect(await valueAt('.dx-popup-wrapper', '--dxds-color-bg')) - .eql(await valueAt('#owner', '--dxds-color-bg'), 'the overlay resolves the same roles as its owner'); - }); - - const TOOLTIP = '.dxc-tooltip'; - const CLOUD = `${TOOLTIP} path`; - const TALLEST_BAR = Selector('#chart .dxc-series rect').filter((bar) => { - const heights = Array.from(document.querySelectorAll('#chart .dxc-series rect')) - .map((rect) => rect.getBoundingClientRect().height); - - return bar.getBoundingClientRect().height === Math.max(...heights); - }); - - const chartWithTooltipInTheOtherMode = async (): Promise => { - await render(`
`); - await createWidget('dxChart', { ...CHART, tooltip: { enabled: true } }, '#chart'); - }; - - const colorOfTheNameIn = ClientFunction((selector: string, name: string) => { - const probe = document.createElement('div'); - - probe.style.color = `var(${name})`; - document.querySelector(selector)?.appendChild(probe); - - const { color } = window.getComputedStyle(probe); - - probe.remove(); - - return color; - }); - - const cloudPlacement = ClientFunction(() => { - const cloud = document.querySelector('.dxc-tooltip path'); - const box = cloud?.getBoundingClientRect(); - - return { - left: box?.left, - top: box?.top, - width: box?.width, - height: box?.height, - outline: cloud?.getAttribute('d'), - }; - }); - - const putTheTooltipInBody = ClientFunction(() => { - (window as any).widget.option('tooltip.container', 'body'); - }); - - test('a chart tooltip is painted in the mode of the scope its chart is in', async (t) => { - await t.hover(TALLEST_BAR); - - await t.expect(Selector(CLOUD).exists).ok('the tooltip is drawn'); - - const painted = await valueAt(CLOUD, 'fill'); - - await t.expect(painted) - .eql(await colorOfTheNameIn('#scope', '--dx-viz-tooltip-bg'), 'the cloud takes --dx-viz-tooltip-bg from the scope of its chart'); - await t.expect(painted) - .notEql(await colorOfTheNameIn('#container', '--dx-viz-tooltip-bg'), 'not from the page around the scope'); - await t.expect(Selector(TOOLTIP).parent(`.dx-theme-mode-${oppositeMode}`).exists) - .ok('the tooltip is attached inside a scope of that mode'); - }).before(chartWithTooltipInTheOtherMode); - - test('a chart tooltip in a mode scope lands where the same tooltip lands in body', async (t) => { - await t.hover(TALLEST_BAR); - - await t.expect(Selector(CLOUD).exists).ok('the tooltip is drawn'); - - const inTheScope = await cloudPlacement(); - - await putTheTooltipInBody(); - await t.hover('html', { offsetX: 1, offsetY: 1 }).hover(TALLEST_BAR); - - await t.expect(Selector(`body > ${CLOUD}`).exists).ok('the same tooltip, now drawn in body'); - await t.expect(await cloudPlacement()) - .eql(inTheScope, 'the scope neither moves the cloud nor turns its arrow'); - }).before(chartWithTooltipInTheOtherMode); - - test('an open overlay follows its scope once the application says the mode changed', async (t) => { - await render(`
`); - - await createWidget('dxPopup', { - visible: true, width: 100, height: 100, animation: null, - }, '#owner'); - - const painted = async (): Promise => valueAt('.dx-popup-wrapper', '--dxds-color-bg'); - const asOpened = await painted(); - - await t.expect(asOpened).eql(await valueAt('#owner', '--dxds-color-bg'), 'opens in the mode of its scope'); - - await setScopeMode('#scope', buildMode, true); - - await t.expect(await valueAt('#owner', '--dx-theme-mode')).eql(buildMode, 'the scope did switch'); - await t.expect(await painted()).notEql(asOpened, 'the open overlay repainted'); - await t.expect(await painted()) - .eql(await valueAt('#owner', '--dxds-color-bg'), 'and matches its owner again'); - }); - - const twoChartsInTwoModes = async (): Promise => { - await render(` -
-
- `); - - await createWidget('dxChart', CHART, '#light-chart'); - await createWidget('dxChart', CHART, '#dark-chart'); - }; - - test('a chart takes its chrome from the scope and its data from the palette', async (t) => { - await t.expect(await valueAt('#light-chart .dxc-arg-elements text', 'fill')) - .notEql(await valueAt('#dark-chart .dxc-arg-elements text', 'fill'), 'the axis reads against the surface under it'); - await t.expect(await valueAt('#light-chart .dxc-val-grid path', 'stroke')) - .notEql(await valueAt('#dark-chart .dxc-val-grid path', 'stroke'), 'and so does the grid'); - await t.expect(await valueAt('#light-chart .dxc-series rect', 'fill')) - .eql(await valueAt('#dark-chart .dxc-series rect', 'fill'), 'a blue series stays the same blue in both modes'); - }).before(twoChartsInTwoModes); - - test('a chart repaints the moment a published name changes, with nothing asked of the widget', async (t) => { - const asPainted = await valueAt('#chart .dxc-series rect', 'fill'); - - await writeRootProperty('--dx-viz-blue', 'rgb(1, 2, 3)'); - - const asWritten = await valueAt('#chart .dxc-series rect', 'fill'); - - await writeRootProperty('--dx-viz-blue', ''); - - const asRestored = await valueAt('#chart .dxc-series rect', 'fill'); - - await t.expect(asWritten).eql('rgb(1, 2, 3)', 'the cascade repainted the series, no call was made'); - await t.expect(asWritten).notEql(asPainted); - await t.expect(asRestored).eql(asPainted, 'and the theme is back once the page stops writing it'); - }).before(async () => { - await render('
'); - await createWidget('dxChart', CHART, '#chart'); - }); - - test('a chart exports the colors it was painted in, not the ones written beside them', async (t) => { - const light = await exportedChartFrom('#light-chart'); - const dark = await exportedChartFrom('#dark-chart'); - - await t.expect(light.references).eql(0, 'nothing resolves a reference once the markup is out of the document'); - await t.expect(dark.references).eql(0); - await t.expect(light.painted).notEql('', 'the exported text carries the colour it was painted with'); - await t.expect(dark.painted).notEql(light.painted, 'each chart exports in the mode of its own scope'); - }).before(twoChartsInTwoModes); - - test('a map exports the halo behind its labels, not the name the halo was written with', async (t) => { - const light = await exportedHaloFrom('#light-map'); - const dark = await exportedHaloFrom('#dark-map'); - - await t.expect(light.references).eql(0, 'a stroke written outside the attribute path resolves too'); - await t.expect(dark.references).eql(0); - await t.expect(light.painted).notEql('', 'the exported halo carries the colour it was painted with'); - await t.expect(dark.painted).notEql(light.painted, 'each map exports in the mode of its own scope'); - }).before(async () => { - await render(` -
-
- `); - - await createWidget('dxVectorMap', MAP_WITH_LABELLED_MARKERS, '#light-map'); - await createWidget('dxVectorMap', MAP_WITH_LABELLED_MARKERS, '#dark-map'); - }); - - test('an open overlay keeps its mode until the application says so', async (t) => { - await render(`
`); - - await createWidget('dxPopup', { - visible: true, width: 100, height: 100, animation: null, - }, '#owner'); - - const asOpened = await valueAt('.dx-popup-wrapper', '--dxds-color-bg'); - - await setScopeMode('#scope', buildMode, false); - - await t.expect(await valueAt('.dx-popup-wrapper', '--dxds-color-bg')) - .eql(asOpened, 'still painted in the mode it was opened in'); - }); -} diff --git a/e2e/testcafe-devextreme/tests/common/vizNamedColors.ts b/e2e/testcafe-devextreme/tests/common/vizNamedColors.ts deleted file mode 100644 index fb6956554ad0..000000000000 --- a/e2e/testcafe-devextreme/tests/common/vizNamedColors.ts +++ /dev/null @@ -1,345 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import { ClientFunction, Selector } from 'testcafe'; -import { createWidget } from '../../helpers/createWidget'; -import { dragWithDisabledMouseUp } from '../../helpers/mouseUpEvents'; -import url from '../../helpers/getPageUrl'; -import { clearTestPage } from '../../helpers/testPageUtils'; -import { getThemeName, testScreenshot } from '../../helpers/themeUtils'; - -if (getThemeName() === 'fluent-next') { - fixture`Viz named colors` - .page(url(__dirname, '../container.html')) - .afterEach(async (t) => { await clearTestPage(t); }); - - const SPARKLINE_DATA = [5.1, 6.8, 4.2, 7.6, 5.5, 3.1, 6.2, 4.8, 8.4, 5.9] - .map((val, index) => ({ arg: String(index + 1), val })); - - const CANDLE_DATA = [ - { - arg: 1, open: 5, high: 7.2, low: 4.4, close: 6.6, - }, - { - arg: 2, open: 6.6, high: 7, low: 4.8, close: 5.1, - }, - { - arg: 3, open: 5.1, high: 6.4, low: 4.6, close: 6.2, - }, - { - arg: 4, open: 6.2, high: 6.8, low: 4.2, close: 4.5, - }, - { - arg: 5, open: 4.5, high: 6.6, low: 4.1, close: 6.3, - }, - ]; - - const TILE_DATA = [ - { name: 'a', value: 9 }, { name: 'b', value: 5 }, { name: 'c', value: 4 }, - { name: 'd', value: 3 }, { name: 'e', value: 2 }, { name: 'f', value: 2 }, - ]; - - const AREAS = { - type: 'FeatureCollection', - features: [ - { type: 'Feature', properties: { name: 'a' }, geometry: { type: 'Polygon', coordinates: [[[0, 0], [40, 0], [40, 30], [0, 30], [0, 0]]] } }, - { type: 'Feature', properties: { name: 'b' }, geometry: { type: 'Polygon', coordinates: [[[45, 0], [90, 0], [90, 30], [45, 30], [45, 0]]] } }, - { type: 'Feature', properties: { name: 'c' }, geometry: { type: 'Polygon', coordinates: [[[0, 35], [90, 35], [90, 60], [0, 60], [0, 35]]] } }, - ], - }; - - const LINES = { - type: 'FeatureCollection', - features: [ - { type: 'Feature', properties: { name: 'l1' }, geometry: { type: 'LineString', coordinates: [[0, 0], [30, 25], [60, 5], [90, 30]] } }, - { type: 'Feature', properties: { name: 'l2' }, geometry: { type: 'LineString', coordinates: [[0, 40], [30, 20], [60, 45], [90, 15]] } }, - ], - }; - - const HIDDEN_AXIS = { - visible: false, - grid: { visible: false }, - tick: { visible: false }, - label: { visible: false }, - }; - - const drawScopes = ClientFunction((width: number, height: number) => { - const container = document.querySelector('#container') as HTMLElement; - - container.style.display = 'flex'; - container.style.gap = '8px'; - container.style.width = 'max-content'; - container.innerHTML = ['light', 'dark'].map((mode) => ` -
-
${mode} scope
-
-
`).join(''); - }); - - const drawScope = ClientFunction((mode: string, width: number, height: number) => { - const container = document.querySelector('#container') as HTMLElement; - - container.style.display = 'flex'; - container.style.width = 'max-content'; - container.innerHTML = ` -
-
${mode} scope
-
-
`; - }); - - const inBothScopes = async ( - widget: 'dxSparkline' | 'dxBullet' | 'dxChart' | 'dxTreeMap' | 'dxBarGauge' | 'dxCircularGauge' - | 'dxSankey' | 'dxVectorMap', - options: unknown, - size: { width: number; height: number }, - ): Promise => { - await drawScopes(size.width, size.height); - await createWidget(widget, options, '#light'); - await createWidget(widget, options, '#dark'); - }; - - const shoot = async (t: TestController, name: string): Promise => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `${name}.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }; - - test('the sparkline line and its first and last point take the published blue', async (t) => { - await inBothScopes('dxSparkline', { - dataSource: SPARKLINE_DATA, - tooltip: { enabled: false }, - }, { width: 240, height: 60 }); - - await shoot(t, 'Viz sparkline line'); - }); - - test('the lowest and the highest point of a sparkline take the published yellow and red', async (t) => { - await inBothScopes('dxSparkline', { - dataSource: SPARKLINE_DATA, - showMinMax: true, - pointSize: 8, - tooltip: { enabled: false }, - }, { width: 240, height: 60 }); - - await shoot(t, 'Viz sparkline extremes'); - }); - - test('a win and a loss stay grey, from the published pair', async (t) => { - await inBothScopes('dxSparkline', { - dataSource: [6, 7, 3, 6.5, 2, 4, 8, 6.2, 3.4, 7] - .map((val, index) => ({ arg: String(index + 1), val })), - type: 'winloss', - winlossThreshold: 5, - tooltip: { enabled: false }, - }, { width: 240, height: 60 }); - - await shoot(t, 'Viz sparkline winloss'); - }); - - test('a falling candlestick takes the published red', async (t) => { - await inBothScopes('dxChart', { - dataSource: CANDLE_DATA, - series: [{ - type: 'candlestick', - argumentField: 'arg', - openValueField: 'open', - highValueField: 'high', - lowValueField: 'low', - closeValueField: 'close', - }], - legend: { visible: false }, - animation: { enabled: false }, - argumentAxis: HIDDEN_AXIS, - valueAxis: HIDDEN_AXIS, - tooltip: { enabled: false }, - }, { width: 240, height: 140 }); - - await shoot(t, 'Viz candlestick reduction'); - }); - - test('the bullet target takes the published content colour', async (t) => { - await inBothScopes('dxBullet', { - value: 68, - target: 82, - startScaleValue: 0, - endScaleValue: 100, - tooltip: { enabled: false }, - }, { width: 240, height: 40 }); - - await shoot(t, 'Viz bullet target'); - }); - - test('the bar gauge shelf is lifted off the surface', async (t) => { - await inBothScopes('dxBarGauge', { - startValue: 0, - endValue: 100, - values: [72, 54, 38], - label: { visible: false }, - legend: { visible: false }, - animation: { enabled: false }, - tooltip: { enabled: false }, - }, { width: 240, height: 130 }); - - await shoot(t, 'Viz bar gauge shelf'); - }); - - test('a gauge range container takes the published indicating set', async (t) => { - await inBothScopes('dxCircularGauge', { - scale: { startValue: 0, endValue: 100, label: { visible: false } }, - value: 62, - rangeContainer: { - width: 14, - ranges: [ - { startValue: 0, endValue: 40 }, - { startValue: 40, endValue: 70 }, - { startValue: 70, endValue: 100 }, - ], - }, - animation: { enabled: false }, - tooltip: { enabled: false }, - }, { width: 240, height: 150 }); - - await shoot(t, 'Viz gauge indicating set'); - }); - - test('the axis, its labels and its title, and the legend read a step quieter', async (t) => { - await inBothScopes('dxChart', { - dataSource: [4, 7, 5, 9].map((val, index) => ({ arg: index + 1, val })), - series: [{ - type: 'line', argumentField: 'arg', valueField: 'val', name: 'Series', - }], - title: { text: 'Title', subtitle: { text: 'Subtitle' } }, - valueAxis: { title: 'Value' }, - animation: { enabled: false }, - tooltip: { enabled: false }, - }, { width: 240, height: 260 }); - - await shoot(t, 'Viz axis and legend'); - }); - - test('a tree map tile with no palette colour takes the published blue', async (t) => { - await inBothScopes('dxTreeMap', { - dataSource: TILE_DATA, - valueField: 'value', - colorizer: { type: 'none' }, - tile: { label: { visible: false } }, - tooltip: { enabled: false }, - }, { width: 240, height: 120 }); - - await shoot(t, 'Viz tree map tile fill'); - }); - - test('a map area takes the published quiet grey', async (t) => { - await inBothScopes('dxVectorMap', { - layers: [{ dataSource: AREAS, type: 'area' }], - bounds: [-4, 64, 94, -4], - panningEnabled: false, - zoomingEnabled: false, - controlBar: { enabled: false }, - tooltip: { enabled: false }, - }, { width: 240, height: 130 }); - - await shoot(t, 'Viz map area'); - }); - - test('a map line takes the published orange', async (t) => { - await inBothScopes('dxVectorMap', { - layers: [{ dataSource: LINES, type: 'line' }], - bounds: [-4, 49, 94, -4], - panningEnabled: false, - zoomingEnabled: false, - controlBar: { enabled: false }, - tooltip: { enabled: false }, - }, { width: 240, height: 130 }); - - await shoot(t, 'Viz map line'); - }); - - test('a sankey link takes the published grey', async (t) => { - await inBothScopes('dxSankey', { - dataSource: [ - { source: 'A', target: 'X', weight: 4 }, - { source: 'A', target: 'Y', weight: 2 }, - { source: 'B', target: 'Y', weight: 3 }, - ], - label: { visible: false }, - tooltip: { enabled: false }, - }, { width: 240, height: 130 }); - - await shoot(t, 'Viz sankey link'); - }); - - test('the two-colour needle and the subvalue marker take the published names', async (t) => { - await inBothScopes('dxCircularGauge', { - scale: { startValue: 0, endValue: 100, label: { visible: false } }, - value: 62, - subvalues: [24], - valueIndicator: { type: 'twocolorneedle' }, - animation: { enabled: false }, - tooltip: { enabled: false }, - }, { width: 240, height: 150 }); - - await shoot(t, 'Viz gauge indicators'); - }); - - ['light', 'dark'].forEach((mode) => { - test(`the crosshair is drawn with its own published name: ${mode}`, async (t) => { - await drawScope(mode, 240, 140); - await createWidget('dxChart', { - dataSource: [4, 7, 5, 9].map((val, index) => ({ arg: index + 1, val })), - series: [{ type: 'line', argumentField: 'arg', valueField: 'val' }], - legend: { visible: false }, - animation: { enabled: false }, - crosshair: { enabled: true }, - tooltip: { enabled: false }, - }, `#${mode}`); - - await dragWithDisabledMouseUp(t, Selector(`#${mode}`), { offsetX: 30, offsetY: 0 }); - - await shoot(t, `Viz chart crosshair ${mode}`); - }); - }); - - ['light', 'dark'].forEach((mode) => { - test(`a range that is not allowed marks the slider with the published danger: ${mode}`, async (t) => { - await drawScope(mode, 400, 90); - await createWidget('dxRangeSelector', { - scale: { - startValue: 0, endValue: 100, tickInterval: 25, minRange: 30, - }, - value: [20, 70], - animation: { enabled: false }, - }, `#${mode}`); - - await dragWithDisabledMouseUp(t, Selector('#container .slider-tracker'), { offsetX: 130, offsetY: 0 }); - - await shoot(t, `Viz range selector invalid ${mode}`); - }); - }); - - test('the hairline between tree map tiles stays the same colour in both scopes', async (t) => { - await inBothScopes('dxTreeMap', { - dataSource: TILE_DATA, - valueField: 'value', - colorizer: { type: 'gradient', range: [0, 9] }, - tile: { label: { visible: false } }, - interactWithGroup: false, - tooltip: { enabled: false }, - }, { width: 240, height: 120 }); - - await shoot(t, 'Viz tree map tile border'); - }); -} diff --git a/e2e/testcafe-devextreme/tests/common/vizPalettes.ts b/e2e/testcafe-devextreme/tests/common/vizPalettes.ts deleted file mode 100644 index f4e1cdaa99a3..000000000000 --- a/e2e/testcafe-devextreme/tests/common/vizPalettes.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { ClientFunction } from 'testcafe'; -import url from '../../helpers/getPageUrl'; -import { createWidget } from '../../helpers/createWidget'; -import { clearTestPage } from '../../helpers/testPageUtils'; -import { getThemeName } from '../../helpers/themeUtils'; - -if (getThemeName() === 'fluent-next') { - fixture`Viz palettes` - .page(url(__dirname, '../container.html')) - .afterEach(async (t) => { await clearTestPage(t); }); - - const COUNT = 50; - const ROUNDING_APART = 2; - const LITERALS = ['#0078d4', '#c83d3d', '#008f04', '#eaa300', '#e43ba6', '#865cbf']; - - const distancesOver = ClientFunction(( - extensionMode: string, - count: number, - literals: string[], - ) => { - const { viz } = (window as any).DevExpress; - - viz.registerPalette('legacy literals', { - simpleSet: literals, - indicatingSet: [literals[2], literals[3], literals[1]], - gradientSet: [literals[0], literals[2]], - accentColor: '#0f6cbd', - }); - - const channelsOf = (color: string): number[] => { - const probe = document.createElement('div'); - - probe.style.cssText = 'position: absolute; visibility: hidden'; - probe.style.backgroundColor = color; - document.body.appendChild(probe); - - const painted = getComputedStyle(probe).backgroundColor; - - probe.remove(); - - const scale = painted.startsWith('color(') ? 255 : 1; - - return (painted.match(/-?[\d.]+/g) ?? []).slice(0, 3) - .map((channel) => Math.round(Math.min(255, Math.max(0, Number(channel) * scale)))); - }; - - const generated = (palette: string): string[] => viz - .generateColors(palette, count, { paletteExtensionMode: extensionMode, useHighlight: true }); - - const fromNames = generated('Fluent Next').map(channelsOf); - const fromLiterals = generated('legacy literals').map(channelsOf); - - return fromNames.map((channels: number[], index: number) => Math.max( - ...channels.map((channel, at) => Math.abs(channel - fromLiterals[index][at])), - )); - }); - - const handedOut = ClientFunction(() => { - const series = (window as any).widget.getAllSeries(); - - return [ - ...series.map((one: { getColor: () => string }) => one.getColor()), - ...series[0].getAllPoints().map((point: { getColor: () => string }) => point.getColor()), - ]; - }); - - test('a chart hands out colours an application can draw with, not references', async (t) => { - const handed = await handedOut(); - const unusable = handed.filter((color) => !/^(#[0-9a-f]{6}|rgba?\()/i.test(color)); - - await t.expect(handed.length).gt(0, 'the chart answered with colours'); - await t.expect(unusable).eql([], 'every colour is one an application can parse'); - }).before(async () => { - await createWidget('dxChart', { - dataSource: [{ arg: 'a', val: 1 }, { arg: 'b', val: 2 }], - series: [{ type: 'bar' }, { type: 'bar' }], - animation: { enabled: false }, - size: { width: 300, height: 200 }, - }); - }); - - ['blend', 'alternate', 'extrapolate'].forEach((extensionMode) => { - test(`the browser mixes ${extensionMode} into the same colors the old arithmetic did`, async (t) => { - const distances = await distancesOver(extensionMode, COUNT, LITERALS); - const furthest = Math.max(...distances); - const drifted = distances.filter((distance) => distance > ROUNDING_APART).length; - - await t.expect(distances.length).eql(COUNT, 'every colour of the run was compared'); - await t.expect(drifted).eql( - 0, - `${drifted} of ${COUNT} colours differ by more than ${ROUNDING_APART} of 255, the furthest by ${furthest}`, - ); - }); - }); -}