diff --git a/e2e/playwright/README.md b/e2e/playwright/README.md index 5891f87c6999..dbf8758a86b6 100644 --- a/e2e/playwright/README.md +++ b/e2e/playwright/README.md @@ -33,6 +33,14 @@ as a regular expression. The static server for the test page starts on its own. comparer did. Etalons live in `etalons/` next to the test and carry the theme in the file name — `PivotGrid markup (fluent.blue.light).png` — the same convention the TestCafe run uses. +An element shot takes the box of the element. The TestCafe one took its scroll size, so what +overflowed the element — a popup rendered into it, a validation message beside it — was in the +picture. Pass `withOverflow: true` when the test is about that content: + +```ts +await testScreenshot(page, 'DateBox popup.png', { element: '#container', withOverflow: true }); +``` + The pixel budget follows the renderer: the agent and the container draw the same pixels and are both judged strictly (`maxDiffPixels` 0, `threshold` 0.1), the UI mode included: no pixel may drift beyond the per-pixel threshold, which is what the TestCafe comparer enforced. A run on the host is @@ -52,11 +60,67 @@ docker/run.sh --update-snapshots # rewrite the etalons of the tests that ran The etalons here are recorded anew, not copied from `e2e/testcafe-devextreme`: the two runners crop and render differently, so a TestCafe image is not a valid reference for this suite. +It is still the check of the port. Recording writes whatever the test reached, and a verify run +compares against that same file, so neither notices a test that shot the wrong state. Before +deleting the TestCafe etalon, compare the new one with it: the same picture, within the per-pixel +threshold. Three differences are expected: + +- A scrollbar. This suite shows it, TestCafe cut it off, so a viewport shot of a page that + overflows comes out up to 15 px larger, with the scrollbar in the extra strip. +- Anything under a TestCafe mask (`_mask.png` next to the etalon, black where ignored). +- Single antialiased pixels on the edges of shapes that sit on fractional coordinates. The TestCafe + comparer ignored antialiasing (looks-same, `ignoreAntialiasing`, tolerance 5), so its etalon + could drift there unnoticed; this suite compares them strictly. + +Anything else, a block of pixels or a moved edge, means the test reached a different state; find +out why rather than accept the image. + +**Masks.** `testScreenshot` takes no mask, and the usual reason for one is gone: +`toHaveScreenshot` stops CSS animations (an infinite one at its first frame) and hides the caret. +Port a masked test without its mask, then run it strictly in the container a few times in a row +(`--repeat-each 10`). If it is stable, delete the mask with the TestCafe etalon. If it is not, make +the state deterministic (stop the animation, fix the data or the clock) rather than hide it. + Migrating a test means, in one PR: port the test, record its etalon here, and delete the TestCafe test together with its etalon. The two sets must never cover the same case at once — a stale pair left behind gets updated by whoever touches the component next and starts asserting a render nobody checks. +### Record etalons on a Mac + +The image is `linux/amd64`, the platform of the CI agent. On Apple Silicon it runs through Rosetta; +under QEMU emulation Chrome is several times slower. [Colima](https://github.com/abiosoft/colima) +gives the `docker` CLI a free runtime that uses Rosetta: + +```bash +softwareupdate --install-rosetta --agree-to-license +brew install colima docker docker-buildx +colima start --vm-type vz --vz-rosetta --cpu 4 --memory 8 +docker run --rm --platform linux/amd64 ubuntu:24.04 uname -m # prints x86_64 +``` + +4 CPUs and 8 GB are enough for a component folder: `docker/run.sh` takes half the cores, so two +workers. Give the VM more for a larger run (`colima stop`, then `colima start --cpu 8 --memory 12`). +After a reboot, `colima start` brings it back with the same settings. + +The container uses the host's `node_modules` and DevExtreme build, so build first and rebuild after +a source change. Then, from `e2e/playwright`, record and verify the etalons of the folder in both +themes the CI jobs run: + +```bash +pnpm exec nx build devextreme-scss # from the repository root +pnpm exec nx build devextreme -c testing + +docker/run.sh --update-snapshots tests/editors/selectBox/ +THEME=fluent-next.blue.light docker/run.sh --update-snapshots tests/editors/selectBox/ + +docker/run.sh tests/editors/selectBox/ +THEME=fluent-next.blue.light docker/run.sh tests/editors/selectBox/ +``` + +The first run builds the image and takes a few minutes. Look through the new files before +committing them, as with etalons from CI. + ### Etalons from CI Without a container, CI records the etalons. A test whose etalon does not exist fails, and @@ -183,6 +247,13 @@ viewport is 1200×800 and the widgets of the previous test are disposed. Port a test one to one: the same steps, the same checks, the same screenshot names. A title changes only when it repeats in the file, which Playwright rejects: add the loop parameters to it. +**`runInTheme`.** In TestCafe it was a filter, not a setting: the test ran only in the job whose +theme matched — usually one of the whole-suite theme jobs — and the folder jobs skipped it. +`test.use({ theme })` instead runs the test in that theme in every job that takes its folder, the +default and the `- fluent-next` one. That is the port: the result does not depend on the job, and a +screenshot keeps one etalon named after the pinned theme. Do not add a theme tag on top of it: the +test would run once more in the tagged job. + **Typing.** `fill` sets the value at once and sends no key events, so masked, numeric and date editors do not react to it. Type with `pressSequentially`, and press keys under their Playwright names: `Enter`, `Escape`, `ArrowLeft`, `Control+a`. @@ -194,13 +265,21 @@ whenever the page is a moment late. **Waiting.** A step waits for the state it needs, never for time. `helpers/`, `models/` and the test folders migrated under this rule (see `eslint.config.mjs`) may not use `waitForTimeout`, `setTimeout`, `force: true`, `toPass`, a `timeout` option or a call that raises a timeout -(`test.setTimeout`, `page.setDefaultTimeout`). When a widget reacts to a change -through an observer and leaves nothing to assert on, `waitForNextFrame` waits for the frame in which -the observer runs. +(`test.setTimeout`, `page.setDefaultTimeout`). **Clicks.** A click is a real one: it lands on the topmost element at that point and fails when that is not the target. TestCafe delivered a click to a covered element anyway, so a test that relied on it needs the target made reachable, not the check switched off. +**Scrolling before a click.** TestCafe scrolled the whole target into view before a click; +Playwright scrolls only as far as the click point. When the target is wider or taller than the +window, the focus then scrolls the page after the click, and a drop-down closes on that scroll — +sometimes before the next step, sometimes after it. Scroll the target into view first, as TestCafe +did: `element.scrollIntoView({ block: 'nearest', inline: 'nearest' })` in `locator.evaluate`. + **Page errors.** A test fails on an uncaught error in the page, as it did in TestCafe. A test whose TestCafe version ended with `expect(true).ok()` checks exactly that and needs no assertion. + +**Old models.** A model in `packages/testcafe-models` that the ported tests used goes in the same +PR, but only after a search proves nothing else uses it: grep all of `e2e/` and `packages/` for its +import path, since other tests and other models import models too. A model still in use stays. diff --git a/e2e/playwright/helpers/domUtils.ts b/e2e/playwright/helpers/domUtils.ts index 02145bde32ab..07ef16081cfb 100644 --- a/e2e/playwright/helpers/domUtils.ts +++ b/e2e/playwright/helpers/domUtils.ts @@ -14,17 +14,6 @@ export const setAttribute = async ( { elementSelector: selector, name: attribute, attributeValue: value }, ); -export const removeAttribute = async ( - page: Page, - selector: string, - attribute: string, -): Promise => page.evaluate( - ({ elementSelector, name }) => { - document.querySelector(elementSelector)?.removeAttribute(name); - }, - { elementSelector: selector, name: attribute }, -); - export const appendAttributeValue = async ( page: Page, selector: string, @@ -164,9 +153,3 @@ export const addFocusableElementBefore = async ( }, { selector: targetSelector, id: elementId }, ); - -export const waitForNextFrame = async (page: Page): Promise => page.evaluate( - () => new Promise((resolve) => { - requestAnimationFrame(() => requestAnimationFrame(() => resolve())); - }), -); diff --git a/e2e/playwright/helpers/screenshots.ts b/e2e/playwright/helpers/screenshots.ts index 70cd323293c4..11612ccdcac0 100644 --- a/e2e/playwright/helpers/screenshots.ts +++ b/e2e/playwright/helpers/screenshots.ts @@ -5,6 +5,9 @@ import { changeTheme, getCurrentTheme } from './testPageUtils'; export interface ScreenshotOptions { element?: Locator | string | null; + // Shoots the scroll size of the element instead of its box, the way the TestCafe element shot + // did: what overflows the element, such as a popup rendered into it, stays in the picture. + withOverflow?: boolean; theme?: string; shouldTestInCompact?: boolean; compactCallBack?: () => Promise; @@ -48,6 +51,7 @@ const viewportClip = async (page: Page): Promise<{ const clippedToViewport = async ( page: Page, locator: Locator, + withOverflow: boolean, ): Promise<{ x: number; y: number; width: number; height: number } | null> => { const box = await locator.boundingBox(); @@ -56,17 +60,27 @@ const clippedToViewport = async ( } const viewport = await viewportClip(page); - - if (box.width <= viewport.width && box.height <= viewport.height) { + const scrollSize = withOverflow + ? await locator.evaluate((element) => ({ + width: element.clientLeft + element.scrollWidth, + height: element.clientTop + element.scrollHeight, + })) + : { width: 0, height: 0 }; + const fitsViewport = Math.max(box.width, scrollSize.width) <= viewport.width + && Math.max(box.height, scrollSize.height) <= viewport.height; + + if (fitsViewport && !withOverflow) { return null; } - // The clip has to stay inside the viewport: a full-page capture widens the viewport to the whole - // document, the scrollbar goes away, and a widget that fills its container re-lays out to the - // wider space — the shot would show a layout the page never had. - await locator.evaluate((element) => { - element.scrollIntoView({ block: 'start', inline: 'start' }); - }); + if (!fitsViewport) { + // The clip has to stay inside the viewport: a full-page capture widens the viewport to the + // whole document, the scrollbar goes away, and a widget that fills its container re-lays out + // to the wider space — the shot would show a layout the page never had. + await locator.evaluate((element) => { + element.scrollIntoView({ block: 'start', inline: 'start' }); + }); + } const scrolled = await locator.boundingBox() ?? box; const x = Math.max(scrolled.x, 0); @@ -75,8 +89,8 @@ const clippedToViewport = async ( return { x, y, - width: Math.min(scrolled.width, viewport.width - x), - height: Math.min(scrolled.height, viewport.height - y), + width: Math.min(Math.max(scrolled.width, scrollSize.width), viewport.width - x), + height: Math.min(Math.max(scrolled.height, scrollSize.height), viewport.height - y), }; }; @@ -84,13 +98,14 @@ const expectScreenshot = async ( page: Page, locator: Locator | null, name: string, + withOverflow: boolean, ): Promise => { if (!locator) { await expect(page).toHaveScreenshot([name]); return; } - const clip = await clippedToViewport(page, locator); + const clip = await clippedToViewport(page, locator, withOverflow); if (clip) { await expect(page).toHaveScreenshot([name], { clip }); @@ -107,6 +122,7 @@ export async function testScreenshot( ): Promise { const { element, + withOverflow = false, theme, shouldTestInCompact = false, compactCallBack, @@ -123,7 +139,12 @@ export async function testScreenshot( // No element means the whole viewport, the way the TestCafe comparer read a missing element. const target = resolveLocator(page, element); - await expectScreenshot(page, target, getScreenshotName(screenshotName, theme ?? activeTheme)); + await expectScreenshot( + page, + target, + getScreenshotName(screenshotName, theme ?? activeTheme), + withOverflow, + ); if (shouldTestInCompact) { // The theme of a "- compact" job already ends with the suffix; appending it twice would ask @@ -133,7 +154,12 @@ export async function testScreenshot( await changeTheme(page, compactTheme); await compactCallBack?.(); - await expectScreenshot(page, target, getScreenshotName(screenshotName, compactTheme)); + await expectScreenshot( + page, + target, + getScreenshotName(screenshotName, compactTheme), + withOverflow, + ); } if (theme || shouldTestInCompact) { diff --git a/e2e/playwright/models/calendar/index.ts b/e2e/playwright/models/calendar/index.ts new file mode 100644 index 000000000000..a2e15e98c913 --- /dev/null +++ b/e2e/playwright/models/calendar/index.ts @@ -0,0 +1,123 @@ +import type { Locator } from '@playwright/test'; +import type { WidgetName } from '../types'; +import Button from '../button'; +import Widget from '../internal/widget'; +import CalendarView from './view'; + +const CLASS = { + widget: 'dx-widget', + calendarViewsWrapper: 'dx-calendar-views-wrapper', + todayButton: 'dx-calendar-today-button', + otherMonth: 'dx-calendar-other-month', + cellInRange: 'dx-calendar-cell-in-range', + cellInRangeStart: 'dx-calendar-range-start-date', + cellInRangeEnd: 'dx-calendar-range-end-date', + cellInHoveredRange: 'dx-calendar-cell-range-hover', + cellInHoveredRangeStart: 'dx-calendar-cell-range-hover-start', + cellInHoveredRangeEnd: 'dx-calendar-cell-range-hover-end', + navigatorNextView: 'dx-calendar-navigator-next-view', + navigatorPrevView: 'dx-calendar-navigator-previous-view', + navigatorCaption: 'dx-calendar-caption-button', +}; + +export default class Calendar extends Widget { + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxCalendar'; } + + public getSelectedRangeCells(): Locator { + return this.element.locator(`.${CLASS.cellInRange}`); + } + + public getSelectedRangeStartCell(): Locator { + return this.element.locator(`.${CLASS.cellInRangeStart}:not(.${CLASS.otherMonth})`); + } + + public getSelectedRangeEndCell(): Locator { + return this.element.locator(`.${CLASS.cellInRangeEnd}`); + } + + public getHoveredRangeCells(): Locator { + return this.element.locator(`.${CLASS.cellInHoveredRange}`); + } + + public getHoveredRangeStartCell(): Locator { + return this.element.locator(`.${CLASS.cellInHoveredRangeStart}`); + } + + public getHoveredRangeEndCell(): Locator { + return this.element.locator(`.${CLASS.cellInHoveredRangeEnd}`); + } + + public getView(): CalendarView { + return new CalendarView( + this.page, + this.element.locator(`.${CLASS.calendarViewsWrapper} .${CLASS.widget}`).first(), + ); + } + + public getNavigatorNextButton(): Button { + return new Button(this.page, this.element.locator(`.${CLASS.navigatorNextView}`)); + } + + public getNavigatorPrevButton(): Button { + return new Button(this.page, this.element.locator(`.${CLASS.navigatorPrevView}`)); + } + + public getNavigatorCaption(): Button { + return new Button(this.page, this.element.locator(`.${CLASS.navigatorCaption}`)); + } + + public getTodayButton(): Button { + return new Button(this.page, this.element.locator(`.${CLASS.todayButton}`)); + } + + public getCellByDate(date: string): Locator { + return this.element.locator(`*[data-value="${date}"]:not(.${CLASS.otherMonth})`); + } + + public async showGestureCover(): Promise { + await this.element.evaluate((element) => { + const $element = $(element); + const { left = 0 } = $element.offset() ?? {}; + + $element.trigger($.Event('dxpointerdown', { + pageX: left, + pointers: [{ pointerId: 1 }], + })); + + $element.trigger($.Event('dxpointermove', { + pageX: left + 20, + pointers: [{ pointerId: 1 }], + })); + + $element.trigger($.Event('mouseup', { + pointers: [{ pointerId: 1 }], + })); + }); + } + + public async swipeStart(): Promise { + await this.element.evaluate((element) => { + $(element).trigger($.Event('dxswipestart', { + pointers: [{ pointerId: 1 }], + })); + }); + } + + public async swipe(offset: number): Promise { + await this.element.evaluate((element, swipeOffset) => { + $(element).trigger($.Event('dxswipe', { + offset: swipeOffset, + pointers: [{ pointerId: 1 }], + })); + }, offset); + } + + public async swipeEnd(): Promise { + await this.element.evaluate((element) => { + $(element).trigger($.Event('dxswipeend', { + pointers: [{ pointerId: 1 }], + })); + }); + } +} diff --git a/e2e/playwright/models/calendar/view.ts b/e2e/playwright/models/calendar/view.ts new file mode 100644 index 000000000000..39ac5c35787a --- /dev/null +++ b/e2e/playwright/models/calendar/view.ts @@ -0,0 +1,47 @@ +import type { Locator } from '@playwright/test'; +import type { WidgetName } from '../types'; +import Widget from '../internal/widget'; + +const CLASS = { + cell: 'dx-calendar-cell', + weekNumberCell: 'dx-calendar-week-number-cell', +}; + +const serializeDate = (date: Date): string => [ + String(date.getFullYear()).padStart(4, '0'), + String(date.getMonth() + 1).padStart(2, '0'), + String(date.getDate()).padStart(2, '0'), +].join('/'); + +export default class CalendarView extends Widget { + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxCalendarView'; } + + public getCellByDate(date: Date): Locator { + return this.element.locator(`td[data-value='${serializeDate(date)}']`); + } + + public getMonthCellByDate(date: Date): Locator { + const foundDate = new Date(date); + + foundDate.setDate(1); + + return this.getCellByDate(foundDate); + } + + public getCellByOffset(date: Date, offset: number): Locator { + const foundDate = new Date(date); + + foundDate.setDate(foundDate.getDate() + offset); + + return this.getCellByDate(foundDate); + } + + public getCellByIndex(index: number): Locator { + return this.element.locator(`.${CLASS.cell}`).nth(index); + } + + public getWeekNumberCellByIndex(index: number): Locator { + return this.element.locator(`.${CLASS.weekNumberCell}`).nth(index); + } +} diff --git a/e2e/playwright/models/dateBox.ts b/e2e/playwright/models/dateBox.ts new file mode 100644 index 000000000000..ebbe0c161239 --- /dev/null +++ b/e2e/playwright/models/dateBox.ts @@ -0,0 +1,39 @@ +import type { Locator, Page } from '@playwright/test'; +import type { WidgetName } from './types'; +import Popup from './popup'; +import TextBox from './textBox'; + +const CLASS = { + dropDownEditorButton: 'dx-dropdowneditor-button', + button: 'dx-button', + doneButton: 'dx-popup-done', + popup: 'dx-popup', + scrollableContainer: 'dx-scrollable-container', +}; + +export default class DateBox extends TextBox { + public readonly dropDownEditorButton: Locator; + + constructor(page: Page, selector: Locator | string) { + super(page, selector); + + this.dropDownEditorButton = this.element.locator(`.${CLASS.dropDownEditorButton}`); + } + + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxDateBox'; } + + public getDoneButton(): Locator { + return this.page.locator(`.${CLASS.button}.${CLASS.doneButton}`); + } + + public getRollerScrollTop(viewName: string): Promise { + return this.page + .locator(`.dx-dateviewroller-${viewName} .${CLASS.scrollableContainer}`) + .evaluate((container) => container.scrollTop); + } + + public getPopup(): Popup { + return new Popup(this.page, this.element.locator(`.${CLASS.popup}`)); + } +} diff --git a/e2e/playwright/models/dateRangeBox.ts b/e2e/playwright/models/dateRangeBox.ts new file mode 100644 index 000000000000..ff961d8d7385 --- /dev/null +++ b/e2e/playwright/models/dateRangeBox.ts @@ -0,0 +1,57 @@ +import type { Locator, Page } from '@playwright/test'; +import type { WidgetName } from './types'; +import Calendar from './calendar'; +import DateBox from './dateBox'; +import Widget from './internal/widget'; +import Popup from './popup'; + +const CLASS = { + popup: 'dx-popup', + calendar: 'dx-calendar', + calendarCell: 'dx-calendar-cell', + startDateDateBox: 'dx-start-datebox', + endDateDateBox: 'dx-end-datebox', + dropDownButton: 'dx-dropdowneditor-button', + clearButton: 'dx-clear-button-area', + buttonsContainer: 'dx-texteditor-buttons-container', + separator: 'dx-daterangebox-separator', +}; + +export default class DateRangeBox extends Widget { + public readonly dropDownButton: Locator; + + public readonly clearButton: Locator; + + public readonly separator: Locator; + + constructor(page: Page, selector: Locator | string) { + super(page, selector); + + this.dropDownButton = this.element.locator(`.${CLASS.dropDownButton}`); + this.separator = this.element.locator(`.${CLASS.separator}`); + this.clearButton = this.element.locator(`.${CLASS.buttonsContainer} .${CLASS.clearButton}`); + } + + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxDateRangeBox'; } + + public getPopup(): Popup { + return new Popup(this.page, this.getStartDateBox().element.locator(`.${CLASS.popup}`)); + } + + public getCalendar(): Calendar { + return new Calendar(this.page, this.getPopup().getContent().locator(`.${CLASS.calendar}`)); + } + + public getCalendarCell(index: number): Locator { + return this.getCalendar().element.locator(`.${CLASS.calendarCell}`).nth(index); + } + + public getStartDateBox(): DateBox { + return new DateBox(this.page, this.element.locator(`.${CLASS.startDateDateBox}`)); + } + + public getEndDateBox(): DateBox { + return new DateBox(this.page, this.element.locator(`.${CLASS.endDateDateBox}`)); + } +} diff --git a/e2e/playwright/models/dropDownButton.ts b/e2e/playwright/models/dropDownButton.ts new file mode 100644 index 000000000000..791db2147f21 --- /dev/null +++ b/e2e/playwright/models/dropDownButton.ts @@ -0,0 +1,13 @@ +import type { Locator } from '@playwright/test'; +import type { WidgetName } from './types'; +import DropDownList from './internal/dropDownList'; + +export default class DropDownButton extends DropDownList { + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxDropDownButton'; } + + // The widget element itself names the popup content. + public getPopupOwner(): Locator { + return this.element; + } +} diff --git a/e2e/playwright/models/internal/classMatcher.ts b/e2e/playwright/models/internal/classMatcher.ts index 1d08dd723938..2767749da756 100644 --- a/e2e/playwright/models/internal/classMatcher.ts +++ b/e2e/playwright/models/internal/classMatcher.ts @@ -1 +1,14 @@ +import type { Locator } from '@playwright/test'; +import { expect } from '@playwright/test'; + export const classMatcher = (className: string): RegExp => new RegExp(`(^|\\s)${className}(\\s|$)`); + +export const expectClass = async ( + locator: Locator, + className: string, + present = true, +): Promise => { + const assertion = expect(locator); + + await (present ? assertion : assertion.not).toHaveClass(classMatcher(className)); +}; diff --git a/e2e/playwright/models/internal/dropDownList.ts b/e2e/playwright/models/internal/dropDownList.ts new file mode 100644 index 000000000000..3d4b6a934238 --- /dev/null +++ b/e2e/playwright/models/internal/dropDownList.ts @@ -0,0 +1,59 @@ +import type { Locator, Page } from '@playwright/test'; +import { expect } from '@playwright/test'; +import List from '../list'; +import TextBox from '../textBox'; + +const ATTR = { + popupId: 'aria-owns', +}; + +const CLASS = { + dropDownButton: 'dx-dropdowneditor-button', + invisible: 'dx-state-invisible', + list: 'dx-list', +}; + +export default abstract class DropDownList extends TextBox { + public readonly dropDownButton: Locator; + + constructor(page: Page, selector: Locator | string) { + super(page, selector); + + this.dropDownButton = this.element.locator(`.${CLASS.dropDownButton}`); + } + + // The element that names the popup content in "aria-owns" once the popup is rendered; the + // content itself sits in an overlay wrapper elsewhere in the body. + public getPopupOwner(): Locator { + return this.input; + } + + public isOpened(): Promise { + return this.getPopupOwner().evaluate((owner, { attr, invisible }) => { + const popupId = owner.getAttribute(attr); + const popup = popupId ? document.getElementById(popupId) : null; + + return !!popup && !popup.parentElement?.classList.contains(invisible); + }, { attr: ATTR.popupId, invisible: CLASS.invisible }); + } + + public async getPopup(): Promise { + const owner = this.getPopupOwner(); + + await expect(owner).toHaveAttribute(ATTR.popupId, /./); + + const popupId = await owner.getAttribute(ATTR.popupId); + + return this.page.locator(`#${popupId}`); + } + + public async getList(): Promise { + await expect.poll(() => this.isOpened()).toBe(true); + + return new List(this.page, (await this.getPopup()).locator(`.${CLASS.list}`)); + } + + public async open(): Promise { + await this.invoke('open'); + } +} diff --git a/e2e/playwright/models/internal/widget.ts b/e2e/playwright/models/internal/widget.ts index 5f8bae7b7a51..bf175767d50b 100644 --- a/e2e/playwright/models/internal/widget.ts +++ b/e2e/playwright/models/internal/widget.ts @@ -1,8 +1,7 @@ import type { Locator, Page } from '@playwright/test'; -import { expect } from '@playwright/test'; import type { WidgetName } from '../types'; import { hasClass } from './hasClass'; -import { classMatcher } from './classMatcher'; +import { expectClass } from './classMatcher'; const CLASS = { focused: 'dx-state-focused', @@ -29,10 +28,8 @@ export default abstract class Widget { return `dx-${widgetName.slice(2).toLowerCase() + (className ? `-${className}` : '')}`; } - public async expectClass(className: string, present = true): Promise { - const assertion = expect(this.element); - - await (present ? assertion : assertion.not).toHaveClass(classMatcher(className)); + public expectClass(className: string, present = true): Promise { + return expectClass(this.element, className, present); } public expectState(state: WidgetState, present = true): Promise { diff --git a/e2e/playwright/models/list/checkBox.ts b/e2e/playwright/models/list/checkBox.ts new file mode 100644 index 000000000000..794d7c89fb92 --- /dev/null +++ b/e2e/playwright/models/list/checkBox.ts @@ -0,0 +1,28 @@ +import type { Locator } from '@playwright/test'; +import { expectClass } from '../internal/classMatcher'; + +const CLASS = { + checkBox: 'dx-checkbox', + checked: 'dx-checkbox-checked', + focused: 'dx-state-focused', +}; + +export default class ListItemCheckBox { + public readonly element: Locator; + + private readonly item: Locator; + + constructor(item: Locator) { + this.item = item; + this.element = item.locator(`.${CLASS.checkBox}`); + } + + public expectChecked(present = true): Promise { + return expectClass(this.element, CLASS.checked, present); + } + + // The list moves the focus between its items; the check box itself never takes it. + public expectFocused(present = true): Promise { + return expectClass(this.item, CLASS.focused, present); + } +} diff --git a/e2e/playwright/models/list/index.ts b/e2e/playwright/models/list/index.ts new file mode 100644 index 000000000000..ca89a7cab35d --- /dev/null +++ b/e2e/playwright/models/list/index.ts @@ -0,0 +1,34 @@ +import type { Locator, Page } from '@playwright/test'; +import type { WidgetName } from '../types'; +import Widget from '../internal/widget'; +import ListItem from './item'; + +const CLASS = { + item: 'dx-list-item', + nestedItem: 'nested-item', + selectAll: 'dx-list-select-all', +}; + +export default class List extends Widget { + public readonly items: Locator; + + public readonly selectAll: ListItem; + + constructor(page: Page, selector: Locator | string) { + super(page, selector); + + this.items = this.element.locator(`.${CLASS.item}:not(.${CLASS.nestedItem})`); + this.selectAll = new ListItem(this.element.locator(`.${CLASS.selectAll}`)); + } + + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxList'; } + + public getItem(index = 0): ListItem { + return new ListItem(this.items.nth(index)); + } + + public async scrollTo(value: number): Promise { + await this.invoke('scrollTo', value); + } +} diff --git a/e2e/playwright/models/list/item.ts b/e2e/playwright/models/list/item.ts new file mode 100644 index 000000000000..82edf9c37284 --- /dev/null +++ b/e2e/playwright/models/list/item.ts @@ -0,0 +1,22 @@ +import type { Locator } from '@playwright/test'; +import { expectClass } from '../internal/classMatcher'; +import ListItemCheckBox from './checkBox'; + +const CLASS = { + disabled: 'dx-state-disabled', +}; + +export default class ListItem { + public readonly element: Locator; + + public readonly checkBox: ListItemCheckBox; + + constructor(element: Locator) { + this.element = element; + this.checkBox = new ListItemCheckBox(element); + } + + public expectDisabled(present = true): Promise { + return expectClass(this.element, CLASS.disabled, present); + } +} diff --git a/e2e/playwright/models/lookup.ts b/e2e/playwright/models/lookup.ts new file mode 100644 index 000000000000..452580682b62 --- /dev/null +++ b/e2e/playwright/models/lookup.ts @@ -0,0 +1,25 @@ +import type { Locator, Page } from '@playwright/test'; +import type { WidgetName } from './types'; +import DropDownList from './internal/dropDownList'; + +const CLASS = { + field: 'dx-lookup-field', +}; + +export default class Lookup extends DropDownList { + public readonly field: Locator; + + constructor(page: Page, selector: Locator | string) { + super(page, selector); + + this.field = this.element.locator(`.${CLASS.field}`); + } + + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxLookup'; } + + // Lookup has no text input: the field takes its place. + public getPopupOwner(): Locator { + return this.field; + } +} diff --git a/e2e/playwright/models/popup.ts b/e2e/playwright/models/popup.ts index 9502b9995316..fc25d0eeea48 100644 --- a/e2e/playwright/models/popup.ts +++ b/e2e/playwright/models/popup.ts @@ -10,6 +10,11 @@ const CLASS = { closeButton: 'dx-closebutton', doneButton: 'dx-popup-done', cancelButton: 'dx-popup-cancel', + todayButton: 'dx-button-today', + navigatorNextView: 'dx-calendar-navigator-next-view', + navigatorPrevView: 'dx-calendar-navigator-previous-view', + navigatorCaption: 'dx-calendar-caption-button', + viewsWrapper: 'dx-calendar-views-wrapper', }; export default class Popup extends Overlay { @@ -26,6 +31,10 @@ export default class Popup extends Overlay { return this.getWrapper().locator(`.${CLASS.bottomToolbar}`); } + public getViewsWrapper(): Locator { + return this.page.locator(`.${CLASS.viewsWrapper}`); + } + public getButton(index = 0): Button { return new Button(this.page, this.getWrapper().locator(`.${CLASS.button}`).nth(index)); } @@ -44,4 +53,20 @@ export default class Popup extends Overlay { this.getWrapper().locator(`.${CLASS.button}.${CLASS.cancelButton}`), ); } + + public getTodayButton(): Button { + return new Button(this.page, this.getWrapper().locator(`.${CLASS.todayButton}`)); + } + + public getNavigatorPrevButton(): Button { + return new Button(this.page, this.getWrapper().locator(`.${CLASS.navigatorPrevView}`)); + } + + public getNavigatorNextButton(): Button { + return new Button(this.page, this.getWrapper().locator(`.${CLASS.navigatorNextView}`)); + } + + public getNavigatorCaption(): Button { + return new Button(this.page, this.getWrapper().locator(`.${CLASS.navigatorCaption}`)); + } } diff --git a/e2e/playwright/models/radioGroup/button.ts b/e2e/playwright/models/radioGroup/button.ts index 1e1cf2e4f810..6673d6c21d28 100644 --- a/e2e/playwright/models/radioGroup/button.ts +++ b/e2e/playwright/models/radioGroup/button.ts @@ -1,6 +1,5 @@ import type { Locator } from '@playwright/test'; -import { expect } from '@playwright/test'; -import { classMatcher } from '../internal/classMatcher'; +import { expectClass } from '../internal/classMatcher'; const CLASS = { valueContainer: 'dx-radio-value-container', @@ -18,9 +17,7 @@ export default class RadioButton { this.element = item.locator(`:scope > .${CLASS.valueContainer} > .${CLASS.icon}`); } - public async expectChecked(present = true): Promise { - const assertion = expect(this.item); - - await (present ? assertion : assertion.not).toHaveClass(classMatcher(CLASS.checked)); + public expectChecked(present = true): Promise { + return expectClass(this.item, CLASS.checked, present); } } diff --git a/e2e/playwright/models/selectBox.ts b/e2e/playwright/models/selectBox.ts new file mode 100644 index 000000000000..fa44d41b035a --- /dev/null +++ b/e2e/playwright/models/selectBox.ts @@ -0,0 +1,7 @@ +import type { WidgetName } from './types'; +import DropDownList from './internal/dropDownList'; + +export default class SelectBox extends DropDownList { + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxSelectBox'; } +} diff --git a/e2e/playwright/models/tagBox.ts b/e2e/playwright/models/tagBox.ts new file mode 100644 index 000000000000..f1aba00570f5 --- /dev/null +++ b/e2e/playwright/models/tagBox.ts @@ -0,0 +1,20 @@ +import type { Locator, Page } from '@playwright/test'; +import type { WidgetName } from './types'; +import SelectBox from './selectBox'; + +const CLASS = { + tag: 'dx-tag', +}; + +export default class TagBox extends SelectBox { + public readonly tags: Locator; + + constructor(page: Page, selector: Locator | string) { + super(page, selector); + + this.tags = this.element.locator(`.${CLASS.tag}`); + } + + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxTagBox'; } +} diff --git a/e2e/playwright/models/textBox.ts b/e2e/playwright/models/textBox.ts index c53a59c206ca..5b351127e5c6 100644 --- a/e2e/playwright/models/textBox.ts +++ b/e2e/playwright/models/textBox.ts @@ -1,10 +1,13 @@ import type { Locator, Page } from '@playwright/test'; import type { WidgetName } from './types'; import Widget from './internal/widget'; +import Button from './button'; const CLASS = { input: 'dx-texteditor-input', label: 'dx-label', + buttonsContainer: 'dx-texteditor-buttons-container', + button: 'dx-button', }; export default class TextBox extends Widget { @@ -19,6 +22,13 @@ export default class TextBox extends Widget { // eslint-disable-next-line class-methods-use-this public getName(): WidgetName { return 'dxTextBox'; } + public getButton(index = 0): Button { + return new Button( + this.page, + this.element.locator(`.${CLASS.buttonsContainer} > .${CLASS.button}`).nth(index), + ); + } + public getLabel(): Locator { return this.element.locator(`.${CLASS.label}`); } diff --git a/e2e/playwright/tests/editors/calendar/common.spec.ts b/e2e/playwright/tests/editors/calendar/common.spec.ts new file mode 100644 index 000000000000..48d5c6ea6b39 --- /dev/null +++ b/e2e/playwright/tests/editors/calendar/common.spec.ts @@ -0,0 +1,332 @@ +import type { Locator, Page } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import Calendar from '../../../models/calendar'; +import { expectClass } from '../../../models/internal/classMatcher'; + +const STATE_HOVER_CLASS = 'dx-state-hover'; +const STATE_ACTIVE_CLASS = 'dx-state-active'; +const CALENDAR_CELL_CLASS = 'dx-calendar-cell'; +const CALENDAR_TODAY_CLASS = 'dx-calendar-today'; +const CALENDAR_SELECTED_DATE_CLASS = 'dx-calendar-selected-date'; +const CALENDAR_EMPTY_CELL_CLASS = 'dx-calendar-empty-cell'; +const CALENDAR_OTHER_VIEW_CLASS = 'dx-calendar-other-view'; +const CALENDAR_CONTOURED_DATE_CLASS = 'dx-calendar-contoured-date'; + +const GESTURE_COVER_CLASS = 'dx-gesture-cover'; + +const addCellClasses = async (cell: Locator, classes: string): Promise => cell.evaluate( + (element, value) => { + element.setAttribute('class', `${element.getAttribute('class') ?? ''} ${value}`); + }, + classes, +); + +const addCellCaption = async ( + page: Page, + cellNumber: number, + cellClasses: string, +): Promise => { + const cellId = `cell-${cellNumber}`; + + await appendElementTo(page, '#container', 'div', cellId); + await page.evaluate(({ id, text }) => { + $(`#${id}`).text(text); + }, { id: cellId, text: `${cellNumber} - ${cellClasses}` }); +}; + +test.describe('Calendar', () => { + test('Caption button text should be ellipsis when width is limit', async ({ page }) => { + await createWidget(page, 'dxCalendar', { + width: 150, + value: new Date(2021, 9, 17), + }); + + await testScreenshot(page, 'Calendar with limit width.png', { element: '#container' }); + }); + + test('Grabbing cursor should be shown during swipe', async ({ page }) => { + await createWidget(page, 'dxCalendar', { + value: new Date(2021, 9, 17), + }); + + const calendar = new Calendar(page, '#container'); + + await calendar.showGestureCover(); + + const gestureCover = page.locator(`.${GESTURE_COVER_CLASS}`); + + await expect(gestureCover).toHaveCSS('cursor', 'auto'); + + await calendar.swipeStart(); + + await expect(gestureCover).toHaveCSS('cursor', 'grabbing'); + + await calendar.swipe(0.4); + + await expect(gestureCover).toHaveCSS('cursor', 'grabbing'); + + await calendar.swipeEnd(); + + await expect(gestureCover).toHaveCSS('cursor', 'auto'); + }); + + test('Cells on month view should have hover state class after hover when zoomLevel has been changed from "year" to "month" by click on cell', async ({ page }) => { + await createWidget(page, 'dxCalendar', { + zoomLevel: 'year', + value: new Date(2021, 9, 17), + }); + + const calendar = new Calendar(page, '#container'); + + await calendar.getView().getMonthCellByDate(new Date(2021, 9, 17)).click(); + + const targetCell = calendar.getView().getCellByDate(new Date(2021, 9, 19)); + + await targetCell.hover(); + await expectClass(targetCell, STATE_HOVER_CLASS); + }); + + test('Calendar with showWeekNumbers rendered correct', async ({ page }) => { + await createWidget(page, 'dxCalendar', { + value: new Date(2022, 0, 1), + showWeekNumbers: true, + }); + + await testScreenshot(page, 'Calendar with showWeekNumbers.png', { element: '#container' }); + }); + + test('Calendar with showWeekNumbers rendered correct for last week of year value', async ({ page }) => { + await createWidget(page, 'dxCalendar', { + value: new Date(2021, 11, 31), + showWeekNumbers: true, + weekNumberRule: 'firstDay', + }); + + await testScreenshot(page, 'Calendar with showWeekNumbers last week.png', { element: '#container' }); + }); + + test('Calendar with showWeekNumbers rendered correct with rtlEnabled', async ({ page }) => { + await createWidget(page, 'dxCalendar', { + value: new Date(2022, 0, 1), + showWeekNumbers: true, + rtlEnabled: true, + }); + + await testScreenshot(page, 'Calendar with showWeekNumbers rtl=true.png', { element: '#container' }); + }); + + test('Calendar with showWeekNumbers rendered correct with cellTemplate', async ({ page }) => { + await createWidget(page, 'dxCalendar', () => ({ + value: new Date(2022, 0, 1), + showWeekNumbers: true, + cellTemplate(cellData, cellIndex) { + const italic = $('').css('font-style', 'italic') + .text(cellData.text); + const bold = $('').css('font-weight', '900') + .text(cellData.text); + + return cellIndex === -1 ? bold : italic; + }, + })); + + await testScreenshot(page, 'Calendar with showWeekNumbers and cell template.png', { element: '#container' }); + }); + + ['multiple', 'range'].forEach((selectionMode) => { + test(`Calendar with ${selectionMode} selectionMode rendered correct`, async ({ page }) => { + await createWidget(page, 'dxCalendar', { + value: [new Date(2023, 0, 5), new Date(2023, 0, 17), new Date(2023, 1, 2)], + selectionMode, + }); + + await testScreenshot(page, `Calendar with ${selectionMode} selectionMode.png`, { element: '#container' }); + }); + + test(`Week cell click selection (selectionMode=${selectionMode})`, async ({ page }) => { + await createWidget(page, 'dxCalendar', (mode) => ({ + value: [new Date(2023, 0, 5), new Date(2023, 0, 17), new Date(2023, 1, 2)], + selectionMode: mode, + showWeekNumbers: true, + firstDayOfWeek: 1, + disabledDates: ({ date }) => { + const day = date.getDay(); + + return day === 1 || day === 4 || day === 0; + }, + }), '#container', { arg: selectionMode }); + + const calendar = new Calendar(page, '#container'); + + await calendar.getView().getWeekNumberCellByIndex(3).click(); + + await testScreenshot(page, `Week cell click selection (selectionMode=${selectionMode}).png`, { element: '#container' }); + }); + }); + + test('Calendar with multiview rendered correct', async ({ page }) => { + await createWidget(page, 'dxCalendar', { + value: [new Date(2023, 0, 5), new Date(2023, 1, 14)], + selectionMode: 'range', + viewsCount: 2, + }); + + await testScreenshot(page, 'Calendar with multiview.png', { element: '#container' }); + }); + + ['month', 'year', 'decade', 'century'].forEach((zoomLevel) => { + test(`Calendar ${zoomLevel} view rendered correct`, async ({ page }) => { + await setStyleAttribute(page, '#container', 'width: 400px; height: 400px;'); + await appendElementTo(page, '#container', 'div', 'calendar'); + + await createWidget(page, 'dxCalendar', (level) => ({ + value: new Date(2021, 9, 17), + zoomLevel: level, + _todayDate: () => new Date(2023, 9, 17), + }), '#calendar', { arg: zoomLevel }); + + await testScreenshot(page, `Calendar ${zoomLevel} view.png`, { element: '#container' }); + }); + + test(`Calendar ${zoomLevel} view rendered correct in RTL`, async ({ page }) => { + await setStyleAttribute(page, '#container', 'width: 400px; height: 400px;'); + await appendElementTo(page, '#container', 'div', 'calendar'); + + await createWidget(page, 'dxCalendar', (level) => ({ + value: new Date(2021, 9, 17), + zoomLevel: level, + rtlEnabled: true, + _todayDate: () => new Date(2023, 9, 17), + }), '#calendar', { arg: zoomLevel }); + + await testScreenshot(page, `Calendar ${zoomLevel} view in RTL mode.png`, { element: '#container' }); + }); + + test(`Calendar ${zoomLevel} view with today button rendered correct`, async ({ page }) => { + await setStyleAttribute(page, '#container', 'width: 600px; height: 800px;'); + await appendElementTo(page, '#container', 'div', 'calendar'); + + await createWidget(page, 'dxCalendar', (level) => ({ + value: new Date(2021, 9, 17), + width: 450, + height: 450, + zoomLevel: level, + showTodayButton: true, + _todayDate: () => new Date(2023, 9, 17), + }), '#calendar', { arg: zoomLevel }); + + await testScreenshot(page, `Calendar ${zoomLevel} view with today button.png`, { element: '#container' }); + }); + }); + + test('Calendar with disabled dates rendered correct', async ({ page }) => { + await createWidget(page, 'dxCalendar', { + value: new Date(2021, 9, 17), + showTodayButton: true, + showWeekNumbers: true, + min: new Date(2021, 9, 10), + disabledDates: [new Date(2021, 9, 18)], + }); + + await testScreenshot(page, 'Calendar with disabled dates.png', { element: '#container' }); + }); + + [CALENDAR_CELL_CLASS, CALENDAR_TODAY_CLASS].forEach((cellClass) => { + const testName = `Calendar ${cellClass === CALENDAR_TODAY_CLASS ? 'today ' : ''}cell styles`; + + test(testName, async ({ page }) => { + await setStyleAttribute(page, '#container', 'width: 600px; height: 800px;'); + await appendElementTo(page, '#container', 'div', 'calendar'); + + await createWidget(page, 'dxCalendar', { + currentDate: new Date(2021, 9, 15), + }, '#calendar'); + + const calendar = new Calendar(page, '#calendar'); + + const startCellDate = new Date(2021, 9, 3); + const view = calendar.getView(); + + let cellOffset = 0; + + for (const cellTypeClass of [ + cellClass, + `${cellClass} ${CALENDAR_OTHER_VIEW_CLASS}`, + `${cellClass} ${CALENDAR_OTHER_VIEW_CLASS} ${CALENDAR_SELECTED_DATE_CLASS}`, + `${cellClass} ${CALENDAR_OTHER_VIEW_CLASS} ${CALENDAR_EMPTY_CELL_CLASS}`, + `${cellClass} ${CALENDAR_EMPTY_CELL_CLASS}`, + `${cellClass} ${CALENDAR_EMPTY_CELL_CLASS} ${CALENDAR_SELECTED_DATE_CLASS}`, + `${cellClass} ${CALENDAR_CONTOURED_DATE_CLASS}`, + `${cellClass} ${CALENDAR_CONTOURED_DATE_CLASS} ${CALENDAR_SELECTED_DATE_CLASS}`, + `${cellClass} ${CALENDAR_SELECTED_DATE_CLASS}`, + ]) { + for (const stateClass of [ + '', + STATE_HOVER_CLASS, + STATE_ACTIVE_CLASS, + ]) { + const cellClasses = `${cellTypeClass} ${stateClass}`; + + await addCellClasses(view.getCellByOffset(startCellDate, cellOffset), cellClasses); + await addCellCaption(page, startCellDate.getDate() + cellOffset, cellClasses); + + cellOffset += 1; + } + } + + await testScreenshot(page, `${testName}.png`, { element: '#container' }); + }); + }); + + ['year', 'decade', 'century'].forEach((zoomLevel) => { + const testName = `Calendar ${zoomLevel} view cell styles`; + + test(testName, async ({ page }) => { + await setStyleAttribute(page, '#container', 'width: 600px; height: 800px;'); + await appendElementTo(page, '#container', 'div', 'calendar'); + + await createWidget(page, 'dxCalendar', (level) => ({ + currentDate: new Date(2021, 9, 17), + zoomLevel: level, + _todayDate: () => new Date(2023, 9, 17), + }), '#calendar', { arg: zoomLevel }); + + const calendar = new Calendar(page, '#calendar'); + + const startCellDate = new Date(2021, 9, 3); + const view = calendar.getView(); + + let cellOffset = 0; + + for (const cellClasses of [ + STATE_HOVER_CLASS, + STATE_ACTIVE_CLASS, + CALENDAR_TODAY_CLASS, + CALENDAR_OTHER_VIEW_CLASS, + CALENDAR_EMPTY_CELL_CLASS, + CALENDAR_CONTOURED_DATE_CLASS, + CALENDAR_SELECTED_DATE_CLASS, + `${CALENDAR_CONTOURED_DATE_CLASS} ${CALENDAR_SELECTED_DATE_CLASS}`, + ]) { + await addCellClasses(view.getCellByIndex(cellOffset), cellClasses); + await addCellCaption(page, startCellDate.getDate() + cellOffset, cellClasses); + + cellOffset += 1; + } + + await testScreenshot(page, `${testName}.png`, { element: '#container' }); + }); + + test(`Calendar with range selectionMode rendered correct (maxZoomLevel=${zoomLevel})`, async ({ page }) => { + await createWidget(page, 'dxCalendar', { + value: [new Date(1023, 0, 5), new Date(1023, 0, 17), new Date(1099, 1, 2)], + selectionMode: 'range', + maxZoomLevel: zoomLevel, + }); + + await testScreenshot(page, `Calendar with range selection (maxZoomLevel=${zoomLevel}).png`, { element: '#container' }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar cell styles (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar cell styles (fluent-next.blue.light).png new file mode 100644 index 000000000000..2e4e92275cba Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar cell styles (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar cell styles (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar cell styles (fluent.blue.light).png new file mode 100644 index 000000000000..eb2f52e34890 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar cell styles (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar century view (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view (fluent-next.blue.light).png new file mode 100644 index 000000000000..fa6673b69165 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar century view (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view (fluent.blue.light).png new file mode 100644 index 000000000000..3eeec59f4ac3 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar century view cell styles (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view cell styles (fluent-next.blue.light).png new file mode 100644 index 000000000000..025074bb059a Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view cell styles (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar century view cell styles (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view cell styles (fluent.blue.light).png new file mode 100644 index 000000000000..94d57f14399d Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view cell styles (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent-next.blue.light).png new file mode 100644 index 000000000000..169f0e9e06ac Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent.blue.light).png new file mode 100644 index 000000000000..f5edc1295d20 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar century view with today button (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view with today button (fluent-next.blue.light).png new file mode 100644 index 000000000000..30f81fc00446 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view with today button (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar century view with today button (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view with today button (fluent.blue.light).png new file mode 100644 index 000000000000..c1be92468ade Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar century view with today button (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view (fluent-next.blue.light).png new file mode 100644 index 000000000000..0f307354e561 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view (fluent.blue.light).png new file mode 100644 index 000000000000..6783d67ea3d5 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent-next.blue.light).png new file mode 100644 index 000000000000..c42fab78eb69 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent.blue.light).png new file mode 100644 index 000000000000..f67b0c3c94e3 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent-next.blue.light).png new file mode 100644 index 000000000000..4ac78019be4c Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent.blue.light).png new file mode 100644 index 000000000000..b03ae36a0669 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view with today button (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view with today button (fluent-next.blue.light).png new file mode 100644 index 000000000000..75c85503c253 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view with today button (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view with today button (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view with today button (fluent.blue.light).png new file mode 100644 index 000000000000..33d2451ba1ce Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar decade view with today button (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar month view (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view (fluent-next.blue.light).png new file mode 100644 index 000000000000..2f5186e6d8d5 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar month view (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view (fluent.blue.light).png new file mode 100644 index 000000000000..d834796041cb Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent-next.blue.light).png new file mode 100644 index 000000000000..2ffc225b09e9 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent.blue.light).png new file mode 100644 index 000000000000..00881cb35a54 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar month view with today button (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view with today button (fluent-next.blue.light).png new file mode 100644 index 000000000000..c9dd867dd35b Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view with today button (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar month view with today button (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view with today button (fluent.blue.light).png new file mode 100644 index 000000000000..f448030cc85d Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar month view with today button (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar today cell styles (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar today cell styles (fluent-next.blue.light).png new file mode 100644 index 000000000000..4e7784597b5a Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar today cell styles (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar today cell styles (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar today cell styles (fluent.blue.light).png new file mode 100644 index 000000000000..d40f6778f97e Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar today cell styles (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with disabled dates (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with disabled dates (fluent-next.blue.light).png new file mode 100644 index 000000000000..1d90e34a6f08 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with disabled dates (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with disabled dates (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with disabled dates (fluent.blue.light).png new file mode 100644 index 000000000000..484edf9ea901 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with disabled dates (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with limit width (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with limit width (fluent-next.blue.light).png new file mode 100644 index 000000000000..c1480e1d18e4 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with limit width (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with limit width (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with limit width (fluent.blue.light).png new file mode 100644 index 000000000000..26e1f44e3f02 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with limit width (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent-next.blue.light).png new file mode 100644 index 000000000000..2105a80e93e5 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent.blue.light).png new file mode 100644 index 000000000000..26027f54f9d1 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiview (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiview (fluent-next.blue.light).png new file mode 100644 index 000000000000..8061c787c858 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiview (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiview (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiview (fluent.blue.light).png new file mode 100644 index 000000000000..b334efb41aa2 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with multiview (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent-next.blue.light).png new file mode 100644 index 000000000000..8092987da7ed Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent.blue.light).png new file mode 100644 index 000000000000..e67d754013be Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent-next.blue.light).png new file mode 100644 index 000000000000..47298fddd8d0 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent.blue.light).png new file mode 100644 index 000000000000..a29c8e580b82 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent-next.blue.light).png new file mode 100644 index 000000000000..1e4766b16259 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent.blue.light).png new file mode 100644 index 000000000000..e3c5e02a67b4 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent-next.blue.light).png new file mode 100644 index 000000000000..5e753518dd72 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent.blue.light).png new file mode 100644 index 000000000000..3b93c588a549 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent-next.blue.light).png new file mode 100644 index 000000000000..d222c3f363b8 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent.blue.light).png new file mode 100644 index 000000000000..4511de76e3df Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent-next.blue.light).png new file mode 100644 index 000000000000..b6798f607d82 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent.blue.light).png new file mode 100644 index 000000000000..b70bdb8f2970 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent-next.blue.light).png new file mode 100644 index 000000000000..887fa3571241 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent.blue.light).png new file mode 100644 index 000000000000..674827f68396 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent-next.blue.light).png new file mode 100644 index 000000000000..c376145f0785 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent.blue.light).png new file mode 100644 index 000000000000..b062c2fff963 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar year view (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view (fluent-next.blue.light).png new file mode 100644 index 000000000000..8a800933dbf9 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar year view (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view (fluent.blue.light).png new file mode 100644 index 000000000000..324ba98ee8e8 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar year view cell styles (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view cell styles (fluent-next.blue.light).png new file mode 100644 index 000000000000..6016e9a9095b Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view cell styles (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar year view cell styles (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view cell styles (fluent.blue.light).png new file mode 100644 index 000000000000..4af532a3ae01 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view cell styles (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent-next.blue.light).png new file mode 100644 index 000000000000..3981452667bc Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent.blue.light).png new file mode 100644 index 000000000000..9e95321a50cb Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar year view with today button (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view with today button (fluent-next.blue.light).png new file mode 100644 index 000000000000..1d6dca0dc612 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view with today button (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Calendar year view with today button (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view with today button (fluent.blue.light).png new file mode 100644 index 000000000000..9dc74e86d31d Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Calendar year view with today button (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent-next.blue.light).png new file mode 100644 index 000000000000..8d3a575478eb Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent.blue.light).png new file mode 100644 index 000000000000..2df1a5439f57 Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent-next.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent-next.blue.light).png new file mode 100644 index 000000000000..cb10ec36edea Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent.blue.light).png b/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent.blue.light).png new file mode 100644 index 000000000000..65da8639f1bd Binary files /dev/null and b/e2e/playwright/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/calendar/keyboard.spec.ts b/e2e/playwright/tests/editors/calendar/keyboard.spec.ts new file mode 100644 index 000000000000..159c71e8deb5 --- /dev/null +++ b/e2e/playwright/tests/editors/calendar/keyboard.spec.ts @@ -0,0 +1,121 @@ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import Calendar from '../../../models/calendar'; +import { expectClass } from '../../../models/internal/classMatcher'; + +const CALENDAR_SELECTED_DATE_CLASS = 'dx-calendar-selected-date'; +const CALENDAR_CONTOURED_DATE_CLASS = 'dx-calendar-contoured-date'; + +const expectFocusCounters = async ( + page: Page, + focusInCount: number, + focusOutCount: number, +): Promise => { + await expect.poll(() => page.evaluate(() => (window as any).onFocusInCounter)) + .toBe(focusInCount); + await expect.poll(() => page.evaluate(() => (window as any).onFocusOutCounter)) + .toBe(focusOutCount); +}; + +test.describe('Calendar keyboard navigation', () => { + test('Tab navigation order prevButton-caption-nextButton-viewdWrapper-todayButton', async ({ page }) => { + await createWidget(page, 'dxCalendar', { + value: new Date(2021, 9, 17), + showTodayButton: true, + }); + + const calendar = new Calendar(page, '#container'); + + await page.locator('body').click(); + await page.keyboard.press('Tab'); + + await calendar.getNavigatorPrevButton().expectFocused(); + await page.keyboard.press('Tab'); + await calendar.getNavigatorCaption().expectFocused(); + await page.keyboard.press('Tab'); + await calendar.getNavigatorNextButton().expectFocused(); + await page.keyboard.press('Tab'); + + const cell = calendar.getView().getCellByDate(new Date(2021, 9, 17)); + + await expectClass(cell, CALENDAR_CONTOURED_DATE_CLASS); + await expectClass(cell, CALENDAR_SELECTED_DATE_CLASS); + + await page.keyboard.press('Tab'); + + await calendar.getTodayButton().expectFocused(); + + await page.keyboard.press('Enter'); + + const today = new Date(); + + today.setHours(0, 0, 0, 0); + + await expect.poll(async () => { + const currentDate: Date = await calendar.option('value'); + + currentDate.setHours(0, 0, 0, 0); + + return currentDate; + }).toEqual(today); + + const todayCell = calendar.getView().getCellByDate(today); + + await expectClass(todayCell, CALENDAR_SELECTED_DATE_CLASS); + }); + + test('focusin and focusout event handlers should not be called on tab navigate inside calendar', async ({ page }) => { + await page.evaluate(() => { + (window as any).onFocusInCounter = 0; + (window as any).onFocusOutCounter = 0; + }); + + await createWidget(page, 'dxCalendar', () => ({ + value: new Date(2021, 9, 17), + showTodayButton: true, + onFocusIn() { + ((window as any).onFocusInCounter as number) += 1; + }, + onFocusOut() { + ((window as any).onFocusOutCounter as number) += 1; + }, + })); + + const calendar = new Calendar(page, '#container'); + + await page.locator('body').click(); + await page.keyboard.press('Tab'); + + await calendar.getNavigatorPrevButton().expectFocused(); + await expectFocusCounters(page, 1, 0); + + await page.keyboard.press('Tab'); + + await calendar.getNavigatorCaption().expectFocused(); + await expectFocusCounters(page, 1, 0); + + await page.keyboard.press('Tab'); + + await calendar.getNavigatorNextButton().expectFocused(); + await expectFocusCounters(page, 1, 0); + + await page.keyboard.press('Tab'); + + const cell = calendar.getView().getCellByDate(new Date(2021, 9, 17)); + + await expectClass(cell, CALENDAR_CONTOURED_DATE_CLASS); + await expectClass(cell, CALENDAR_SELECTED_DATE_CLASS); + await expectFocusCounters(page, 1, 0); + + await page.keyboard.press('Tab'); + + await calendar.getTodayButton().expectFocused(); + await expectFocusCounters(page, 1, 0); + + await page.keyboard.press('Tab'); + + await calendar.expectFocused(false); + await expectFocusCounters(page, 1, 1); + }); +}); diff --git a/e2e/playwright/tests/editors/checkBox/validationMessage.spec.ts b/e2e/playwright/tests/editors/checkBox/validationMessage.spec.ts index 1c266b59ce68..deff81824bf8 100644 --- a/e2e/playwright/tests/editors/checkBox/validationMessage.spec.ts +++ b/e2e/playwright/tests/editors/checkBox/validationMessage.spec.ts @@ -1,5 +1,6 @@ import { test } from '../../../fixtures'; import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo } from '../../../helpers/domUtils'; import { testScreenshot } from '../../../helpers/screenshots'; import CheckBox from '../../../models/checkBox'; @@ -12,22 +13,26 @@ const validatorOptions = { test.describe('CheckBox_ValidationMessage', () => { test('ValidationMessage integrated in editor should not raise any errors when it is placed inside of form and has name "style" (T941581)', async ({ page }) => { + await appendElementTo(page, '#container', 'form', 'form'); + await appendElementTo(page, '#form', 'div', 'checkBox'); await createWidget(page, 'dxCheckBox', { name: 'style', - }); - await createWidget(page, 'dxValidator', validatorOptions); + }, '#checkBox'); + await createWidget(page, 'dxValidator', validatorOptions, '#checkBox'); - const checkBox = new CheckBox(page, '#container'); + const checkBox = new CheckBox(page, '#checkBox'); await checkBox.element.click(); await checkBox.element.click(); }); test('ValidationMessage integrated in editor should not raise any errors when it is placed inside of form that has inline style with scale (T941581)', async ({ page }) => { - await createWidget(page, 'dxCheckBox', {}); - await createWidget(page, 'dxValidator', validatorOptions); + await appendElementTo(page, '#container', 'form', 'form1', { transform: 'scale(1)' }); + await appendElementTo(page, '#form1', 'div', 'checkBox1'); + await createWidget(page, 'dxCheckBox', {}, '#checkBox1'); + await createWidget(page, 'dxValidator', validatorOptions, '#checkBox1'); - const checkBox = new CheckBox(page, '#container'); + const checkBox = new CheckBox(page, '#checkBox1'); await checkBox.element.click(); await checkBox.element.click(); diff --git a/e2e/playwright/tests/editors/dateBox/common.spec.ts b/e2e/playwright/tests/editors/dateBox/common.spec.ts new file mode 100644 index 000000000000..40559fe44cee --- /dev/null +++ b/e2e/playwright/tests/editors/dateBox/common.spec.ts @@ -0,0 +1,70 @@ +import { randomUUID } from 'node:crypto'; +import type { Page } from '@playwright/test'; +import type { EditorStyle } from 'devextreme/common'; +import type { DatePickerType, DateType, Properties } from 'devextreme/ui/date_box'; +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { + appendElementTo, insertStylesheetRulesToPage, removeClassAttribute, setClassAttribute, +} from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; + +const DATEBOX_CLASS = 'dx-datebox'; +const DROP_DOWN_EDITOR_ACTIVE_CLASS = 'dx-dropdowneditor-active'; +const FOCUSED_STATE_CLASS = 'dx-state-focused'; + +const stylingModes: EditorStyle[] = ['outlined', 'underlined', 'filled']; +const pickerTypes: DatePickerType[] = ['calendar', 'list', 'native', 'rollers']; +const types: DateType[] = ['date', 'datetime', 'time']; + +const createDateBox = async (page: Page, options?: Properties): Promise => { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + await createWidget(page, 'dxDateBox', { + width: 220, + label: 'label text', + showClearButton: true, + value: new Date(2021, 9, 17, 16, 34), + ...options, + }, `#${id}`); + + return id; +}; + +test.describe('DateBox render', () => { + test('DateBox styles', async ({ page }) => { + const ids: string[] = []; + + await insertStylesheetRulesToPage(page, `.${DATEBOX_CLASS} { display: inline-block; margin: 5px; }`); + + for (const stylingMode of stylingModes) { + for (const type of types) { + const options = { + stylingMode, + type, + }; + + for (const pickerType of pickerTypes) { + ids.push(await createDateBox(page, { ...options, pickerType })); + } + + ids.push(await createDateBox(page, { ...options, rtlEnabled: true })); + } + } + + await testScreenshot(page, 'Datebox.png'); + + for (const state of [DROP_DOWN_EDITOR_ACTIVE_CLASS, FOCUSED_STATE_CLASS]) { + for (const id of ids) { + await setClassAttribute(page, `#${id}`, state); + } + + await testScreenshot(page, `Datebox ${state.replaceAll('dx-', '').replaceAll('dropdowneditor-', '').replaceAll('state-', '')}.png`); + + for (const id of ids) { + await removeClassAttribute(page, `#${id}`, state); + } + } + }); +}); diff --git a/e2e/playwright/tests/editors/dateBox/dateBox.spec.ts b/e2e/playwright/tests/editors/dateBox/dateBox.spec.ts new file mode 100644 index 000000000000..dbb0fb8d1236 --- /dev/null +++ b/e2e/playwright/tests/editors/dateBox/dateBox.spec.ts @@ -0,0 +1,94 @@ +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; +import DateBox from '../../../models/dateBox'; + +const ITEM_HEIGHT = 40; + +const TIME_VIEW_FIELD_CLASS = 'dx-timeview-field'; +const SELECT_BOX_CONTAINER_CLASS = 'dx-selectbox-container'; + +test.describe('DateBox', () => { + test.describe(() => { + test.use({ theme: 'generic.light' }); + + [[11, 12, 1925], [10, 23, 2001]].forEach(([month, day, year]) => { + test(`Rollers should be scrolled correctly when value is changed to ${day}/${month}/${year} using kbn and valueChangeEvent=keyup (T948310)`, async ({ page }) => { + await createWidget(page, 'dxDateBox', { + pickerType: 'rollers', + openOnFieldClick: false, + useMaskBehavior: true, + valueChangeEvent: 'keyup', + }); + + const dateBox = new DateBox(page, '#container'); + const { dropDownEditorButton } = dateBox; + + await dropDownEditorButton.click(); + + await dateBox.getDoneButton().click(); + + await dateBox.input.pressSequentially(`${month}${day}${year}`); + + await dropDownEditorButton.click(); + + const views = { + month: month - 1, + day: day - 1, + year: year - 1900, + }; + + for (const viewName of Object.keys(views)) { + await expect.poll( + () => dateBox.getRollerScrollTop(viewName), + `${viewName} view is scrolled correctly`, + ).toBe(views[viewName] * ITEM_HEIGHT); + } + }); + }); + }); + + test('DateBox with datetime and root element as container (T1193495)', async ({ page }) => { + await createWidget(page, 'dxDateBox', { + value: new Date(2022, 10, 23, 17, 23), + type: 'datetime', + pickerType: 'calendar', + opened: true, + width: 300, + dropDownOptions: { + container: '#container', + }, + }, '#container'); + + await testScreenshot( + page, + 'DateBox with datetime and root element as container.png', + { element: '#container', withOverflow: true }, + ); + }); + + test('DateBox with datetime and opened AM/PM select (T1312677, T1327616)', { + tag: ['@material.blue.light', '@generic.light', '@fluent.blue.light'], + }, async ({ page }) => { + await createWidget(page, 'dxDateBox', { + value: new Date(2022, 10, 23, 17, 23), + type: 'datetime', + pickerType: 'calendar', + opened: true, + applyValueMode: 'instantly', + dropDownOptions: { + container: '#container', + }, + }, '#container'); + + const timeViewSelect = page.locator(`#container .${TIME_VIEW_FIELD_CLASS} .${SELECT_BOX_CONTAINER_CLASS}`); + + await timeViewSelect.click(); + + await testScreenshot( + page, + 'DateBox with datetime and opened AMPM select.png', + { element: '#container', withOverflow: true }, + ); + }); +}); diff --git a/e2e/playwright/tests/editors/dateBox/dateBoxGeometry.spec.ts b/e2e/playwright/tests/editors/dateBox/dateBoxGeometry.spec.ts new file mode 100644 index 000000000000..f306453f7853 --- /dev/null +++ b/e2e/playwright/tests/editors/dateBox/dateBoxGeometry.spec.ts @@ -0,0 +1,44 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; +import DateBox from '../../../models/dateBox'; + +test.describe('DateBox (datetime) geometry (T896846)', () => { + test.use({ browserSize: [600, 550] }); + + test('Geometry is good', async ({ page }) => { + await page.evaluate(async () => { + await (window as any).DevExpress.ui.themes.waitWebFont('1234567890APM/:', 400); + }); + + await createWidget(page, 'dxDateBox', { + pickerType: 'calendar', + width: 200, + value: new Date(1.5e12), + }); + + const dateBox = new DateBox(page, '#container'); + + await dateBox.option('opened', true); + + await testScreenshot(page, 'Datebox with calendar.png'); + + await dateBox.option('opened', false); + await dateBox.option('type', 'datetime'); + await dateBox.option('opened', true); + + await testScreenshot(page, 'Datebox with datetime.png'); + + await dateBox.option('opened', false); + await dateBox.option({ showAnalogClock: false }); + await dateBox.option('opened', true); + + await testScreenshot(page, 'Datebox with datetime without analog clock.png'); + + await dateBox.option('opened', false); + await dateBox.option({ displayFormat: 'HH:mm', calendarOptions: { visible: false }, showAnalogClock: true }); + await dateBox.option('opened', true); + + await testScreenshot(page, 'Datebox with datetime without calendar.png'); + }); +}); diff --git a/e2e/playwright/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent-next.blue.light).png new file mode 100644 index 000000000000..badb901a3f2f Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent.blue.light).png new file mode 100644 index 000000000000..f3620721be43 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent-next.blue.light).png new file mode 100644 index 000000000000..048a86817ece Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent.blue.light).png new file mode 100644 index 000000000000..0f65d0e7c59b Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (generic.light).png b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (generic.light).png new file mode 100644 index 000000000000..426edd296bec Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (generic.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (material.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (material.blue.light).png new file mode 100644 index 000000000000..7a3bb8829322 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (material.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent-next.blue.light).png new file mode 100644 index 000000000000..956c43c00582 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent.blue.light).png new file mode 100644 index 000000000000..8179fe07286f Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox (fluent-next.blue.light).png new file mode 100644 index 000000000000..d4634e61c9c4 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox (fluent.blue.light).png new file mode 100644 index 000000000000..6c03d4de90f8 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox active (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox active (fluent-next.blue.light).png new file mode 100644 index 000000000000..0623dd59209e Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox active (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox active (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox active (fluent.blue.light).png new file mode 100644 index 000000000000..6c03d4de90f8 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox active (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox focused (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox focused (fluent-next.blue.light).png new file mode 100644 index 000000000000..3a7ea6540eb9 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox focused (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox focused (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox focused (fluent.blue.light).png new file mode 100644 index 000000000000..7aae729e98b3 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox focused (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox label symbols (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox label symbols (fluent-next.blue.light).png new file mode 100644 index 000000000000..d49b24c84e7a Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox label symbols (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox label symbols (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox label symbols (fluent.blue.light).png new file mode 100644 index 000000000000..a3dc2416c144 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox label symbols (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox validation message (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox validation message (fluent-next.blue.light).png new file mode 100644 index 000000000000..3dfe787b7248 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox validation message (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox validation message (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox validation message (fluent.blue.light).png new file mode 100644 index 000000000000..c50b94ca82cf Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox validation message (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox with calendar (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with calendar (fluent-next.blue.light).png new file mode 100644 index 000000000000..d77995f33230 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with calendar (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox with calendar (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with calendar (fluent.blue.light).png new file mode 100644 index 000000000000..adc87b5bae8f Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with calendar (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime (fluent-next.blue.light).png new file mode 100644 index 000000000000..012c134d226c Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime (fluent.blue.light).png new file mode 100644 index 000000000000..fdacb3fc3278 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent-next.blue.light).png new file mode 100644 index 000000000000..89675b8f79d6 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent.blue.light).png new file mode 100644 index 000000000000..4f4f1e6366ba Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent-next.blue.light).png new file mode 100644 index 000000000000..c0e77918f63b Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent.blue.light).png b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent.blue.light).png new file mode 100644 index 000000000000..23ff5514ba60 Binary files /dev/null and b/e2e/playwright/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateBox/keyboard.spec.ts b/e2e/playwright/tests/editors/dateBox/keyboard.spec.ts new file mode 100644 index 000000000000..0a5f5e274106 --- /dev/null +++ b/e2e/playwright/tests/editors/dateBox/keyboard.spec.ts @@ -0,0 +1,435 @@ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo } from '../../../helpers/domUtils'; +import DateBox from '../../../models/dateBox'; + +const pressKey = async (page: Page, key: string, times = 1): Promise => { + for (let index = 0; index < times; index += 1) { + await page.keyboard.press(key); + } +}; + +const expectOpened = async (dateBox: DateBox, opened = true): Promise => { + await expect.poll(() => dateBox.option('opened')).toBe(opened); +}; + +const createFocusableElements = async (page: Page, state: string): Promise => { + await appendElementTo(page, '#container', 'div', 'firstFocusableElement'); + await appendElementTo(page, '#container', 'div', 'dateBox'); + await appendElementTo(page, '#container', 'div', 'lastFocusableElement'); + + await createWidget(page, 'dxButton', { + text: `First ${state} Element`, + }, '#firstFocusableElement'); + + await createWidget(page, 'dxButton', { + text: `Last ${state} Element`, + }, '#lastFocusableElement'); +}; + +test.describe('DateBox keyboard navigation', () => { + test('DateBox should be closed by press esc key when navigator element in popup is focused, applyValueMode is useButtons', async ({ page }) => { + await createWidget(page, 'dxDateBox', { + openOnFieldClick: true, + applyValueMode: 'useButtons', + }); + + const dateBox = new DateBox(page, '#container'); + + await dateBox.input.click(); + + await expectOpened(dateBox); + + await pressKey(page, 'Tab'); + + await dateBox.getPopup().getNavigatorPrevButton().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateBox, false); + + await dateBox.input.click(); + + await expectOpened(dateBox); + + await pressKey(page, 'Tab', 2); + + await dateBox.getPopup().getNavigatorCaption().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateBox, false); + + await dateBox.input.click(); + + await expectOpened(dateBox); + + await pressKey(page, 'Tab', 3); + + await dateBox.getPopup().getNavigatorNextButton().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateBox, false); + }); + + test('DateBox should be closed by press esc key when views wrapper in popup is focused, applyValueMode is useButtons', async ({ page }) => { + await createWidget(page, 'dxDateBox', { + openOnFieldClick: true, + applyValueMode: 'useButtons', + }); + + const dateBox = new DateBox(page, '#container'); + + await dateBox.input.click(); + + await expectOpened(dateBox); + + await pressKey(page, 'Tab', 4); + + await expect(dateBox.getPopup().getViewsWrapper()).toBeFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateBox, false); + }); + + test('DateBox should be closed by press esc key when today/cancel/apply button in popup is focused, applyValueMode is useButtons', async ({ page }) => { + await createWidget(page, 'dxDateBox', { + openOnFieldClick: true, + applyValueMode: 'useButtons', + }); + + const dateBox = new DateBox(page, '#container'); + + await dateBox.input.click(); + + await expectOpened(dateBox); + + await pressKey(page, 'Tab', 5); + + await dateBox.getPopup().getTodayButton().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateBox, false); + + await dateBox.input.click(); + + await expectOpened(dateBox); + + await pressKey(page, 'Tab', 6); + + await dateBox.getPopup().getApplyButton().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateBox, false); + + await dateBox.input.click(); + + await expectOpened(dateBox); + + await pressKey(page, 'Tab', 7); + + await dateBox.getPopup().getCancelButton().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateBox, false); + }); + + test('dateBox keyboard navigation via `tab` key if applyValueMode is useButtons, input -> prev -> caption -> next -> views -> today -> apply -> cancel -> input', async ({ page }) => { + await createFocusableElements(page, 'Focusable'); + + await createWidget(page, 'dxDateBox', { + openOnFieldClick: true, + applyValueMode: 'useButtons', + opened: true, + dropDownOptions: { + hideOnOutsideClick: false, + }, + }, '#dateBox'); + + const dateBox = new DateBox(page, '#dateBox'); + + await page.locator('#firstFocusableElement').click(); + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorPrevButton().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorCaption().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorNextButton().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await expect(dateBox.getPopup().getViewsWrapper()).toBeFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getTodayButton().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getApplyButton().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getCancelButton().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await expect(dateBox.input).toBeFocused(); + }); + + test('dateBox keyboard navigation via `shift+tab` key if applyValueMode is useButtons, input -> cancel -> apply -> today -> views -> next -> caption -> prev -> input', async ({ page }) => { + await createFocusableElements(page, 'Focused'); + + await createWidget(page, 'dxDateBox', { + openOnFieldClick: true, + applyValueMode: 'useButtons', + opened: false, + }, '#dateBox'); + + const dateBox = new DateBox(page, '#dateBox'); + + await dateBox.input.click(); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getCancelButton().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getApplyButton().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getTodayButton().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await expect(dateBox.getPopup().getViewsWrapper()).toBeFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorNextButton().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorCaption().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorPrevButton().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + }); + + test('dateBox keyboard navigation via `tab` key if applyValueMode is instantly, input -> prev -> caption -> next -> views -> input', async ({ page }) => { + await createFocusableElements(page, 'Focusable'); + + await createWidget(page, 'dxDateBox', { + openOnFieldClick: true, + applyValueMode: 'instantly', + opened: true, + dropDownOptions: { + hideOnOutsideClick: false, + }, + }, '#dateBox'); + + const dateBox = new DateBox(page, '#dateBox'); + + await page.locator('#firstFocusableElement').click(); + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorPrevButton().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorCaption().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorNextButton().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await expect(dateBox.getPopup().getViewsWrapper()).toBeFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await expect(dateBox.input).toBeFocused(); + }); + + test('dateBox keyboard navigation via `shift+tab` key if applyValueMode is instantly, input -> views -> next -> caption -> prev -> input', async ({ page }) => { + await createFocusableElements(page, 'Focused'); + + await createWidget(page, 'dxDateBox', { + openOnFieldClick: true, + applyValueMode: 'instantly', + opened: false, + }, '#dateBox'); + + const dateBox = new DateBox(page, '#dateBox'); + + await dateBox.input.click(); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await expect(dateBox.getPopup().getViewsWrapper()).toBeFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorNextButton().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorCaption().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorPrevButton().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + }); + + test('dateBox keyboard navigation via `tab` and `shift+tab` when calendar is not focusable', async ({ page }) => { + await createFocusableElements(page, 'Focused'); + + await createWidget(page, 'dxDateBox', { + openOnFieldClick: true, + applyValueMode: 'useButtons', + calendarOptions: { + focusStateEnabled: false, + }, + }, '#dateBox'); + + const dateBox = new DateBox(page, '#dateBox'); + + await dateBox.input.click(); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getTodayButton().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + }); + + test('dateBox keyboard navigation via `tab` and `shift+tab` when navigator prev button is not focusable', async ({ page }) => { + await createFocusableElements(page, 'Focused'); + + await createWidget(page, 'dxDateBox', { + openOnFieldClick: true, + min: new Date(), + }, '#dateBox'); + + const dateBox = new DateBox(page, '#dateBox'); + + await dateBox.input.click(); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox); + await dateBox.getPopup().getNavigatorCaption().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + }); + + test('dateBox keyboard navigation via `tab` should close popup when there is no focusable elements', async ({ page }) => { + await createWidget(page, 'dxDateBox', { + openOnFieldClick: true, + applyValueMode: 'instantly', + calendarOptions: { + focusStateEnabled: false, + }, + }, '#container'); + + const dateBox = new DateBox(page, '#container'); + + await dateBox.input.click(); + + await expectOpened(dateBox); + await dateBox.expectFocused(); + await expect(dateBox.input).toBeFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateBox, false); + }); +}); diff --git a/e2e/playwright/tests/editors/dateBox/label.spec.ts b/e2e/playwright/tests/editors/dateBox/label.spec.ts new file mode 100644 index 000000000000..231d64f776c8 --- /dev/null +++ b/e2e/playwright/tests/editors/dateBox/label.spec.ts @@ -0,0 +1,68 @@ +import { randomUUID } from 'node:crypto'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { + appendElementTo, hasHorizontalScroll, insertStylesheetRulesToPage, setStyleAttribute, +} from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; + +const DATEBOX_CLASS = 'dx-datebox'; + +const stylingModes = ['outlined', 'underlined', 'filled']; +const visibleLabelModes = ['floating', 'static', 'outside']; + +test.describe('DateBox_Label', () => { + test('Symbol parts in label should not be cropped', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'dateBox'); + await setStyleAttribute(page, '#container', 'box-sizing: border-box; width: 300px; height: 600px; padding: 8px;'); + + for (const stylingMode of stylingModes) { + for (const labelMode of visibleLabelModes) { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + + await createWidget(page, 'dxDateBox', { + label: 'qwerty QWERTY 1234567890', + stylingMode, + labelMode, + value: new Date(1900, 0, 1), + }, `#${id}`); + } + } + + await expect.poll(() => hasHorizontalScroll(page.locator('#container'))).toBe(false); + + await testScreenshot(page, 'Datebox label symbols.png', { element: '#container' }); + }); + + test('DateBox with buttons container', async ({ page }) => { + for (const stylingMode of stylingModes) { + for (const buttons of [ + ['clear'], + ['clear', 'dropDown'], + [{ name: 'custom', location: 'after', options: { icon: 'home' } }, 'clear', 'dropDown'], + ['clear', { name: 'custom', location: 'after', options: { icon: 'home' } }, 'dropDown'], + ['clear', 'dropDown', { name: 'custom', location: 'after', options: { icon: 'home' } }], + ]) { + for (const isValid of [true, false]) { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + + await createWidget(page, 'dxDateBox', { + value: new Date(2021, 9, 17), + stylingMode, + buttons, + showClearButton: true, + isValid, + }, `#${id}`); + } + } + } + + await insertStylesheetRulesToPage(page, `#container { display: flex; flex-wrap: wrap; } .${DATEBOX_CLASS} { width: 220px; margin: 2px; }`); + + await testScreenshot(page, 'DateBox render with buttons container.png'); + }); +}); diff --git a/e2e/playwright/tests/editors/dateBox/validationMessage.spec.ts b/e2e/playwright/tests/editors/dateBox/validationMessage.spec.ts new file mode 100644 index 000000000000..06133668feb5 --- /dev/null +++ b/e2e/playwright/tests/editors/dateBox/validationMessage.spec.ts @@ -0,0 +1,47 @@ +import { randomUUID } from 'node:crypto'; +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import DateBox from '../../../models/dateBox'; + +const positions = ['top', 'right', 'bottom', 'left']; + +test.describe('DateBox ValidationMessagePosition', () => { + test.use({ browserSize: [600, 400] }); + + test('DateBox ValidationMessage position is correct', async ({ page }) => { + const ids: string[] = []; + + for (const position of positions) { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + + ids.push(id); + await createWidget(page, 'dxDateBox', { + elementAttr: { style: 'display: inline-block; margin: 50px 100px 0 0;' }, + width: 150, + height: 40, + validationMessageMode: 'always', + validationMessagePosition: position, + }, `#${id}`); + + await createWidget(page, 'dxValidator', { + validationRules: [{ + type: 'range', + max: new Date(1), + message: 'out of range', + }], + }, `#${id}`); + } + + for (const id of ids) { + const dateBox = new DateBox(page, `#${id}`); + + await dateBox.option('value', new Date(2022, 6, 14)); + } + + await testScreenshot(page, 'Datebox validation message.png'); + }); +}); diff --git a/e2e/playwright/tests/editors/dateRangeBox/behavior.spec.ts b/e2e/playwright/tests/editors/dateRangeBox/behavior.spec.ts new file mode 100644 index 000000000000..c04b13662b96 --- /dev/null +++ b/e2e/playwright/tests/editors/dateRangeBox/behavior.spec.ts @@ -0,0 +1,945 @@ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import type Calendar from '../../../models/calendar'; +import DateRangeBox from '../../../models/dateRangeBox'; + +type DateRange = (Date | null)[]; + +const createDateRangeBox = async (page: Page, options: object): Promise => { + await page.evaluate(() => { + (window as any).onValueChangedCounter = 0; + }); + + await createWidget(page, 'dxDateRangeBox', (config) => ({ + ...config, + onValueChanged() { + ((window as any).onValueChangedCounter as number) += 1; + }, + }), '#container', { arg: options }); +}; + +const expectOpened = async (dateRangeBox: DateRangeBox, opened = true): Promise => { + await expect.poll(() => dateRangeBox.option('opened')).toBe(opened); +}; + +const expectValue = async (widget: DateRangeBox | Calendar, value: DateRange): Promise => { + await expect.poll(() => widget.option('value')).toEqual(value); +}; + +const expectValueChangedCount = async (page: Page, count: number): Promise => { + await expect.poll(() => page.evaluate(() => (window as any).onValueChangedCounter)).toBe(count); +}; + +test.describe('DateRangeBox behavior (applyValueMode=\'instantly\')', () => { + test('Open by click on startDate input and select date in calendar, value: [null, null]', async ({ page }) => { + await createDateRangeBox(page, { + value: [null, null], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(10).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), null]); + await expectValueChangedCount(page, 1); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getCalendarCell(21).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), new Date(2021, 9, 17)]); + await expectValueChangedCount(page, 2); + await dateRangeBox.getEndDateBox().expectFocused(); + + await expectOpened(dateRangeBox, false); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on startDate input and reselect start date in calendar, value: ["2021/09/17", null]', async ({ page }) => { + await createDateRangeBox(page, { + value: [null, null], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(10).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), null]); + await expectValueChangedCount(page, 1); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + + await dateRangeBox.getCalendarCell(21).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), null]); + await expectValueChangedCount(page, 2); + await dateRangeBox.getEndDateBox().expectFocused(); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getCalendarCell(25).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 21)]); + await expectValueChangedCount(page, 3); + await dateRangeBox.getEndDateBox().expectFocused(); + + await expectOpened(dateRangeBox, false); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on endDate input and select date in calendar, value: [null, null]', async ({ page }) => { + await createDateRangeBox(page, { + value: [null, null], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(21).click(); + await expectValue(dateRangeBox, [null, new Date(2021, 9, 17)]); + await expectValueChangedCount(page, 1); + + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + + await dateRangeBox.getCalendarCell(10).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), new Date(2021, 9, 17)]); + await expectValueChangedCount(page, 2); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getCalendarCell(27).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), new Date(2021, 9, 23)]); + await expectValueChangedCount(page, 3); + + await expectOpened(dateRangeBox, false); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on startDate input and select date in calendar < endDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(10).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 1); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on startDate input and select date in calendar > startDate, value: ["2021/09/17", "2021/09/28"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 28)], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(25).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 21), new Date(2021, 9, 28)]); + await expectValueChangedCount(page, 1); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on startDate input and select date in calendar > endDate, value: ["2021/09/17", "2021/09/21"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 21)], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(30).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 26), null]); + await expectValueChangedCount(page, 1); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendarCell(31).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 27), null]); + await expectValueChangedCount(page, 2); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendarCell(32).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 28), null]); + await expectValueChangedCount(page, 3); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on endDate input and select date in calendar > endDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(30).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 26)]); + await expectValueChangedCount(page, 1); + + await expectOpened(dateRangeBox, false); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on endDate input and select date in calendar < endDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(25).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 21)]); + await expectValueChangedCount(page, 1); + + await expectOpened(dateRangeBox, false); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on endDate input and select date in calendar < startDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(10).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), null]); + await expectValueChangedCount(page, 1); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getCalendarCell(9).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 5), null]); + await expectValueChangedCount(page, 2); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getCalendarCell(8).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 4), null]); + await expectValueChangedCount(page, 3); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getCalendarCell(10).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 4), new Date(2021, 9, 6)]); + await expectValueChangedCount(page, 4); + + await expectOpened(dateRangeBox, false); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on endDate input and select date in calendar = endDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(28).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await expectOpened(dateRangeBox, false); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on endDate input and select date in calendar = startDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(21).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 17)]); + await expectValueChangedCount(page, 1); + + await expectOpened(dateRangeBox, false); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Open by click on startDate input and select date in calendar = startDate -> endDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(21).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getCalendarCell(28).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await expectOpened(dateRangeBox, false); + await dateRangeBox.getEndDateBox().expectFocused(); + }); + + test('Value in calendar should be updated by click on clear button if popup is open', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + opened: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + showClearButton: true, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await expectOpened(dateRangeBox); + + await expectOpened(dateRangeBox); + await dateRangeBox.clearButton.click(); + await expectValue(dateRangeBox, [null, null]); + await expectValue(dateRangeBox.getCalendar(), [null, null]); + await expectValueChangedCount(page, 1); + }); + + test('Value in calendar should be updated after change start date value by keyboard and click on endDate input if popup is open', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + opened: false, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + showClearButton: true, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await page.keyboard.press('Backspace'); + await dateRangeBox.getStartDateBox().input.pressSequentially('0'); + + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValue(dateRangeBox.getCalendar(), [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + await expectValue(dateRangeBox, [new Date(2020, 9, 17), new Date(2021, 9, 24)]); + await expectValue(dateRangeBox.getCalendar(), [new Date(2020, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 1); + }); + + test('Value in calendar should be updated after change start date value by keyboard and press `tab` if popup is open', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + opened: false, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + showClearButton: true, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await page.keyboard.press('Backspace'); + await page.keyboard.press('Backspace'); + await dateRangeBox.getStartDateBox().input.pressSequentially('19'); + + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValue(dateRangeBox.getCalendar(), [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await page.keyboard.press('Tab'); + + await expectOpened(dateRangeBox); + await expectValue(dateRangeBox, [new Date(2019, 9, 17), new Date(2021, 9, 24)]); + await expectValue(dateRangeBox.getCalendar(), [new Date(2019, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 1); + + await dateRangeBox.getEndDateBox().input.pressSequentially('10/24/2023'); + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + await expectValue(dateRangeBox, [new Date(2019, 9, 17), new Date(2023, 9, 24)]); + await expectValue(dateRangeBox.getCalendar(), [new Date(2019, 9, 17), new Date(2023, 9, 24)]); + await expectValueChangedCount(page, 2); + }); +}); + +test.describe('DateRangeBox behavior (applyValueMode=\'useButtons\')', () => { + test('Value should be saved after select range in calendar and click on apply button, value: [null, null]', async ({ page }) => { + await createDateRangeBox(page, { + value: [null, null], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(10).click(); + await expectValue(dateRangeBox, [null, null]); + await expectValueChangedCount(page, 0); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await dateRangeBox.getCalendarCell(21).click(); + await expectOpened(dateRangeBox); + await expectValue(dateRangeBox, [null, null]); + await expectValueChangedCount(page, 0); + await dateRangeBox.getStartDateBox().expectFocused(); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), new Date(2021, 9, 17)]); + await expectValueChangedCount(page, 1); + await dateRangeBox.getStartDateBox().expectFocused(); + }); + + test('Value should not be saved after select range and click on cancel button', async ({ page }) => { + await createDateRangeBox(page, { + value: [null, null], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendarCell(10).click(); + await dateRangeBox.getCalendarCell(21).click(); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getCancelButton().element.click(); + await expectOpened(dateRangeBox, false); + await expectValue(dateRangeBox, [null, null]); + await expectValueChangedCount(page, 0); + }); + + test('Open by click on startDate input and reselect start date in calendar, value: [null, null]', async ({ page }) => { + await createDateRangeBox(page, { + value: [null, null], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(10).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [null, null]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), null]); + await expectValueChangedCount(page, 1); + await dateRangeBox.getStartDateBox().expectFocused(); + + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendarCell(21).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), null]); + await expectValueChangedCount(page, 1); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), null]); + await expectValueChangedCount(page, 2); + await dateRangeBox.getStartDateBox().expectFocused(); + }); + + test('Open by click on endDate input and select date in calendar, value: [null, null]', async ({ page }) => { + await createDateRangeBox(page, { + value: [null, null], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(21).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [null, null]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getCalendarCell(10).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [null, null]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getCalendarCell(27).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [null, null]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), new Date(2021, 9, 23)]); + await expectValueChangedCount(page, 1); + }); + + test('Open by click on startDate input and select date in calendar < endDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(10).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 6), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 1); + }); + + test('Open by click on startDate input and select date in calendar > startDate, value: ["2021/09/17", "2021/09/28"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 28)], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendarCell(25).click(); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 28)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 21), new Date(2021, 9, 28)]); + await expectValueChangedCount(page, 1); + }); + + test('Open by click on startDate input and select date in calendar > endDate, value: ["2021/09/17", "2021/09/21"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 21)], + openOnFieldClick: true, + width: 500, + applyValueMode: 'useButtons', + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendarCell(30).click(); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 21)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendarCell(31).click(); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 21)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendarCell(32).click(); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 21)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 28), null]); + await expectValueChangedCount(page, 1); + }); + + test('Open by click on endDate input and select date in calendar > endDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await dateRangeBox.getCalendarCell(30).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 26)]); + await expectValueChangedCount(page, 1); + }); + + test('Open by click on endDate input and select date in calendar < endDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await dateRangeBox.getCalendarCell(25).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 21)]); + await expectValueChangedCount(page, 1); + }); + + test('Open by click on endDate input and select date in calendar < startDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await dateRangeBox.getCalendarCell(10).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getCalendarCell(9).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getCalendarCell(8).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getCalendarCell(10).click(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 4), new Date(2021, 9, 6)]); + await expectValueChangedCount(page, 1); + }); + + test('Open by click on endDate input and select date in calendar = endDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await dateRangeBox.getCalendarCell(28).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + }); + + test('Open by click on endDate input and select date in calendar = startDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(21).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 17)]); + await expectValueChangedCount(page, 1); + }); + + test('Open by click on startDate input and select date in calendar = startDate -> endDate, value: ["2021/09/17", "2021/09/24"]', async ({ page }) => { + await createDateRangeBox(page, { + value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], + openOnFieldClick: true, + applyValueMode: 'useButtons', + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendarCell(21).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getCalendarCell(28).click(); + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + + await dateRangeBox.getPopup().getApplyButton().element.click(); + await expectOpened(dateRangeBox, false); + await dateRangeBox.getStartDateBox().expectFocused(); + await expectValue(dateRangeBox, [new Date(2021, 9, 17), new Date(2021, 9, 24)]); + await expectValueChangedCount(page, 0); + }); +}); diff --git a/e2e/playwright/tests/editors/dateRangeBox/calendar.spec.ts b/e2e/playwright/tests/editors/dateRangeBox/calendar.spec.ts new file mode 100644 index 000000000000..add8ede6cd21 --- /dev/null +++ b/e2e/playwright/tests/editors/dateRangeBox/calendar.spec.ts @@ -0,0 +1,496 @@ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, setAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import type Calendar from '../../../models/calendar'; +import DateRangeBox from '../../../models/dateRangeBox'; +import { expectClass } from '../../../models/internal/classMatcher'; + +const STATE_HOVER_CLASS = 'dx-state-hover'; + +type CellCounts = [cells: number, startCells: number, endCells: number]; + +const expectRangeCells = async ( + calendar: Calendar, + [selectedCells, selectedStartCells, selectedEndCells]: CellCounts, + [hoveredCells, hoveredStartCells, hoveredEndCells]: CellCounts, +): Promise => { + await expect(calendar.getSelectedRangeCells()).toHaveCount(selectedCells); + await expect(calendar.getSelectedRangeStartCell()).toHaveCount(selectedStartCells); + await expect(calendar.getSelectedRangeEndCell()).toHaveCount(selectedEndCells); + await expect(calendar.getHoveredRangeCells()).toHaveCount(hoveredCells); + await expect(calendar.getHoveredRangeStartCell()).toHaveCount(hoveredStartCells); + await expect(calendar.getHoveredRangeEndCell()).toHaveCount(hoveredEndCells); +}; + +const createDateRangeBox = async ( + page: Page, + containerStyle: string, + options: object, +): Promise => { + await appendElementTo(page, '#container', 'div', 'dateRangeBox'); + await setAttribute(page, '#container', 'style', containerStyle); + + await createWidget(page, 'dxDateRangeBox', options, '#dateRangeBox'); +}; + +test.describe('DateRangeBox range selection', () => { + test('DateRangeBox calendar appearance after change rtl mode in runtime', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px; padding-top: 10px;', { + value: [new Date(2021, 9, 17), new Date(2021, 10, 30)], + openOnFieldClick: true, + opened: true, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.option('rtlEnabled', true); + + await testScreenshot(page, 'DRB appearance after change rtl mode in runtime.png', { element: '#container' }); + }); + + test('Cells classes after hover cells, value: [null, null]', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px;', { + value: [null, null], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getStartDateBox().input.click(); + + const calendar = dateRangeBox.getCalendar(); + + await expectRangeCells(calendar, [0, 0, 0], [0, 0, 0]); + + await calendar.getCellByDate('2021/10/12').hover(); + + await expectRangeCells(calendar, [0, 0, 0], [0, 0, 0]); + + await calendar.getCellByDate('2021/10/25').hover(); + + await expectRangeCells(calendar, [0, 0, 0], [0, 0, 0]); + }); + + test('Cells classes after hover date < startDate & date > startDate, currentSelection: startDate, value: [new Date(2021, 9, 17), null]', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px;', { + value: [new Date(2021, 9, 17), null], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getStartDateBox().input.click(); + + const calendar = dateRangeBox.getCalendar(); + + await expectRangeCells(calendar, [0, 1, 0], [0, 0, 0]); + + await calendar.getCellByDate('2021/10/12').hover(); + + await expectRangeCells(calendar, [0, 1, 0], [0, 0, 0]); + + await calendar.getCellByDate('2021/10/25').hover(); + + await expectRangeCells(calendar, [0, 1, 0], [0, 0, 0]); + }); + + test('Cells classes after hover date < startDate, currentSelection: endDate, value: [new Date(2021, 9, 17), null]', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px;', { + value: [new Date(2021, 9, 17), null], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getEndDateBox().input.click(); + + const calendar = dateRangeBox.getCalendar(); + + await expectRangeCells(calendar, [0, 1, 0], [0, 0, 0]); + + await calendar.getCellByDate('2021/10/12').hover(); + + await expectRangeCells(calendar, [0, 1, 0], [0, 0, 0]); + }); + + test('Cells classes after hover and select date > startDate, currentSelection: endDate, value: [new Date(2021, 9, 17), null]', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px; padding-top: 10px;', { + value: [new Date(2021, 9, 17), null], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getEndDateBox().input.click(); + + const calendar = dateRangeBox.getCalendar(); + + await expectRangeCells(calendar, [0, 1, 0], [0, 0, 0]); + + await calendar.getCellByDate('2021/10/24').hover(); + + await expectRangeCells(calendar, [0, 1, 0], [8, 1, 1]); + }); + + test('Selected range if endDate = startDate, currentSelection: startDate', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px; padding-top: 10px;', { + value: [new Date(2021, 9, 18), new Date(2021, 9, 18)], + openOnFieldClick: true, + width: 500, + calendarOptions: { + currentDate: new Date(2021, 9, 19), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getEndDateBox().input.click(); + + const calendar = dateRangeBox.getCalendar(); + + await expectRangeCells(calendar, [1, 1, 1], [0, 0, 0]); + + await testScreenshot(page, 'DRB range, endDate = startDate.png', { element: '#container' }); + + await calendar.getCellByDate('2021/10/18').hover(); + + await expectRangeCells(calendar, [1, 1, 1], [0, 0, 0]); + }); + + test('Start date cell in selected range', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px; padding-top: 10px;', { + value: [new Date(2021, 9, 17), new Date(2021, 10, 6)], + openOnFieldClick: true, + width: 500, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getStartDateBox().input.click(); + + const calendar = dateRangeBox.getCalendar(); + + await calendar.getCellByDate('2021/10/01').hover(); + + await testScreenshot(page, 'DRB range, startDate is start in row, hover is start in view.png', { element: '#container' }); + + await calendar.getCellByDate('2021/10/31').click(); + await dateRangeBox.getStartDateBox().input.click(); + await calendar.getCellByDate('2021/10/16').hover(); + + await testScreenshot(page, 'DRB range, startDate is end in view & start row, hover is end row.png', { element: '#container' }); + + await calendar.getCellByDate('2021/10/23').click(); + await dateRangeBox.getStartDateBox().input.click(); + await calendar.getCellByDate('2021/10/03').hover(); + + await testScreenshot(page, 'DRB range, startDate is end cell row, hover is start in row.png', { element: '#container' }); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 8, 1)); + + await calendar.getCellByDate('2021/10/01').click(); + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 8, 1)); + + await calendar.getCellByDate('2021/09/30').hover(); + + await testScreenshot(page, 'DRB range, startDate is start in view, hover is end in view.png', { element: '#container' }); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 8, 1)); + + await calendar.getCellByDate('2021/09/30').click(); + await dateRangeBox.getStartDateBox().input.click(); + await calendar.getCellByDate('2021/09/15').hover(); + + await testScreenshot(page, 'DRB range, startDate is end in view, hover inside row.png', { element: '#container' }); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 7, 1)); + + await calendar.getCellByDate('2021/09/15').click(); + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 7, 1)); + + await calendar.getCellByDate('2021/08/01').hover(); + + await testScreenshot(page, 'DRB range, startDate inside row, hover is start in view & row.png', { element: '#container' }); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 6, 1)); + + await calendar.getCellByDate('2021/08/01').click(); + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 6, 1)); + + await calendar.getCellByDate('2021/07/31').hover(); + + await testScreenshot(page, 'DRB range, startDate is start view & row, hover is end view & row.png', { element: '#container' }); + + await calendar.getCellByDate('2021/07/31').click(); + await dateRangeBox.getStartDateBox().input.click(); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 6, 1)); + + await calendar.getCellByDate('2021/07/02').hover(); + + await testScreenshot(page, 'DRB range, startDate is end in view & row, hover inside row.png', { element: '#container' }); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 4, 1)); + + await calendar.getCellByDate('2021/05/01').hover(); + + await testScreenshot(page, 'DRB range, hover is start in view & end cell row.png', { element: '#container' }); + + await calendar.getCellByDate('2021/05/01').click(); + await dateRangeBox.getStartDateBox().input.click(); + + await testScreenshot(page, 'DRB range, startDate cell is start in view & end cell row.png', { element: '#container' }); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 1, 1)); + + await calendar.getCellByDate('2021/02/28').hover(); + + await testScreenshot(page, 'DRB range, hover is end in view & start in row.png', { element: '#container' }); + }); + + test('End date cell in selected range', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px; padding-top: 10px;', { + value: [new Date(2021, 9, 17), new Date(2021, 9, 23)], + openOnFieldClick: true, + width: 500, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getEndDateBox().input.click(); + + const calendar = dateRangeBox.getCalendar(); + + await calendar.getCellByDate('2021/10/24').click(); + await dateRangeBox.getEndDateBox().input.click(); + await calendar.getCellByDate('2021/10/31').hover(); + + await testScreenshot(page, 'DRB range, endDate is start in row, hover is end view & start row.png', { element: '#container' }); + + await calendar.getCellByDate('2021/10/25').click(); + await dateRangeBox.getEndDateBox().input.click(); + await calendar.getCellByDate('2021/11/01').hover(); + + await testScreenshot(page, 'DRB range, endDate is cell inside row, hover is start in view.png', { element: '#container' }); + + await calendar.getCellByDate('2021/10/30').click(); + await dateRangeBox.getEndDateBox().input.click(); + await calendar.getCellByDate('2021/11/30').hover(); + + await testScreenshot(page, 'DRB range, endDate is end cell row, hover is end in view.png', { element: '#container' }); + + await calendar.getCellByDate('2021/10/31').click(); + await dateRangeBox.getEndDateBox().input.click(); + await calendar.getCellByDate('2021/11/21').hover(); + + await testScreenshot(page, 'DRB range, endDate is end in view & start row, hover is start row.png', { element: '#container' }); + + await calendar.getCellByDate('2021/11/01').click(); + await dateRangeBox.getEndDateBox().input.click(); + await calendar.getCellByDate('2021/11/21').hover(); + + await testScreenshot(page, 'DRB range, endDate is start in view, hover is end in row.png', { element: '#container' }); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 11, 15)); + + await calendar.getCellByDate('2021/12/31').click(); + await dateRangeBox.getEndDateBox().input.click(); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 12, 15)); + + await calendar.getCellByDate('2022/01/01').hover(); + + await testScreenshot(page, 'DRB range, endDate is end in view, hover is start view & end row.png', { element: '#container' }); + + await calendar.getCellByDate('2022/01/01').click(); + await dateRangeBox.getEndDateBox().input.click(); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 12, 15)); + + await calendar.getCellByDate('2022/01/25').hover(); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 12, 15)); + + await testScreenshot(page, 'DRB range, endDate is start view & end cell row, hover inside row.png', { element: '#container' }); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2022, 3, 15)); + + await calendar.getCellByDate('2022/04/30').hover(); + + await testScreenshot(page, 'DRB range, hover is end in view & end cell row.png', { element: '#container' }); + + await calendar.getCellByDate('2022/04/30').click(); + await dateRangeBox.getEndDateBox().input.click(); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2022, 2, 15)); + await testScreenshot(page, 'DRB range, endDate is end in view & end cell row.png', { element: '#container' }); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2022, 3, 15)); + + await calendar.getCellByDate('2022/05/01').hover(); + + await testScreenshot(page, 'DRB range, hover is start in view & start in row.png', { element: '#container' }); + + await calendar.getCellByDate('2022/05/01').click(); + await dateRangeBox.getEndDateBox().input.click(); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2022, 3, 15)); + + await testScreenshot(page, 'DRB range, endDate is start in view & start in row.png', { element: '#container' }); + }); + + test('Cell in range', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px; padding-top: 10px;', { + value: [new Date(2020, 2, 2), new Date(2024, 2, 2)], + openOnFieldClick: true, + opened: true, + width: 500, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2023, 2, 1)); + + await testScreenshot(page, 'DRB range cells, start in view and end in row & vise versa.png', { element: '#container' }); + + await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 6, 1)); + + await testScreenshot(page, 'DRB range cells, start in view and in row & end in view and in row.png', { element: '#container' }); + }); + + test('Disabled dates on start date select (disableOutOfRangeSelection: true)', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px; padding-top: 10px;', { + width: 500, + disableOutOfRangeSelection: true, + calendarOptions: { + currentDate: new Date('2020/02/20'), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getStartDateBox().input.click(); + + const calendar = dateRangeBox.getCalendar(); + + await calendar.getCellByDate('2020/02/20').click(); + + await testScreenshot(page, 'DRB disabled dates before start date select.png', { element: '#container' }); + }); + + test('Disabled dates on end date select (disableOutOfRangeSelection: true)', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px; padding-top: 10px;', { + width: 500, + disableOutOfRangeSelection: true, + calendarOptions: { + currentDate: new Date('2020/02/20'), + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getEndDateBox().input.click(); + + const calendar = dateRangeBox.getCalendar(); + + await calendar.getCellByDate('2020/02/22').click(); + + await testScreenshot(page, 'DRB disabled dates after end date select.png', { element: '#container' }); + }); + + test('Disabled dates on inputs focus (disableOutOfRangeSelection: true)', async ({ page }) => { + await createDateRangeBox(page, 'width: 800px; height: 500px; padding-top: 10px;', { + value: [new Date('2020/02/20'), new Date('2020/02/22')], + width: 500, + disableOutOfRangeSelection: true, + }); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getStartDateBox().input.click(); + await dateRangeBox.getStartDateBox().input.hover(); + + await testScreenshot(page, 'DRB disabled dates on popup opening.png', { element: '#container' }); + + await dateRangeBox.getEndDateBox().input.click(); + await dateRangeBox.getEndDateBox().input.hover(); + + await testScreenshot(page, 'DRB disabled dates on end date input focus.png', { element: '#container' }); + + await dateRangeBox.getStartDateBox().input.click(); + await dateRangeBox.getStartDateBox().input.hover(); + + await testScreenshot(page, 'DRB disabled dates on start date input focus.png', { element: '#container' }); + }); + + test(`Hovered cell should have "${STATE_HOVER_CLASS}" class after one date selected (disableOutOfRangeSelection=true)`, async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + disableOutOfRangeSelection: true, + calendarOptions: { + currentDate: new Date('2020/02/20'), + }, + }, '#container'); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + const calendar = dateRangeBox.getCalendar(); + + await calendar.getCellByDate('2020/02/20').click(); + + const targetCell = calendar.getView().getCellByDate(new Date('2020/02/22')); + + await targetCell.hover(); + await expectClass(targetCell, STATE_HOVER_CLASS); + }); + + test('Dates selection with focusStateEnabled=false', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'dateRangeBox'); + + await createWidget(page, 'dxDateRangeBox', { + value: [new Date('2020/02/20'), new Date('2020/02/22')], + width: 500, + focusStateEnabled: false, + }, '#dateRangeBox'); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + const calendar = dateRangeBox.getCalendar(); + + await dateRangeBox.getStartDateBox().input.click(); + + await calendar.getCellByDate('2020/02/10').click(); + + await calendar.getCellByDate('2020/02/25').click(); + + const expectedStartDate = new Date('2020/02/10'); + const expectedEndDate = new Date('2020/02/25'); + + await expect.poll(() => dateRangeBox.option('opened')).toBe(false); + await expect.poll(() => dateRangeBox.option('value')).toEqual([expectedStartDate, expectedEndDate]); + }); +}); diff --git a/e2e/playwright/tests/editors/dateRangeBox/common.spec.ts b/e2e/playwright/tests/editors/dateRangeBox/common.spec.ts new file mode 100644 index 000000000000..c43a8323f832 --- /dev/null +++ b/e2e/playwright/tests/editors/dateRangeBox/common.spec.ts @@ -0,0 +1,128 @@ +import { randomUUID } from 'node:crypto'; +import type { Page } from '@playwright/test'; +import type { EditorStyle, LabelMode } from 'devextreme/common'; +import type { Properties as DateRangeBoxProperties } from 'devextreme/ui/date_range_box'; +import type { Properties as DropDownEditorProperties } from 'devextreme/ui/drop_down_editor/ui.drop_down_editor'; +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { + appendElementTo, insertStylesheetRulesToPage, setAttribute, setClassAttribute, +} from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import DateRangeBox from '../../../models/dateRangeBox'; + +const DATERANGEBOX_CLASS = 'dx-daterangebox'; +const DROP_DOWN_EDITOR_ACTIVE_CLASS = 'dx-dropdowneditor-active'; +const FOCUSED_STATE_CLASS = 'dx-state-focused'; +const HOVER_STATE_CLASS = 'dx-state-hover'; +const READONLY_STATE_CLASS = 'dx-state-readonly'; +const DISABLED_STATE_CLASS = 'dx-state-disabled'; + +const stylingModes: EditorStyle[] = ['outlined', 'underlined', 'filled']; +const labelModes: LabelMode[] = ['static', 'floating', 'hidden', 'outside']; + +const TEST_VALUE = [new Date(2021, 9, 17, 16, 34), new Date(2021, 9, 18, 16, 34)]; + +const createDateRangeBox = async ( + page: Page, + options?: DateRangeBoxProperties, + state?: string, +): Promise => { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + + await createWidget(page, 'dxDateRangeBox', { + width: 500, + labelMode: 'static', + endDateLabel: 'static', + startDateLabel: 'qwertyQWERTYg', + showClearButton: true, + ...options, + }, `#${id}`); + + if (state) { + await setClassAttribute(page, `#${id}`, state); + await setClassAttribute(page, `#${id} .dx-start-datebox`, state); + } + + return id; +}; + +test.describe('DateRangeBox render', () => { + test('DateRangeBox styles', async ({ page }) => { + await insertStylesheetRulesToPage(page, `.${DATERANGEBOX_CLASS} { display: inline-flex; margin: 5px; }`); + + for (const stylingMode of stylingModes) { + for (const state of [ + DROP_DOWN_EDITOR_ACTIVE_CLASS, + FOCUSED_STATE_CLASS, + HOVER_STATE_CLASS, + READONLY_STATE_CLASS, + DISABLED_STATE_CLASS, + ]) { + await createDateRangeBox(page, { value: TEST_VALUE, stylingMode }, state); + } + } + + await createDateRangeBox(page, { value: TEST_VALUE, rtlEnabled: true }); + await createDateRangeBox(page, { value: TEST_VALUE, isValid: false }); + + await testScreenshot(page, 'DateRangeBox styles.png', { element: '#container' }); + }); + + test('DateRangeBox with buttons container', async ({ page }) => { + await insertStylesheetRulesToPage(page, '#container { display: flex; flex-wrap: wrap; gap: 4px; }'); + + const testButtons: DropDownEditorProperties['buttons'][] = [ + ['clear'], + [{ name: 'custom', location: 'after', options: { icon: 'home' } }, 'clear', 'dropDown'], + ['clear', { name: 'custom', location: 'after', options: { icon: 'home' } }, 'dropDown'], + [{ name: 'custom', location: 'before', options: { icon: 'home' } }, 'clear', 'dropDown'], + ]; + + for (const buttons of testButtons) { + await createDateRangeBox(page, { + value: TEST_VALUE, + buttons, + }); + await createDateRangeBox(page, { + value: TEST_VALUE, + buttons, + rtlEnabled: true, + }); + } + + await testScreenshot(page, 'DateRangeBox with buttons container.png', { element: '#container' }); + }); + + labelModes.forEach((labelMode) => { + test(`Custom placeholders and labels appearance, labelMode=${labelMode}`, async ({ page }) => { + await setAttribute(page, '#container', 'style', 'width: 800px; height: 300px; padding-top: 10px;'); + + const id = await createDateRangeBox(page, { + labelMode, + width: 600, + openOnFieldClick: false, + startDateLabel: 'first date', + endDateLabel: 'second date', + startDatePlaceholder: 'enter start date', + endDatePlaceholder: 'enter end date', + }); + + await appendElementTo(page, '#container', 'div', id); + + const dateRangeBox = new DateRangeBox(page, `#${id}`); + + await testScreenshot(page, `Placeholder and label by default labelMode=${labelMode}.png`, { element: '#container' }); + + await dateRangeBox.getStartDateBox().input.click(); + + await testScreenshot(page, `Placeholder and label on start date input focus labelMode=${labelMode}.png`, { element: '#container' }); + + await dateRangeBox.getEndDateBox().input.click(); + + await testScreenshot(page, `Placeholder and label on end date input labelMode=${labelMode} focus.png`, { element: '#container' }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent-next.blue.light).png new file mode 100644 index 000000000000..9575b284f31c Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent.blue.light).png new file mode 100644 index 000000000000..90b86d2096bb Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent-next.blue.light).png new file mode 100644 index 000000000000..1138d7ec9334 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent.blue.light).png new file mode 100644 index 000000000000..767f0c72aa2d Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent-next.blue.light).png new file mode 100644 index 000000000000..62b54d829de9 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent.blue.light).png new file mode 100644 index 000000000000..ae6798b8d6d1 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent-next.blue.light).png new file mode 100644 index 000000000000..71442618beba Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent.blue.light).png new file mode 100644 index 000000000000..8447ae67dbbf Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent-next.blue.light).png new file mode 100644 index 000000000000..e1167206cff2 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent.blue.light).png new file mode 100644 index 000000000000..b93fbf8c1a7e Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent-next.blue.light).png new file mode 100644 index 000000000000..c6a1e4f7151a Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent.blue.light).png new file mode 100644 index 000000000000..71ad7d0e33a9 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent-next.blue.light).png new file mode 100644 index 000000000000..19a62b771777 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent.blue.light).png new file mode 100644 index 000000000000..99857ad544bb Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent-next.blue.light).png new file mode 100644 index 000000000000..1642172a8b08 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent.blue.light).png new file mode 100644 index 000000000000..d94e7bb0a277 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent-next.blue.light).png new file mode 100644 index 000000000000..ab71c4a8f3a2 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent.blue.light).png new file mode 100644 index 000000000000..dab1caaddaba Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent-next.blue.light).png new file mode 100644 index 000000000000..4482c6beef57 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent.blue.light).png new file mode 100644 index 000000000000..71c823dde150 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent-next.blue.light).png new file mode 100644 index 000000000000..f77648766011 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent.blue.light).png new file mode 100644 index 000000000000..b90c8d3a49c8 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent-next.blue.light).png new file mode 100644 index 000000000000..2fa42a26171a Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent.blue.light).png new file mode 100644 index 000000000000..6092b46505f3 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent-next.blue.light).png new file mode 100644 index 000000000000..79af1c519462 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent.blue.light).png new file mode 100644 index 000000000000..114d45681d12 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent-next.blue.light).png new file mode 100644 index 000000000000..848aeef1bf0d Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent.blue.light).png new file mode 100644 index 000000000000..76fbd734aea0 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent-next.blue.light).png new file mode 100644 index 000000000000..dbeccd2cc7c1 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent.blue.light).png new file mode 100644 index 000000000000..cf5551a08a51 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent-next.blue.light).png new file mode 100644 index 000000000000..108c9be3c2aa Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent.blue.light).png new file mode 100644 index 000000000000..7dbdd3aa0561 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent-next.blue.light).png new file mode 100644 index 000000000000..348e2b2342a7 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent.blue.light).png new file mode 100644 index 000000000000..0b4491a67268 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent-next.blue.light).png new file mode 100644 index 000000000000..6f24eb9a3a83 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent.blue.light).png new file mode 100644 index 000000000000..dec0aa8c7625 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent-next.blue.light).png new file mode 100644 index 000000000000..b3d79af0d466 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent.blue.light).png new file mode 100644 index 000000000000..29ce26e64bc7 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent-next.blue.light).png new file mode 100644 index 000000000000..743b8ee8aa30 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent.blue.light).png new file mode 100644 index 000000000000..9dcdc24678a7 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent-next.blue.light).png new file mode 100644 index 000000000000..357dbef1ebc8 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent.blue.light).png new file mode 100644 index 000000000000..135b792efde6 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent-next.blue.light).png new file mode 100644 index 000000000000..7896b5af3eb3 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent.blue.light).png new file mode 100644 index 000000000000..700bfbb94c42 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent-next.blue.light).png new file mode 100644 index 000000000000..df8bd94a69a3 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent.blue.light).png new file mode 100644 index 000000000000..4f2ebb554e3e Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent-next.blue.light).png new file mode 100644 index 000000000000..27babc75af1b Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent.blue.light).png new file mode 100644 index 000000000000..78ab8c78adb2 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent-next.blue.light).png new file mode 100644 index 000000000000..60920bb40620 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent.blue.light).png new file mode 100644 index 000000000000..a6bca67f75fc Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent-next.blue.light).png new file mode 100644 index 000000000000..bde533675af5 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent.blue.light).png new file mode 100644 index 000000000000..d57538d855ed Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent-next.blue.light).png new file mode 100644 index 000000000000..c35168decec6 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent.blue.light).png new file mode 100644 index 000000000000..287d08cd5f83 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent-next.blue.light).png new file mode 100644 index 000000000000..c75e29d670a4 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent.blue.light).png new file mode 100644 index 000000000000..8b6b0232de16 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent-next.blue.light).png new file mode 100644 index 000000000000..d5252b3d03ba Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent.blue.light).png new file mode 100644 index 000000000000..a47c5d639ed5 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent-next.blue.light).png new file mode 100644 index 000000000000..3f47ba8fd594 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent.blue.light).png new file mode 100644 index 000000000000..c9f49bbf529d Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent-next.blue.light).png new file mode 100644 index 000000000000..645bb7fe7643 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent.blue.light).png new file mode 100644 index 000000000000..30cfe116e930 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent-next.blue.light).png new file mode 100644 index 000000000000..5e94e06a6ba9 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent.blue.light).png new file mode 100644 index 000000000000..928c18c4cd6a Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent-next.blue.light).png new file mode 100644 index 000000000000..ff722bfaa888 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent.blue.light).png new file mode 100644 index 000000000000..51875c0d395c Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent-next.blue.light).png new file mode 100644 index 000000000000..a610d5d566ab Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent.blue.light).png new file mode 100644 index 000000000000..4eb19054fa51 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent-next.blue.light).png new file mode 100644 index 000000000000..be5dbf4fe495 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent.blue.light).png new file mode 100644 index 000000000000..3e6249180fa4 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent-next.blue.light).png new file mode 100644 index 000000000000..f508c301e5e7 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent.blue.light).png new file mode 100644 index 000000000000..3c60f41dc5ae Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent-next.blue.light).png new file mode 100644 index 000000000000..812c1df4b633 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent.blue.light).png new file mode 100644 index 000000000000..30fb4e77742c Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent-next.blue.light).png new file mode 100644 index 000000000000..2fa557004139 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent.blue.light).png new file mode 100644 index 000000000000..5da555dabf97 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent-next.blue.light).png new file mode 100644 index 000000000000..39130144589d Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent.blue.light).png new file mode 100644 index 000000000000..ef40d08df590 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent-next.blue.light).png new file mode 100644 index 000000000000..b76b071d4949 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent.blue.light).png new file mode 100644 index 000000000000..32728c74df12 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent-next.blue.light).png new file mode 100644 index 000000000000..2fa557004139 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent.blue.light).png new file mode 100644 index 000000000000..5da555dabf97 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent-next.blue.light).png new file mode 100644 index 000000000000..a2ccecf143e6 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent.blue.light).png new file mode 100644 index 000000000000..e35ba8aa84bf Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent-next.blue.light).png new file mode 100644 index 000000000000..939c479a3037 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent.blue.light).png new file mode 100644 index 000000000000..1ad3dc911a69 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent-next.blue.light).png new file mode 100644 index 000000000000..911b756788d4 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent.blue.light).png new file mode 100644 index 000000000000..0cc03f3a97c2 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent-next.blue.light).png new file mode 100644 index 000000000000..a2ccecf143e6 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent.blue.light).png new file mode 100644 index 000000000000..e35ba8aa84bf Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent-next.blue.light).png new file mode 100644 index 000000000000..4e578b7dd6f6 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent.blue.light).png new file mode 100644 index 000000000000..e2783fca5892 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent-next.blue.light).png new file mode 100644 index 000000000000..4a05947615b7 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent.blue.light).png b/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent.blue.light).png new file mode 100644 index 000000000000..fc1a73e68475 Binary files /dev/null and b/e2e/playwright/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dateRangeBox/focus.spec.ts b/e2e/playwright/tests/editors/dateRangeBox/focus.spec.ts new file mode 100644 index 000000000000..1c7a7a33500d --- /dev/null +++ b/e2e/playwright/tests/editors/dateRangeBox/focus.spec.ts @@ -0,0 +1,440 @@ +import type { Locator, Page } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { addFocusableElementBefore } from '../../../helpers/domUtils'; +import DateRangeBox from '../../../models/dateRangeBox'; + +const createDateRangeBoxWithFocusCounters = async (page: Page, options: object): Promise => { + await page.evaluate(() => { + (window as any).onFocusInCounter = 0; + (window as any).onFocusOutCounter = 0; + }); + + await createWidget(page, 'dxDateRangeBox', (config) => ({ + ...config, + onFocusIn() { + ((window as any).onFocusInCounter as number) += 1; + }, + onFocusOut() { + ((window as any).onFocusOutCounter as number) += 1; + }, + }), '#container', { arg: options }); +}; + +const expectFocusCounters = async ( + page: Page, + focusInCount: number, + focusOutCount: number, +): Promise => { + await expect.poll(() => page.evaluate(() => (window as any).onFocusInCounter)) + .toBe(focusInCount); + await expect.poll(() => page.evaluate(() => (window as any).onFocusOutCounter)) + .toBe(focusOutCount); +}; + +const expectOpened = async (dateRangeBox: DateRangeBox, opened = true): Promise => { + await expect.poll(() => dateRangeBox.option('opened')).toBe(opened); +}; + +const expectFocusState = async ( + dateRangeBox: DateRangeBox, + isDateRangeBoxFocused: boolean, + isStartDateBoxFocused: boolean, + isEndDateBoxFocused: boolean, +): Promise => { + await dateRangeBox.expectFocused(isDateRangeBoxFocused); + await dateRangeBox.getStartDateBox().expectFocused(isStartDateBoxFocused); + await dateRangeBox.getEndDateBox().expectFocused(isEndDateBoxFocused); +}; + +// The TestCafe click offsets: a negative one counts from the opposite edge, a missing one is the +// middle of the element. +const clickWithOffset = async ( + target: Locator, + offsetX?: number, + offsetY?: number, +): Promise => { + const { width, height } = (await target.boundingBox())!; + const getPosition = (offset: number | undefined, size: number): number => { + if (offset === undefined) { + return Math.round(size / 2); + } + + return offset < 0 ? size + offset : offset; + }; + + await target.click({ + position: { x: getPosition(offsetX, width), y: getPosition(offsetY, height) }, + }); +}; + +test.describe('DateRangeBox focus state', () => { + test('DateRangeBox & DateBoxes should have focus class if inputs are focused by tab', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + width: 500, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + await expectFocusState(dateRangeBox, true, true, false); + + await page.keyboard.press('Tab'); + await expectFocusState(dateRangeBox, true, false, true); + + await page.keyboard.press('Tab'); + await expectFocusState(dateRangeBox, false, false, false); + }); + + test('DateRangeBox & DateBoxes should have focus class if inputs are focused by click', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + width: 500, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + await expectFocusState(dateRangeBox, true, true, false); + + await dateRangeBox.getEndDateBox().input.click(); + await expectFocusState(dateRangeBox, true, false, true); + + await clickWithOffset(page.locator('body'), -50); + await expectFocusState(dateRangeBox, false, false, false); + }); + + test('DateRangeBox & Start DateBox should have focus class after click on drop down button', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.dropDownButton.click(); + await expectFocusState(dateRangeBox, true, true, false); + }); + + test('DateRangeBox & StartDateBox should be focused if dateRangeBox open by click on drop down button and endDateBox was focused', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().element.click(); + + await expectFocusState(dateRangeBox, true, false, true); + + await dateRangeBox.dropDownButton.click(); + + await expectFocusState(dateRangeBox, true, true, false); + }); + + test('onFocusIn should be called only after first click on drop down button', async ({ page }) => { + await createDateRangeBoxWithFocusCounters(page, { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await clickWithOffset(dateRangeBox.element, -20, -20); + + await expectOpened(dateRangeBox); + + await expectFocusCounters(page, 1, 0); + + await dateRangeBox.dropDownButton.click(); + + await expectOpened(dateRangeBox, false); + await expectFocusCounters(page, 1, 0); + + await clickWithOffset(dateRangeBox.element, -20, -20); + + await expectOpened(dateRangeBox); + await expectFocusCounters(page, 1, 0); + }); + + test('onFocusIn should be called only on focus of startDate input', async ({ page }) => { + await createDateRangeBoxWithFocusCounters(page, { + value: [new Date('2021/09/17'), new Date('2021/10/24')], + openOnFieldClick: true, + width: 500, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + const focusableElementBeforeDateRangeBox = page.locator('#focusable-start'); + + await addFocusableElementBefore(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectFocusCounters(page, 1, 0); + + await page.keyboard.press('Tab'); + + await expectFocusCounters(page, 1, 0); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + await dateRangeBox.getCalendarCell(10).click(); + await expect.poll(() => dateRangeBox.option('value')) + .toEqual([new Date(2021, 8, 8), new Date(2021, 9, 24)]); + await expectFocusCounters(page, 1, 0); + + await expectOpened(dateRangeBox); + await dateRangeBox.getCalendarCell(20).click(); + await expect.poll(() => dateRangeBox.option('value')) + .toEqual([new Date(2021, 8, 8), new Date(2021, 8, 18)]); + await expectOpened(dateRangeBox, false); + await expectFocusCounters(page, 1, 0); + + await page.keyboard.press('Shift+Tab'); + await expectFocusState(dateRangeBox, true, true, false); + await expectFocusCounters(page, 1, 0); + + await page.keyboard.press('Shift+Tab'); + await expectFocusState(dateRangeBox, false, false, false); + await expect(focusableElementBeforeDateRangeBox).toBeFocused(); + await expectFocusCounters(page, 1, 1); + }); + + test('Click by separator element should focus DateRangeBox or leave active input focused without call onFocusIn event handler', async ({ page }) => { + await createDateRangeBoxWithFocusCounters(page, { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + width: 500, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.separator.click(); + + await expectOpened(dateRangeBox, false); + await expectFocusState(dateRangeBox, true, true, false); + await expectFocusCounters(page, 1, 0); + + await dateRangeBox.separator.click(); + + await expectOpened(dateRangeBox, false); + await expectFocusState(dateRangeBox, true, true, false); + await expectFocusCounters(page, 1, 0); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + await expectFocusCounters(page, 1, 0); + + await dateRangeBox.separator.click(); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + await expectFocusCounters(page, 1, 0); + + await clickWithOffset(page.locator('body'), -50); + await expectOpened(dateRangeBox, false); + await expectFocusState(dateRangeBox, false, false, false); + await expectFocusCounters(page, 1, 1); + }); + + test('EndDateBox should be stay focused after close popup by click on drop down button', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: [new Date('2021/09/17'), new Date('2021/10/24')], + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await clickWithOffset(dateRangeBox.element, -20, -20); + + await expectOpened(dateRangeBox); + + await dateRangeBox.getCalendarCell(10).click(); + await expect.poll(() => dateRangeBox.option('value')) + .toEqual([new Date(2021, 8, 8), new Date(2021, 9, 24)]); + await expectFocusState(dateRangeBox, true, false, true); + + await dateRangeBox.dropDownButton.click(); + + await expectOpened(dateRangeBox, false); + await expectFocusState(dateRangeBox, true, false, true); + }); + + test('DateRangeBox & StartDateBox should be focused after click on clear button', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + showClearButton: true, + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().element.click(); + + await expectFocusState(dateRangeBox, true, false, true); + + await dateRangeBox.clearButton.click(); + + await expectFocusState(dateRangeBox, true, true, false); + }); + + test('DateRangeBox & StartDateBox should be focused and stay opened after click on clear button when popup is opened', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + showClearButton: true, + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + }, '#container'); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().element.click(); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + + await dateRangeBox.clearButton.click(); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + }); + + test('DateRangeBox & StartDateBox should be focused after click on clear button, opened: true', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + showClearButton: true, + value: [null, '2021/10/24'], + openOnFieldClick: false, + opened: true, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + await dateRangeBox.dropDownButton.click(); + + await expectFocusState(dateRangeBox, true, false, true); + + await dateRangeBox.clearButton.click(); + + await expectFocusState(dateRangeBox, true, true, false); + }); + + test('DateRangeBox & StartDateBox should be focused if startDateBox open by keyboard, alt+down, alt+up', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox, false); + await expectFocusState(dateRangeBox, true, true, false); + + await page.keyboard.press('Alt+ArrowDown'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + + await page.keyboard.press('Alt+ArrowUp'); + + await expectOpened(dateRangeBox, false); + await expectFocusState(dateRangeBox, true, true, false); + }); + + test('DateRangeBox & StartDateBox should be focused if endDateBox open and close by keyboard, alt+down, alt+up', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox, false); + await expectFocusState(dateRangeBox, true, false, true); + + await page.keyboard.press('Alt+ArrowDown'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + + await page.keyboard.press('Alt+ArrowUp'); + + await expectOpened(dateRangeBox, false); + await expectFocusState(dateRangeBox, true, false, true); + }); + + test('Opened dateRangeBox should not be closed after click on inputs, openOnFieldClick: true', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + opened: true, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + }); + + test('Opened dateRangeBox should be closed after outside click, openOnFieldClick: true', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + width: 500, + openOnFieldClick: true, + opened: true, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await clickWithOffset(page.locator('body'), -50); + + await expectOpened(dateRangeBox, false); + await expectFocusState(dateRangeBox, false, false, false); + + await dateRangeBox.dropDownButton.click(); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + }); + + test('DateRangeBox and StartDateBox should have focus class after focus via accessKey', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + accessKey: 'x', + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + await expect(dateRangeBox.getStartDateBox().input).toHaveAttribute('accesskey', 'x'); + + await page.evaluate(() => { + (document.querySelector('[accesskey="x"]') as HTMLElement).focus(); + }); + + await expectFocusState(dateRangeBox, true, true, false); + }); +}); diff --git a/e2e/playwright/tests/editors/dateRangeBox/keyboard.spec.ts b/e2e/playwright/tests/editors/dateRangeBox/keyboard.spec.ts new file mode 100644 index 000000000000..0ddc35a7fd53 --- /dev/null +++ b/e2e/playwright/tests/editors/dateRangeBox/keyboard.spec.ts @@ -0,0 +1,799 @@ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo } from '../../../helpers/domUtils'; +import DateRangeBox from '../../../models/dateRangeBox'; +import { expectClass } from '../../../models/internal/classMatcher'; + +interface PopupFocusState { + prev?: boolean; + caption?: boolean; + next?: boolean; + views?: boolean; + apply?: boolean; + cancel?: boolean; + today?: boolean; +} + +const initialValue = [new Date('2021/10/17'), new Date('2021/11/24')]; + +const getDateByOffset = (date: Date | string, offset: number): Date => { + const resultDate = new Date(date); + + return new Date(resultDate.setDate(resultDate.getDate() + offset)); +}; + +const pressKey = async (page: Page, key: string, times = 1): Promise => { + for (let index = 0; index < times; index += 1) { + await page.keyboard.press(key); + } +}; + +const expectOpened = async (dateRangeBox: DateRangeBox, opened = true): Promise => { + await expect.poll(() => dateRangeBox.option('opened')).toBe(opened); +}; + +const expectAllOpened = async (dateRangeBox: DateRangeBox, opened: boolean): Promise => { + await expectOpened(dateRangeBox, opened); + await expect.poll(() => dateRangeBox.getStartDateBox().option('opened')).toBe(opened); + await expect.poll(() => dateRangeBox.getEndDateBox().option('opened')).toBe(opened); +}; + +const expectFocusState = async ( + dateRangeBox: DateRangeBox, + isDateRangeBoxFocused: boolean, + isStartDateBoxFocused: boolean, + isEndDateBoxFocused: boolean, +): Promise => { + await dateRangeBox.expectFocused(isDateRangeBoxFocused); + await dateRangeBox.getStartDateBox().expectFocused(isStartDateBoxFocused); + await dateRangeBox.getEndDateBox().expectFocused(isEndDateBoxFocused); +}; + +const expectPopupFocusState = async ( + dateRangeBox: DateRangeBox, + state: PopupFocusState, +): Promise => { + const popup = dateRangeBox.getPopup(); + + if (state.prev !== undefined) { + await popup.getNavigatorPrevButton().expectFocused(state.prev); + } + + if (state.caption !== undefined) { + await popup.getNavigatorCaption().expectFocused(state.caption); + } + + if (state.next !== undefined) { + await popup.getNavigatorNextButton().expectFocused(state.next); + } + + if (state.views) { + await expect(popup.getViewsWrapper()).toBeFocused(); + } + + if (state.apply !== undefined) { + await popup.getApplyButton().expectFocused(state.apply); + } + + if (state.cancel !== undefined) { + await popup.getCancelButton().expectFocused(state.cancel); + } + + if (state.today !== undefined) { + await popup.getTodayButton().expectFocused(state.today); + } +}; + +const createFocusableElements = async (page: Page, state: string): Promise => { + await appendElementTo(page, '#container', 'div', 'firstFocusableElement'); + await appendElementTo(page, '#container', 'div', 'dateRangeBox'); + await appendElementTo(page, '#container', 'div', 'lastFocusableElement'); + + await createWidget(page, 'dxButton', { + text: `First ${state} Element`, + }, '#firstFocusableElement'); + + await createWidget(page, 'dxButton', { + text: `Last ${state} Element`, + }, '#lastFocusableElement'); +}; + +test.describe('DateRangeBox keyboard navigation', () => { + test('DateRangeBox should be opened and close by press alt+down and alt+up respectively when startDateBox is focused', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectAllOpened(dateRangeBox, false); + + await pressKey(page, 'Alt+ArrowDown'); + + await expectAllOpened(dateRangeBox, true); + + await pressKey(page, 'Alt+ArrowUp'); + + await expectAllOpened(dateRangeBox, false); + + await pressKey(page, 'Alt+ArrowDown'); + + await expectAllOpened(dateRangeBox, true); + + await pressKey(page, 'Alt+ArrowUp'); + + await expectAllOpened(dateRangeBox, false); + }); + + test('DateRangeBox should be opened and close by press alt+down and alt+up respectively when endDateBox is focused', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectAllOpened(dateRangeBox, false); + + await pressKey(page, 'Alt+ArrowDown'); + + await expectAllOpened(dateRangeBox, true); + + await pressKey(page, 'Alt+ArrowUp'); + + await expectAllOpened(dateRangeBox, false); + + await pressKey(page, 'Alt+ArrowDown'); + + await expectAllOpened(dateRangeBox, true); + + await pressKey(page, 'Alt+ArrowUp'); + + await expectAllOpened(dateRangeBox, false); + }); + + test('DateRangeBox should be opened by press alt+down if startDate input is focused and close by press alt+up if endDateBox is focused', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectAllOpened(dateRangeBox, false); + + await pressKey(page, 'Alt+ArrowDown'); + + await expectAllOpened(dateRangeBox, true); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectAllOpened(dateRangeBox, true); + + await pressKey(page, 'Alt+ArrowUp'); + + await expectAllOpened(dateRangeBox, false); + }); + + test('DateRangeBox should be closed by press esc key when startDateBox is focused', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await pressKey(page, 'Escape'); + + await expectOpened(dateRangeBox, false); + }); + + test('DateRangeBox should be closed by press esc key when endDateBox is focused', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await pressKey(page, 'Escape'); + + await expectOpened(dateRangeBox, false); + }); + + test('DateRangeBox should be closed by press esc key when today/cancel/apply button in popup is focused, applyValueMode is useButtons', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + applyValueMode: 'useButtons', + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await pressKey(page, 'Tab', 5); + + await dateRangeBox.getPopup().getTodayButton().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateRangeBox, false); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await pressKey(page, 'Tab', 6); + + await dateRangeBox.getPopup().getApplyButton().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateRangeBox, false); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await pressKey(page, 'Tab', 7); + + await dateRangeBox.getPopup().getCancelButton().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateRangeBox, false); + }); + + test('DateRangeBox should be closed by press esc key when navigator element in popup is focused, applyValueMode is useButtons', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + applyValueMode: 'useButtons', + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await pressKey(page, 'Tab'); + + await dateRangeBox.getPopup().getNavigatorPrevButton().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateRangeBox, false); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await pressKey(page, 'Tab', 2); + + await dateRangeBox.getPopup().getNavigatorCaption().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateRangeBox, false); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await pressKey(page, 'Tab', 3); + + await dateRangeBox.getPopup().getNavigatorNextButton().expectFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateRangeBox, false); + }); + + test('DateRangeBox should be closed by press esc key when views wrapper in popup is focused, applyValueMode is useButtons', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + applyValueMode: 'useButtons', + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + + await pressKey(page, 'Tab', 4); + + await expect(dateRangeBox.getPopup().getViewsWrapper()).toBeFocused(); + + await pressKey(page, 'Escape'); + + await expectOpened(dateRangeBox, false); + }); + + test('DateRangeBox should not be closed by press tab key on startDate input', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'dateRangeBox'); + await appendElementTo(page, '#container', 'div', 'lastFocusableElement'); + + await createWidget(page, 'dxButton', { + text: 'Last Focusable Element', + }, '#lastFocusableElement'); + + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + opened: true, + width: 500, + dropDownOptions: { + hideOnOutsideClick: false, + }, + calendarOptions: { + focusStateEnabled: false, + }, + }, '#dateRangeBox'); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getStartDateBox().input.click(); + + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox, false); + await expectClass(page.locator('#lastFocusableElement'), 'dx-state-focused'); + await dateRangeBox.expectFocused(false); + }); + + test('DateRangeBox keyboard navigation via `tab` key if applyValueMode is useButtons, start -> end -> prev -> caption -> next -> views -> today -> apply -> cancel -> start -> end', async ({ page }) => { + await createFocusableElements(page, 'Focusable'); + + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + applyValueMode: 'useButtons', + opened: true, + width: 500, + dropDownOptions: { + hideOnOutsideClick: false, + }, + }, '#dateRangeBox'); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await page.locator('#firstFocusableElement').click(); + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: false, next: false, apply: false, cancel: false, today: false, + }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: true, caption: false, next: false, apply: false, cancel: false, today: false, + }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: true, next: false, apply: false, cancel: false, today: false, + }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: false, next: true, apply: false, cancel: false, today: false, + }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, + caption: false, + next: false, + views: true, + apply: false, + cancel: false, + today: false, + }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: false, next: false, apply: false, cancel: false, today: true, + }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { apply: true, cancel: false, today: false }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { apply: false, cancel: true, today: false }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + await expectPopupFocusState(dateRangeBox, { apply: false, cancel: false, today: false }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + await expectPopupFocusState(dateRangeBox, { apply: false, cancel: false, today: false }); + }); + + test('DateRangeBox keyboard navigation via `shift+tab` key if applyValueMode is useButtons, end -> start -> cancel -> apply -> today -> views -> next -> caption -> prev -> end -> start', async ({ page }) => { + await createFocusableElements(page, 'Focused'); + + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + applyValueMode: 'useButtons', + opened: false, + width: 500, + }, '#dateRangeBox'); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: false, next: false, apply: false, cancel: false, today: false, + }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: false, next: false, apply: false, cancel: true, today: false, + }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: false, next: false, apply: true, cancel: false, today: false, + }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: false, next: false, apply: false, cancel: false, today: true, + }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, + caption: false, + next: false, + views: true, + apply: false, + cancel: false, + today: false, + }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: false, next: true, apply: false, cancel: false, today: false, + }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: true, next: false, apply: false, cancel: false, today: false, + }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, false, false, false); + await expectPopupFocusState(dateRangeBox, { + prev: true, caption: false, next: false, apply: false, cancel: false, today: false, + }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: false, next: false, apply: false, cancel: false, today: false, + }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + await expectPopupFocusState(dateRangeBox, { + prev: false, caption: false, next: false, apply: false, cancel: false, today: false, + }); + }); + + test('DateRangeBox keyboard navigation via `tab` key if applyValueMode is instantly, start -> end -> prev -> caption -> next -> views -> start -> end', async ({ page }) => { + await createFocusableElements(page, 'Focusable'); + + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + applyValueMode: 'instantly', + opened: true, + width: 500, + dropDownOptions: { + hideOnOutsideClick: false, + }, + }, '#dateRangeBox'); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await page.locator('#firstFocusableElement').click(); + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectPopupFocusState(dateRangeBox, { prev: true }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectPopupFocusState(dateRangeBox, { caption: true }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectPopupFocusState(dateRangeBox, { next: true }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectPopupFocusState(dateRangeBox, { views: true }); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + + await pressKey(page, 'Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + }); + + test('DateRangeBox keyboard navigation via `shift+tab` key if applyValueMode is instantly, end -> start -> views -> next -> caption -> prev -> end -> start', async ({ page }) => { + await createFocusableElements(page, 'Focused'); + + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + applyValueMode: 'instantly', + opened: false, + width: 500, + }, '#dateRangeBox'); + + const dateRangeBox = new DateRangeBox(page, '#dateRangeBox'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, false, true); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectPopupFocusState(dateRangeBox, { views: true }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectPopupFocusState(dateRangeBox, { next: true }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectPopupFocusState(dateRangeBox, { caption: true }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectPopupFocusState(dateRangeBox, { prev: true }); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await expectFocusState(dateRangeBox, true, true, false); + }); + + test('DateRangeBox should not be closed by press shift+tab key on endDate input', async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: ['2021/09/17', '2021/10/24'], + openOnFieldClick: true, + opened: true, + width: 500, + dropDownOptions: { + hideOnOutsideClick: false, + }, + calendarOptions: { + focusStateEnabled: false, + }, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.getEndDateBox().input.click(); + + await expectOpened(dateRangeBox); + await dateRangeBox.getEndDateBox().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox); + await dateRangeBox.getStartDateBox().expectFocused(); + + await pressKey(page, 'Shift+Tab'); + + await expectOpened(dateRangeBox, false); + }); + + [ + { key: 'left', code: 'ArrowLeft', offsetInDays: -1 }, + { key: 'right', code: 'ArrowRight', offsetInDays: 1 }, + { key: 'up', code: 'ArrowUp', offsetInDays: -7 }, + { key: 'down', code: 'ArrowDown', offsetInDays: 7 }, + ].forEach(({ key, code, offsetInDays }) => { + test(`DateRangeBox start value should be changed after after opening and navigation by '${key}' key and click on 'enter' key`, async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: initialValue, + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.dropDownButton.click(); + + await expectOpened(dateRangeBox); + await expect.poll(() => dateRangeBox.option('value')).toEqual(initialValue); + + await pressKey(page, code); + await pressKey(page, 'Enter'); + + const expectedStartDate = getDateByOffset(initialValue[0], offsetInDays); + + await expectOpened(dateRangeBox); + await expect.poll(() => dateRangeBox.option('value')) + .toEqual([expectedStartDate, new Date(initialValue[1])]); + }); + + test(`Selection in calendar should be started with current startDate value after select startDate if endDate is not specified, '${key}' key`, async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: [initialValue[0], null], + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.dropDownButton.click(); + + await pressKey(page, code); + await pressKey(page, 'Enter'); + + await pressKey(page, 'ArrowRight', 5); + await pressKey(page, 'Enter'); + + const expectedStartDate = getDateByOffset(initialValue[0], offsetInDays); + const expectedEndDate = getDateByOffset(expectedStartDate, 5); + + await expectOpened(dateRangeBox, false); + await expect.poll(() => dateRangeBox.option('value')) + .toEqual([expectedStartDate, expectedEndDate]); + }); + + test(`Selection in calendar should be started with endDate value after select startDate if endDate is specified, '${key}' key`, async ({ page }) => { + await createWidget(page, 'dxDateRangeBox', { + value: initialValue, + openOnFieldClick: false, + }); + + const dateRangeBox = new DateRangeBox(page, '#container'); + + await dateRangeBox.dropDownButton.click(); + + await pressKey(page, 'ArrowLeft'); + await pressKey(page, 'Enter'); + + await pressKey(page, code); + await pressKey(page, 'Enter'); + + const expectedStartDate = getDateByOffset(initialValue[0], -1); + const expectedEndDate = getDateByOffset(initialValue[1], offsetInDays); + + await expectOpened(dateRangeBox, false); + await expect.poll(() => dateRangeBox.option('value')) + .toEqual([expectedStartDate, expectedEndDate]); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/dateRangeBox/validationMessage.spec.ts b/e2e/playwright/tests/editors/dateRangeBox/validationMessage.spec.ts new file mode 100644 index 000000000000..4cf7bbb01fcb --- /dev/null +++ b/e2e/playwright/tests/editors/dateRangeBox/validationMessage.spec.ts @@ -0,0 +1,90 @@ +import { randomUUID } from 'node:crypto'; +import type { Page } from '@playwright/test'; +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, insertStylesheetRulesToPage } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import DateRangeBox from '../../../models/dateRangeBox'; +import Form from '../../../models/form'; + +const DATERANGEBOX_CLASS = 'dx-daterangebox'; + +const validationMessagePositions = ['auto', 'bottom', 'left', 'right', 'top']; + +const createFormWithDateRangeBox = async ( + page: Page, + validationMessagePosition: string, +): Promise => { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + + await createWidget(page, 'dxForm', { + width: '100%', + labelLocation: 'top', + formData: { + DateRange: ['2021/09/17', null], + }, + colCount: 1, + items: [{ + dataField: 'DateRange', + editorType: 'dxDateRangeBox', + label: { + text: 'Date Range', + }, + validationRules: [{ + type: 'required', + message: 'Some message', + }], + editorOptions: { + startDatePlaceholder: 'Start Date', + endDatePlaceholder: 'End Date', + validationMessageMode: 'always', + validationMessagePosition, + }, + }], + }, `#${id}`); + + return id; +}; + +test.describe('DateRangeBox validation message position', () => { + test('The validation message overlay for DateRangeBox should be correctly positioned before and after opening', async ({ page }) => { + const ids: string[] = []; + + await insertStylesheetRulesToPage(page, ` + #container { width: 900px; height: 800px; display: flex; flex-direction: column; padding: 50px; } + .dx-form { margin: 25px 50px; } + `); + + for (const validationMessagePosition of validationMessagePositions) { + ids.push(await createFormWithDateRangeBox(page, validationMessagePosition)); + } + + for (const id of ids) { + await new Form(page, `#${id}`).validate(); + } + + await testScreenshot( + page, + 'The validation message overlay position for DateRangeBox before opening.png', + { element: '#container', withOverflow: true }, + ); + + for (const id of ids) { + const form = new Form(page, `#${id}`); + const dateRangeBox = new DateRangeBox(page, `#${id} .${DATERANGEBOX_CLASS}`); + + await form.validate(); + + await dateRangeBox.dropDownButton.click(); + await dateRangeBox.dropDownButton.click(); + } + + await testScreenshot( + page, + 'The validation message overlay position for DateRangeBox after opening.png', + { element: '#container', withOverflow: true }, + ); + }); +}); diff --git a/e2e/playwright/tests/editors/dropDownBox/T1245111_dropDownBox_height.spec.ts b/e2e/playwright/tests/editors/dropDownBox/T1245111_dropDownBox_height.spec.ts new file mode 100644 index 000000000000..894247730908 --- /dev/null +++ b/e2e/playwright/tests/editors/dropDownBox/T1245111_dropDownBox_height.spec.ts @@ -0,0 +1,29 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; + +test.describe('Grid on Drop Down Box', () => { + // T1245111 + test('DataGrid on dropDownBox should appear correctly on window resize', async ({ page }) => { + await createWidget(page, 'dxDropDownBox', () => ({ + dataSource: Array.from({ length: 100 }, (_, index) => ({ + Value: index + 1, + Text: `item ${index + 1}`, + })), + dropDownOptions: { + width: 'auto', + }, + contentTemplate: (e) => ($('
') as any).dxDataGrid({ + dataSource: e.component.getDataSource(), + }), + })); + + const dropDownBox = page.locator('#container'); + const overlay = page.locator('.dx-overlay-content').first(); + + await dropDownBox.click(); + await overlay.hover(); + await page.setViewportSize({ width: 800, height: 800 }); + await testScreenshot(page, 'T1245111-dropDownBox-resize.png'); + }); +}); diff --git a/e2e/playwright/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent-next.blue.light).png new file mode 100644 index 000000000000..4e1290cf0c69 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent.blue.light).png b/e2e/playwright/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent.blue.light).png new file mode 100644 index 000000000000..5ef7790537ef Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent-next.blue.light).png new file mode 100644 index 000000000000..437c53ac7fcf Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent.blue.light).png b/e2e/playwright/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent.blue.light).png new file mode 100644 index 000000000000..a017ddb41d23 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownBox/popup.spec.ts b/e2e/playwright/tests/editors/dropDownBox/popup.spec.ts new file mode 100644 index 000000000000..c68cbacbdd7b --- /dev/null +++ b/e2e/playwright/tests/editors/dropDownBox/popup.spec.ts @@ -0,0 +1,22 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; + +const BUTTON_CLASS = 'dx-dropdowneditor-button'; + +test.describe('Drop Down Box\'s Popup', () => { + test.use({ browserSize: [900, 600] }); + + test('Popup should have correct height when DropDownBox is opened first time (T1130045)', async ({ page }) => { + await createWidget(page, 'dxDropDownBox', { + dropDownOptions: { + templatesRenderAsynchronously: true, + }, + contentTemplate: '
', + }); + + await page.locator(`.${BUTTON_CLASS}`).click(); + + await testScreenshot(page, 'Popup has correct height on the first opening.png'); + }); +}); diff --git a/e2e/playwright/tests/editors/dropDownButton/common.spec.ts b/e2e/playwright/tests/editors/dropDownButton/common.spec.ts new file mode 100644 index 000000000000..4456a6391159 --- /dev/null +++ b/e2e/playwright/tests/editors/dropDownButton/common.spec.ts @@ -0,0 +1,109 @@ +import { randomUUID } from 'node:crypto'; +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, insertStylesheetRulesToPage } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import DropDownButton from '../../../models/dropDownButton'; + +const DROP_DOWN_BUTTON_CLASS = 'dx-dropdownbutton'; +const BUTTON_GROUP_CLASS = 'dx-buttongroup'; + +const stylingModes = ['text', 'outlined', 'contained']; +const types = ['normal', 'default', 'danger', 'success']; + +test.describe('Drop Down Button', () => { + test('Item collection should be updated after direct option changing (T817436)', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'dropDownButton1'); + await appendElementTo(page, '#container', 'div', 'dropDownButton2'); + + await createWidget(page, 'dxDropDownButton', { + items: [{ text: 'text1' }, { text: 'text2' }], + displayExpr: 'text', + }, '#dropDownButton1'); + + await createWidget(page, 'dxDropDownButton', { + dataSource: [{ text: 'text1' }, { text: 'text2' }], + displayExpr: 'text', + }, '#dropDownButton2'); + + const dropDownButton1 = new DropDownButton(page, '#dropDownButton1'); + const dropDownButton2 = new DropDownButton(page, '#dropDownButton2'); + + await dropDownButton1.element.click(); + const list1 = await dropDownButton1.getList(); + await dropDownButton2.element.click(); + const list2 = await dropDownButton2.getList(); + + await list1.getItem().expectDisabled(false); + await list2.getItem().expectDisabled(false); + + await dropDownButton1.option('items[0].disabled', true); + await dropDownButton2.option('dataSource[0].disabled', true); + + await dropDownButton1.element.click(); + await list1.getItem().expectDisabled(); + await dropDownButton2.element.click(); + await list2.getItem().expectDisabled(); + }); + + [undefined, 120].forEach((width) => { + types.forEach((type) => { + if (width && type !== 'normal') { + return; + } + + test(`DropDownButton renders correctly, width=${width}, type=${type}`, async ({ page }) => { + for (const rtlEnabled of [false, true]) { + for (const stylingMode of stylingModes) { + const captionId = `${stylingMode}-${rtlEnabled}`; + + await appendElementTo(page, '#container', 'div', captionId, { fontSize: '10px' }); + await page.evaluate(({ id, text }) => { + $(`#${id}`).text(text); + }, { id: captionId, text: `StylingMode: ${stylingMode}, rtlEnabled: ${rtlEnabled}` }); + + for (const splitButton of [true, false]) { + for (const showArrowIcon of [true, false]) { + for (const icon of ['image', '']) { + for (const text of ['', 'Text']) { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + await createWidget(page, 'dxDropDownButton', { + width, + rtlEnabled, + items: [{ text: 'text1' }, { text: 'text2' }], + displayExpr: 'text', + type, + text, + icon, + stylingMode, + showArrowIcon, + splitButton, + }, `#${id}`); + } + } + } + } + } + } + + await insertStylesheetRulesToPage(page, `.${DROP_DOWN_BUTTON_CLASS}.dx-widget { display: inline-flex; vertical-align: middle; margin: 2px; } .${BUTTON_GROUP_CLASS} { vertical-align: middle; }`); + + await testScreenshot(page, `DropDownButton render${width ? ' with fixed width' : ''}${type !== 'normal' ? `, type=${type}` : ''}.png`); + }); + }); + }); + + [false, true].forEach((splitButton) => { + test(`Button template, splitButton=${splitButton}`, async ({ page }) => { + await createWidget(page, 'dxDropDownButton', (split) => ({ + splitButton: split, + width: 200, + template: () => $('
Custom text
'), + }), '#container', { arg: splitButton }); + + await testScreenshot(page, `Button template, splitButton=${splitButton}.png`, { element: '#container' }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent-next.blue.light).png new file mode 100644 index 000000000000..6e1b192f4dd8 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent.blue.light).png new file mode 100644 index 000000000000..e7822f4ea84e Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent-next.blue.light).png new file mode 100644 index 000000000000..6107973b1d3c Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent.blue.light).png new file mode 100644 index 000000000000..0906a105fcb1 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render (fluent-next.blue.light).png new file mode 100644 index 000000000000..11c6cf561709 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render (fluent.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render (fluent.blue.light).png new file mode 100644 index 000000000000..3c020e2ac3c0 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent-next.blue.light).png new file mode 100644 index 000000000000..1155cb4e1a75 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent.blue.light).png new file mode 100644 index 000000000000..fa2036a60387 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent-next.blue.light).png new file mode 100644 index 000000000000..48218fcafe81 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent.blue.light).png new file mode 100644 index 000000000000..b96c00523ee8 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent-next.blue.light).png new file mode 100644 index 000000000000..1e2bbce95283 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent.blue.light).png new file mode 100644 index 000000000000..d747675c476a Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent-next.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent-next.blue.light).png new file mode 100644 index 000000000000..8fe939e02a97 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent.blue.light).png b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent.blue.light).png new file mode 100644 index 000000000000..e770aa3826f1 Binary files /dev/null and b/e2e/playwright/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/dropDownButton/popup.spec.ts b/e2e/playwright/tests/editors/dropDownButton/popup.spec.ts new file mode 100644 index 000000000000..6640f99e1e30 --- /dev/null +++ b/e2e/playwright/tests/editors/dropDownButton/popup.spec.ts @@ -0,0 +1,47 @@ +import type { Locator, Page } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import DropDownButton from '../../../models/dropDownButton'; + +const getRect = ( + locator: Locator, +): Promise<{ left: number; top: number; bottom: number }> => locator.evaluate((element) => { + const { left, top, bottom } = element.getBoundingClientRect(); + + return { left, top, bottom }; +}); + +const hasPageScroll = (page: Page): Promise => page.evaluate(() => { + const { + scrollWidth, clientWidth, scrollHeight, clientHeight, + } = document.documentElement; + + return scrollWidth > clientWidth || scrollHeight > clientHeight; +}); + +test.describe('Drop Down Button\'s Popup', () => { + test('Popup should have correct position when DropDownButton is placed in the right bottom(T1034931)', async ({ page }) => { + await createWidget(page, 'dxDropDownButton', { + items: [1, 2, 3, 4, 5, 6, 7], + elementAttr: { style: 'position: absolute; right: 10px; bottom: 10px;' }, + opened: true, + }); + + const dropDownButton = new DropDownButton(page, '#container'); + const popupContent = page.locator('.dx-overlay-content').first(); + + await expect.poll(async () => { + const buttonRect = await getRect(dropDownButton.element); + const popupRect = await getRect(popupContent); + + return Math.abs(buttonRect.left - popupRect.left); + }).toBeLessThan(1); + await expect.poll(async () => { + const buttonRect = await getRect(dropDownButton.element); + const popupRect = await getRect(popupContent); + + return Math.abs(buttonRect.top - popupRect.bottom); + }).toBeLessThan(1); + await expect.poll(() => hasPageScroll(page)).toBe(false); + }); +}); diff --git a/e2e/playwright/tests/editors/lookup/common.spec.ts b/e2e/playwright/tests/editors/lookup/common.spec.ts new file mode 100644 index 000000000000..fb9b7fecf36f --- /dev/null +++ b/e2e/playwright/tests/editors/lookup/common.spec.ts @@ -0,0 +1,180 @@ +import { randomUUID } from 'node:crypto'; +import type { Locator } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, insertStylesheetRulesToPage, setStyleAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import Lookup from '../../../models/lookup'; + +const LOOKUP_FIELD_CLASS = 'dx-lookup-field'; +const OVERLAY_CLASS = 'dx-overlay-content'; + +const LOADINDICATOR_SEGMENT_CLASS = 'dx-loadindicator-segment'; +const LOADINDICATOR_CONTENT_CLASS = 'dx-loadindicator-content'; +const LOADINDICATOR_ICON_CLASS = 'dx-loadindicator-icon'; +const LOADINDICATOR_SEGMENT_INNER_CLASS = 'dx-loadindicator-segment-inner'; + +const stylingModes = ['outlined', 'underlined', 'filled']; +const labelModes = ['static', 'floating', 'hidden', 'outside']; + +const getRect = (locator: Locator): Promise<{ top: number; bottom: number }> => locator.evaluate( + (element) => { + const { top, bottom } = element.getBoundingClientRect(); + + return { top, bottom }; + }, +); + +test.describe('Lookup', () => { + test.describe(() => { + test.use({ theme: 'material.blue.light' }); + + test('Popup should not be closed if lookup is placed at the page bottom (T1018037)', async ({ page }) => { + await createWidget(page, 'dxLookup', { + items: [1, 2, 3], + usePopover: false, + }); + + const lookup = new Lookup(page, '#container'); + + await lookup.element.evaluate((element) => { + const $element = $(element); + + $element.css({ top: window.innerHeight - ($element.height() ?? 0) }); + }); + + await lookup.open(); + + await expect.poll(() => lookup.isOpened()).toBe(true); + }); + + test('Popup should be flipped if lookup is placed at the page bottom', async ({ page }) => { + await page.evaluate(() => { + const $element = $('#container'); + + $element.css({ top: ($(window).height() ?? 0) - ($element.height() ?? 0) }); + }); + + await createWidget(page, 'dxLookup', { + items: [1, 2, 3], + usePopover: false, + opened: true, + dropDownOptions: { + hideOnParentScroll: false, + }, + }); + + const popupWrapper = page.locator('.dx-overlay-wrapper').first(); + const popupContent = page.locator('.dx-overlay-content').first(); + + await expect.poll(async () => { + const wrapperTop = (await getRect(popupWrapper)).top; + const contentTop = (await getRect(popupContent)).top; + + return contentTop < wrapperTop; + }).toBe(true); + }); + }); + + test.describe(() => { + test.use({ theme: 'generic.light' }); + + test('Popover should have correct vertical position (T1048128)', async ({ page }) => { + await createWidget(page, 'dxLookup', { + items: Array.from(Array(100).keys()), + }); + + const lookup = new Lookup(page, '#container'); + + await lookup.open(); + + const popoverArrow = page.locator('.dx-popover-arrow'); + + await expect.poll(async () => { + const lookupElementBottom = (await getRect(lookup.element)).bottom; + const popoverArrowTop = (await getRect(popoverArrow)).top; + + return popoverArrowTop - lookupElementBottom; + }).toBe(0); + }); + }); + + test.describe(() => { + test.use({ browserSize: [300, 400] }); + + test('Check popup height with no found data option', async ({ page }) => { + await createWidget(page, 'dxLookup', { dataSource: [], searchEnabled: true }); + + await page.locator(`.${LOOKUP_FIELD_CLASS}`).click(); + await page.locator(`.${OVERLAY_CLASS}`).first().hover(); + + await testScreenshot(page, 'Lookup with no found data.png'); + }); + + test('Check popup height in loading state', async ({ page }) => { + await insertStylesheetRulesToPage(page, ` + .${LOADINDICATOR_SEGMENT_CLASS}, + .${LOADINDICATOR_CONTENT_CLASS}, + .${LOADINDICATOR_ICON_CLASS}, + .${LOADINDICATOR_SEGMENT_INNER_CLASS} { + animation: none !important; + } + `); + + await createWidget(page, 'dxLookup', () => ({ + dataSource: { + load: () => new Promise(() => {}), + }, + valueExpr: 'id', + displayExpr: 'text', + })); + + await page.locator(`.${LOOKUP_FIELD_CLASS}`).click(); + await page.locator(`.${OVERLAY_CLASS}`).first().hover(); + + await testScreenshot(page, 'Lookup in loading.png'); + }); + }); + + test('Lookup appearance', async ({ page }) => { + const ids: string[] = []; + + await insertStylesheetRulesToPage(page, '#container { display: grid; align-items: end; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 5px; }'); + + for (const stylingMode of stylingModes) { + for (const labelMode of labelModes) { + for (const rtlEnabled of [true, false]) { + for (const value of [null, 'Item_text_2']) { + const id = `dx${randomUUID()}`; + + ids.push(id); + await appendElementTo(page, '#container', 'div', id); + + await createWidget(page, 'dxLookup', { + items: ['Item_text_1', 'Item_text_2'], + label: 'label text', + labelMode, + stylingMode, + rtlEnabled, + value, + }, `#${id}`); + } + } + } + } + + await testScreenshot(page, 'Lookup appearance.png'); + + for (const id of ids) { + await setStyleAttribute(page, `#${id}`, 'width: fit-content;'); + } + + await testScreenshot(page, 'Lookup width adjust to fit its content.png'); + + for (const id of ids) { + await setStyleAttribute(page, `#${id}`, 'width: 100px;'); + } + + await testScreenshot(page, 'Lookup appearance with limited width.png'); + }); +}); diff --git a/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance (fluent-next.blue.light).png b/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance (fluent-next.blue.light).png new file mode 100644 index 000000000000..b7dee4c413d6 Binary files /dev/null and b/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance (fluent.blue.light).png b/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance (fluent.blue.light).png new file mode 100644 index 000000000000..096f4ce0a08f Binary files /dev/null and b/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent-next.blue.light).png b/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent-next.blue.light).png new file mode 100644 index 000000000000..4ff6b8a2b517 Binary files /dev/null and b/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent.blue.light).png b/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent.blue.light).png new file mode 100644 index 000000000000..e44117b6e7c5 Binary files /dev/null and b/e2e/playwright/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/lookup/etalons/Lookup in loading (fluent-next.blue.light).png b/e2e/playwright/tests/editors/lookup/etalons/Lookup in loading (fluent-next.blue.light).png new file mode 100644 index 000000000000..fef482279e69 Binary files /dev/null and b/e2e/playwright/tests/editors/lookup/etalons/Lookup in loading (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/lookup/etalons/Lookup in loading (fluent.blue.light).png b/e2e/playwright/tests/editors/lookup/etalons/Lookup in loading (fluent.blue.light).png new file mode 100644 index 000000000000..2f52da76e344 Binary files /dev/null and b/e2e/playwright/tests/editors/lookup/etalons/Lookup in loading (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent-next.blue.light).png b/e2e/playwright/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent-next.blue.light).png new file mode 100644 index 000000000000..c394963da195 Binary files /dev/null and b/e2e/playwright/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent.blue.light).png b/e2e/playwright/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent.blue.light).png new file mode 100644 index 000000000000..ab1d64995c3f Binary files /dev/null and b/e2e/playwright/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/lookup/etalons/Lookup with no found data (fluent-next.blue.light).png b/e2e/playwright/tests/editors/lookup/etalons/Lookup with no found data (fluent-next.blue.light).png new file mode 100644 index 000000000000..add4f0b5b71b Binary files /dev/null and b/e2e/playwright/tests/editors/lookup/etalons/Lookup with no found data (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/lookup/etalons/Lookup with no found data (fluent.blue.light).png b/e2e/playwright/tests/editors/lookup/etalons/Lookup with no found data (fluent.blue.light).png new file mode 100644 index 000000000000..f1ced9e70ff3 Binary files /dev/null and b/e2e/playwright/tests/editors/lookup/etalons/Lookup with no found data (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/actionButton.spec.ts b/e2e/playwright/tests/editors/selectBox/actionButton.spec.ts new file mode 100644 index 000000000000..0656143a05f0 --- /dev/null +++ b/e2e/playwright/tests/editors/selectBox/actionButton.spec.ts @@ -0,0 +1,139 @@ +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 SelectBox from '../../../models/selectBox'; + +const FOCUSED_STATE_CLASS = 'dx-state-focused'; + +interface ActionButtonOptions { + refocus?: boolean; + type?: string; + disabled?: boolean; +} + +const setActionButton = async ( + page: Page, + { refocus = false, ...buttonOptions }: ActionButtonOptions = {}, +): Promise => page.evaluate(({ shouldRefocus, options }) => { + const selectBox = ($('#container') as any).dxSelectBox('instance'); + + selectBox.option('buttons', [{ + name: 'test', + options: { + icon: 'home', + ...options, + onClick: () => { + selectBox.option('value', 'item2'); + + if (shouldRefocus) { + // The editor rerenders its input. + selectBox.focus(); + } + }, + }, + }]); +}, { shouldRefocus: refocus, options: buttonOptions }); + +test.describe('SelectBox', () => { + test('Click on action button should correctly work with SelectBox containing the field template (T811890)', async ({ page }) => { + await createWidget(page, 'dxSelectBox', () => ({ + items: ['item1', 'item2'], + fieldTemplate: (value) => ($('
') as any).dxTextBox({ value }), + })); + + const selectBox = new SelectBox(page, '#container'); + + await setActionButton(page, { refocus: true }); + + await selectBox.element.click(); + await page.keyboard.press('Alt+ArrowUp'); + await selectBox.expectFocused(); + await expect.poll(() => selectBox.isOpened()).toBe(false); + + await selectBox.getButton(0).element.click(); + await selectBox.expectFocused(); + await expect(selectBox.input).toHaveValue('item2'); + }); + + test('Click on action button after typing should correctly work with SelectBox containing the field template (T811890)', async ({ page }) => { + await createWidget(page, 'dxSelectBox', () => ({ + items: ['item1', 'item2'], + fieldTemplate: (value) => ($('
') as any).dxTextBox({ value }), + })); + + const selectBox = new SelectBox(page, '#container'); + + await setActionButton(page, { refocus: true }); + + await selectBox.element.click(); + await page.keyboard.press('Alt+ArrowUp'); + await selectBox.expectFocused(); + await expect.poll(() => selectBox.isOpened()).toBe(false); + + await selectBox.input.pressSequentially('tt'); + await selectBox.getButton(0).element.click(); + await selectBox.expectFocused(); + await expect(selectBox.input).toHaveValue('item2'); + }); + + test('editor can be focused out after click on action button', async ({ page }) => { + await createWidget(page, 'dxSelectBox', { + items: ['item1', 'item2'], + }); + + const selectBox = new SelectBox(page, '#container'); + + await setActionButton(page); + + await selectBox.element.click(); + await selectBox.expectFocused(); + + await selectBox.getButton(0).element.click(); + await selectBox.expectFocused(); + + await page.keyboard.press('Tab'); + + if (await selectBox.hasClass(FOCUSED_STATE_CLASS)) { + await page.keyboard.press('Tab'); + } + + await selectBox.expectFocused(false); + }); + + test('selectbox should not be opened after click on disabled action button (T1117453)', async ({ page }) => { + await createWidget(page, 'dxSelectBox', { + items: ['item1', 'item2'], + value: 'item1', + }); + + const selectBox = new SelectBox(page, '#container'); + + await setActionButton(page, { type: 'default', disabled: true }); + + // The button is aria-disabled, and a locator click waits for it to become enabled. A user + // clicks it anyway: the mouse goes to the point where the button is. + const box = await selectBox.getButton(0).element.boundingBox(); + + expect(box).not.toBeNull(); + await page.mouse.click(box!.x + box!.width / 2, box!.y + box!.height / 2); + + await selectBox.expectFocused(false); + await expect.poll(() => selectBox.isOpened()).toBe(false); + await expect(selectBox.input).toHaveValue('item1'); + }); + + test('SelectBox: positioning content in the custom dropdown button', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'selectBox'); + await createWidget(page, 'dxSelectBox', () => ({ + items: ['item1', 'item2'], + value: 'item1', + dropDownButtonTemplate() { + return 'X'; + }, + }), '#container'); + + await testScreenshot(page, 'SelectBox Customize DropDown Button.png', { element: '#container' }); + }); +}); diff --git a/e2e/playwright/tests/editors/selectBox/common.spec.ts b/e2e/playwright/tests/editors/selectBox/common.spec.ts new file mode 100644 index 000000000000..ab3c3a092a32 --- /dev/null +++ b/e2e/playwright/tests/editors/selectBox/common.spec.ts @@ -0,0 +1,103 @@ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import SelectBox from '../../../models/selectBox'; + +const isDataSourceLoading = (page: Page): Promise => page.evaluate( + () => ($('#selectBox') as any).dxSelectBox('instance').getDataSource().isLoading(), +); + +test.describe('SelectBox placeholder', () => { + test('Placeholder is visible after items option change when value is not chosen (T1099804)', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'selectBox'); + await setStyleAttribute(page, '#container', 'box-sizing: border-box; width: 300px; height: 100px; padding: 8px;'); + await createWidget(page, 'dxSelectBox', { + width: '100%', + placeholder: 'Choose a value', + }, '#selectBox'); + + const selectBox = new SelectBox(page, '#selectBox'); + + await selectBox.option('items', [1, 2, 3]); + await testScreenshot(page, 'SelectBox placeholder after items change if value is not choosen.png', { element: '#container' }); + }); + + test('Pages should be loaded consistently after closing the dropdown popup and filtering the data (T1274576)', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'selectBox'); + await setStyleAttribute(page, '#container', 'box-sizing: border-box; width: 300px; height: 100px; padding: 8px;'); + await createWidget(page, 'dxSelectBox', () => { + const data: { id: number; text: string; anotherId: number }[] = []; + + for (let index = 0; index < 100; index += 1) { + data.push({ + id: index + 1, + text: `item ${index + 1}`, + anotherId: index % 2 === 0 ? 1 : 2, + }); + } + + const sampleAPI = new (window as any).DevExpress.data.ArrayStore({ key: 'id', data }); + const store = new (window as any).DevExpress.data.CustomStore({ + key: 'id', + load(loadOptions) { + return new Promise((resolve) => { + // The store answers late, like a server; the test waits for the load to finish. + // eslint-disable-next-line no-restricted-syntax + setTimeout(() => { + sampleAPI.load(loadOptions).done((items) => { + resolve(items); + }); + }, 100); + }); + }, + totalCount(loadOptions) { + return sampleAPI.totalCount(loadOptions); + }, + byKey(key) { + return sampleAPI.byKey(key); + }, + }); + + return { + dataSource: { + store, + paginate: true, + pageSize: 6, + }, + valueExpr: 'id', + displayExpr: 'text', + }; + }, '#selectBox'); + + const selectBox = new SelectBox(page, '#selectBox'); + + await selectBox.option('opened', true); + + const list = await selectBox.getList(); + + await expect(list.items).toHaveCount(12); + await expect(list.getItem(0).element).toHaveText('item 1'); + await expect(list.getItem(11).element).toHaveText('item 12'); + + await list.scrollTo(50); + + await page.locator('body').click(); + + await page.evaluate(() => { + const dataSource = ($('#selectBox') as any).dxSelectBox('instance').getDataSource(); + + dataSource.filter(['anotherId', '=', 2]); + dataSource.load(); + }); + await expect.poll(() => isDataSourceLoading(page)).toBe(false); + + await selectBox.option('opened', true); + await expect.poll(() => isDataSourceLoading(page)).toBe(false); + + await expect(list.items).toHaveCount(12); + await expect(list.getItem(0).element).toHaveText('item 2'); + await expect(list.getItem(11).element).toHaveText('item 24'); + }); +}); diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent-next.blue.light).png new file mode 100644 index 000000000000..670217f09f4c Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent.blue.light).png new file mode 100644 index 000000000000..94633fdee7a4 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox no data (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox no data (fluent-next.blue.light).png new file mode 100644 index 000000000000..c5f29e3a1bc7 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox no data (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox no data (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox no data (fluent.blue.light).png new file mode 100644 index 000000000000..da7676ffad72 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox no data (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent-next.blue.light).png new file mode 100644 index 000000000000..375930463a6c Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent.blue.light).png new file mode 100644 index 000000000000..b0ad7a3063cf Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent-next.blue.light).png new file mode 100644 index 000000000000..375930463a6c Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent.blue.light).png new file mode 100644 index 000000000000..b0ad7a3063cf Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent-next.blue.light).png new file mode 100644 index 000000000000..375930463a6c Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent.blue.light).png new file mode 100644 index 000000000000..b0ad7a3063cf Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent-next.blue.light).png new file mode 100644 index 000000000000..cd17c701fef2 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent.blue.light).png new file mode 100644 index 000000000000..be77bfdc7695 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent-next.blue.light).png new file mode 100644 index 000000000000..a7fe71aa7706 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent.blue.light).png new file mode 100644 index 000000000000..bfb6ba301ef2 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent-next.blue.light).png new file mode 100644 index 000000000000..13e53c304567 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png new file mode 100644 index 000000000000..30434d98d897 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent-next.blue.light).png new file mode 100644 index 000000000000..fdb91309147d Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png new file mode 100644 index 000000000000..6eb22c6cd2e9 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent-next.blue.light).png new file mode 100644 index 000000000000..b8f4acfd6ea6 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png new file mode 100644 index 000000000000..5b71bbda6182 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent-next.blue.light).png new file mode 100644 index 000000000000..161183427274 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png new file mode 100644 index 000000000000..9d3b48cf48ba Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent-next.blue.light).png new file mode 100644 index 000000000000..0e50ba1d26f7 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png new file mode 100644 index 000000000000..683f2d5604e6 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent-next.blue.light).png new file mode 100644 index 000000000000..2520152a1d8d Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png new file mode 100644 index 000000000000..b4a56f01b605 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent-next.blue.light).png new file mode 100644 index 000000000000..a86d5e603d0d Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent.blue.light).png new file mode 100644 index 000000000000..a195149b5901 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent-next.blue.light).png new file mode 100644 index 000000000000..3e1b1edff193 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png new file mode 100644 index 000000000000..9257aa9f3607 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent-next.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent-next.blue.light).png new file mode 100644 index 000000000000..b3ec6eeb8a9a Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png new file mode 100644 index 000000000000..ec597465d393 Binary files /dev/null and b/e2e/playwright/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/selectBox/label.spec.ts b/e2e/playwright/tests/editors/selectBox/label.spec.ts new file mode 100644 index 000000000000..e4f6fb4da44e --- /dev/null +++ b/e2e/playwright/tests/editors/selectBox/label.spec.ts @@ -0,0 +1,45 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import SelectBox from '../../../models/selectBox'; + +const labelMods = ['floating', 'static', 'outside']; +const stylingModes = ['outlined', 'underlined', 'filled']; + +test.describe('Label', () => { + stylingModes.forEach((stylingMode) => { + labelMods.forEach((labelMode) => { + test(`Label for dxSelectBox labelMode=${labelMode} stylingMode=${stylingMode}`, async ({ page }) => { + await setStyleAttribute(page, '#container', 'box-sizing: border-box; width: 300px; height: 400px; padding: 8px;'); + + await appendElementTo(page, '#container', 'div', 'selectBox1'); + await appendElementTo(page, '#container', 'div', 'selectBox2'); + + await createWidget(page, 'dxSelectBox', { + width: 100, + label: 'label', + text: '', + labelMode, + stylingMode, + }, '#selectBox1'); + + await createWidget(page, 'dxSelectBox', { + label: `this label is ${'very '.repeat(10)}long`, + text: `this content is ${'very '.repeat(10)}long`, + items: ['item1', 'item2'], + labelMode, + stylingMode, + }, '#selectBox2'); + + const selectBox2 = new SelectBox(page, '#selectBox2'); + + await selectBox2.element.click(); + + await testScreenshot(page, `SelectBox with label-labelMode=${labelMode}-stylingMode=${stylingMode}.png`, { element: '#container' }); + + await (await selectBox2.getPopup()).click(); + }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/selectBox/popup.spec.ts b/e2e/playwright/tests/editors/selectBox/popup.spec.ts new file mode 100644 index 000000000000..2b35a01d6e00 --- /dev/null +++ b/e2e/playwright/tests/editors/selectBox/popup.spec.ts @@ -0,0 +1,82 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; +import SelectBox from '../../../models/selectBox'; + +test.describe('popup height after load', () => { + test.use({ browserSize: [300, 400] }); + + test.beforeEach(async ({ page }) => { + await createWidget(page, 'dxSelectBox', { + dataSource: { + store: [], + paginate: true, + pageSize: 3, + }, + }); + }); + + test('SelectBox without data', async ({ page }) => { + const selectBox = new SelectBox(page, '#container'); + + await selectBox.element.click(); + + await testScreenshot(page, 'SelectBox no data.png'); + + await (await selectBox.getPopup()).click(); + }); + + [ + { + title: 'SelectBox has a correct popup height for the first opening if the pageSize is equal to dataSource length (T942881)', + pageSize: 3, + screenshotName: 'SelectBox pagesize equal datasource items count.png', + }, + { + title: 'SelectBox has a correct popup height for the first opening if the pageSize is less than dataSource items count', + pageSize: 2, + screenshotName: 'SelectBox pagesize less datasource items count.png', + }, + { + title: 'SelectBox has a correct popup height for the first opening if the pageSize is more than dataSource items count', + pageSize: 5, + screenshotName: 'SelectBox pagesize more datasource items count.png', + }, + ].forEach(({ title, pageSize, screenshotName }) => { + test(title, async ({ page }) => { + const selectBox = new SelectBox(page, '#container'); + + await selectBox.element.click(); + + await selectBox.option('dataSource', { + store: [1, 2, 3], + paginate: true, + pageSize, + }); + + await testScreenshot(page, screenshotName); + + await (await selectBox.getPopup()).click(); + }); + }); + + test('SelectBox does not change a popup height after load the last page', async ({ page }) => { + const selectBox = new SelectBox(page, '#container'); + + await selectBox.element.click(); + + await selectBox.option('dataSource', { + store: [1, 2, 3, 4, 5], + paginate: true, + pageSize: 2, + }); + + const list = await selectBox.getList(); + + await list.scrollTo(100); + + await testScreenshot(page, 'SelectBox popup height after last page load.png'); + + await (await selectBox.getPopup()).click(); + }); +}); diff --git a/e2e/playwright/tests/editors/selectBox/toolbarIntegration.spec.ts b/e2e/playwright/tests/editors/selectBox/toolbarIntegration.spec.ts new file mode 100644 index 000000000000..ad68b4629454 --- /dev/null +++ b/e2e/playwright/tests/editors/selectBox/toolbarIntegration.spec.ts @@ -0,0 +1,36 @@ +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { isMaterial } from '../../../helpers/themeUtils'; +import SelectBox from '../../../models/selectBox'; + +test.describe('SelectBox as Toolbar item', () => { + test('SelectBox should correctly render its buttons if editor is rendered as a Toolbar item with fieldTemplate (T949859)', async ({ page, theme }) => { + await createWidget(page, 'dxToolbar', () => ({ + items: [ + { + widget: 'dxSelectBox', + options: { + buttons: [ + { + name: 'test', + options: { + text: 'test', + }, + }, + ], + fieldTemplate: (_, wrapper) => { + ($('
').appendTo(wrapper) as any).dxTextBox(); + }, + items: [1, 2, 3, 4], + }, + }, + ], + })); + + const selectBox = new SelectBox(page, '#container'); + + // innerText, as TestCafe read it: Material capitalizes the text with CSS. + await expect(selectBox.getButton(0).text) + .toHaveText(isMaterial(theme) ? 'TEST' : 'test', { useInnerText: true }); + }); +}); diff --git a/e2e/playwright/tests/editors/tagBox/common.spec.ts b/e2e/playwright/tests/editors/tagBox/common.spec.ts new file mode 100644 index 000000000000..f4e0e79eba06 --- /dev/null +++ b/e2e/playwright/tests/editors/tagBox/common.spec.ts @@ -0,0 +1,138 @@ +import type { Page } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; +import TagBox from '../../../models/tagBox'; + +const pressKey = async (page: Page, key: string, times = 1): Promise => { + for (let index = 0; index < times; index += 1) { + await page.keyboard.press(key); + } +}; + +test.describe('TagBox', () => { + test('Keyboard navigation should work then tagBox is focused or list is focused', async ({ page }) => { + await createWidget(page, 'dxTagBox', { + items: ['item1', 'item2', 'item3'], + showSelectionControls: true, + selectionMode: 'all', + applyValueMode: 'useButtons', + }); + + const tagBox = new TagBox(page, '#container'); + + await tagBox.element.click(); + + await tagBox.expectFocused(); + await expect.poll(() => tagBox.isOpened()).toBe(true); + + const list = await tagBox.getList(); + const selectAllCheckBox = list.selectAll.checkBox; + const firstItemCheckBox = list.getItem().checkBox; + const secondItemCheckBox = list.getItem(1).checkBox; + const thirdItemCheckBox = list.getItem(2).checkBox; + + // List is focused + await pressKey(page, 'Tab'); + await selectAllCheckBox.expectFocused(); + await pressKey(page, 'ArrowDown', 3); + await thirdItemCheckBox.expectFocused(); + await pressKey(page, 'ArrowDown'); + await selectAllCheckBox.expectFocused(); + await pressKey(page, 'ArrowUp', 3); + await firstItemCheckBox.expectFocused(); + await firstItemCheckBox.expectChecked(false); + await pressKey(page, 'Space'); + await firstItemCheckBox.expectChecked(); + await pressKey(page, 'Enter'); + await firstItemCheckBox.expectChecked(false); + + // TagBox is focused + await pressKey(page, 'Shift+Tab'); + await tagBox.expectFocused(); + await pressKey(page, 'ArrowDown'); + await secondItemCheckBox.expectFocused(); + await pressKey(page, 'ArrowDown', 2); + await selectAllCheckBox.expectFocused(); + await pressKey(page, 'ArrowUp', 3); + await firstItemCheckBox.expectFocused(); + await firstItemCheckBox.expectChecked(false); + await pressKey(page, 'Space'); + await firstItemCheckBox.expectChecked(); + await pressKey(page, 'Enter'); + await firstItemCheckBox.expectChecked(false); + }); + + test('Select all checkbox should be focused by tab and closed by escape (T389453)', async ({ page }) => { + await createWidget(page, 'dxTagBox', { + items: ['item1', 'item2', 'item3'], + showSelectionControls: true, + selectionMode: 'all', + applyValueMode: 'useButtons', + }); + + const tagBox = new TagBox(page, '#container'); + + await tagBox.element.click(); + + await tagBox.expectFocused(); + await expect.poll(() => tagBox.isOpened()).toBe(true); + + const list = await tagBox.getList(); + const selectAllCheckBox = list.selectAll.checkBox; + + await pressKey(page, 'Tab'); + await tagBox.expectFocused(false); + await selectAllCheckBox.expectFocused(); + + await pressKey(page, 'Shift+Tab'); + await tagBox.expectFocused(); + await selectAllCheckBox.expectFocused(false); + + await pressKey(page, 'Tab'); + await tagBox.expectFocused(false); + await selectAllCheckBox.expectFocused(); + + await pressKey(page, 'Escape'); + + await tagBox.expectFocused(); + await expect.poll(() => tagBox.isOpened()).toBe(false); + }); + + test.describe(() => { + test.use({ browserSize: [300, 300] }); + + test('TagBox with selection controls', async ({ page }) => { + await createWidget(page, 'dxTagBox', { + items: [1, 2, 3, 4, 5, 6, 7], + showSelectionControls: true, + width: 300, + }); + + const tagBox = new TagBox(page, '#container'); + + // The editor and the body margin are wider than the window. TestCafe scrolled the whole + // target into view before a click; Playwright scrolls only to the click point, so the focus + // scrolls the page afterwards, and the drop-down closes on that scroll. + await tagBox.element.evaluate((element) => { + element.scrollIntoView({ block: 'nearest', inline: 'nearest' }); + }); + await tagBox.element.click(); + + await testScreenshot(page, 'TagBox with selection controls.png'); + }); + }); + + test('Placeholder is visible after items option change when value is not chosen (T1099804)', async ({ page }) => { + await createWidget(page, 'dxTagBox', { + width: 300, + placeholder: 'Choose a value', + }); + + const tagBox = new TagBox(page, '#container'); + + await tagBox.option('items', [1, 2, 3]); + + await testScreenshot(page, 'TagBox placeholder if value is not choosen.png', { element: '#container' }); + }); +}); diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent-next.blue.light).png new file mode 100644 index 000000000000..9d302c83b04a Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent.blue.light).png new file mode 100644 index 000000000000..0d67cb336ed5 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent-next.blue.light).png new file mode 100644 index 000000000000..3e44020a3917 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent.blue.light).png new file mode 100644 index 000000000000..68f32bff2eca Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent-next.blue.light).png new file mode 100644 index 000000000000..84c5c75cb523 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent.blue.light).png new file mode 100644 index 000000000000..008c179fa50d Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent-next.blue.light).png new file mode 100644 index 000000000000..2ea5495c25ec Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent.blue.light).png new file mode 100644 index 000000000000..feb0ab3ae279 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent-next.blue.light).png new file mode 100644 index 000000000000..3e44020a3917 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent.blue.light).png new file mode 100644 index 000000000000..68f32bff2eca Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent-next.blue.light).png new file mode 100644 index 000000000000..e769c69e68ba Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent.blue.light).png new file mode 100644 index 000000000000..f8996bed17f0 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent-next.blue.light).png new file mode 100644 index 000000000000..ee76d2cb7c14 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent.blue.light).png new file mode 100644 index 000000000000..87cc5472f8e3 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent-next.blue.light).png new file mode 100644 index 000000000000..5fc3d4400b80 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent.blue.light).png new file mode 100644 index 000000000000..66e3418c6249 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent-next.blue.light).png new file mode 100644 index 000000000000..9e069989453e Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent.blue.light).png new file mode 100644 index 000000000000..d10d905da405 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent-next.blue.light).png new file mode 100644 index 000000000000..ee76d2cb7c14 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent.blue.light).png new file mode 100644 index 000000000000..87cc5472f8e3 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent-next.blue.light).png new file mode 100644 index 000000000000..62d5a20de83b Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent.blue.light).png new file mode 100644 index 000000000000..b17c9ec44d49 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent-next.blue.light).png new file mode 100644 index 000000000000..f7af81e3d95d Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent.blue.light).png new file mode 100644 index 000000000000..bba5b7e3fb71 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent-next.blue.light).png new file mode 100644 index 000000000000..d1b50e911ce1 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent.blue.light).png new file mode 100644 index 000000000000..351bfadbe6d3 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent-next.blue.light).png new file mode 100644 index 000000000000..0809f0e24669 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent.blue.light).png new file mode 100644 index 000000000000..6090f182514e Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent-next.blue.light).png new file mode 100644 index 000000000000..f7af81e3d95d Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent.blue.light).png new file mode 100644 index 000000000000..bba5b7e3fb71 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent-next.blue.light).png new file mode 100644 index 000000000000..c25eed0a392b Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent.blue.light).png new file mode 100644 index 000000000000..7b7e5cbba6fd Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox with selection controls (fluent-next.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox with selection controls (fluent-next.blue.light).png new file mode 100644 index 000000000000..82e8323d51b6 Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox with selection controls (fluent-next.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/etalons/TagBox with selection controls (fluent.blue.light).png b/e2e/playwright/tests/editors/tagBox/etalons/TagBox with selection controls (fluent.blue.light).png new file mode 100644 index 000000000000..becebcbf917e Binary files /dev/null and b/e2e/playwright/tests/editors/tagBox/etalons/TagBox with selection controls (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/tagBox/label.spec.ts b/e2e/playwright/tests/editors/tagBox/label.spec.ts new file mode 100644 index 000000000000..7c23d492cb0b --- /dev/null +++ b/e2e/playwright/tests/editors/tagBox/label.spec.ts @@ -0,0 +1,89 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, insertStylesheetRulesToPage, setStyleAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import { isMaterial } from '../../../helpers/themeUtils'; +import TagBox from '../../../models/tagBox'; + +const stylingModes = ['outlined', 'underlined', 'filled']; +const labelModes = ['static', 'floating', 'hidden', 'outside']; + +test.describe('TagBox_Label', () => { + stylingModes.forEach((stylingMode) => { + test.describe(() => { + test.use({ browserSize: [300, 800] }); + + test(`Label for dxTagBox stylingMode=${stylingMode}`, async ({ page, theme }) => { + const componentOptions = { + label: 'label text', + items: [...Array(10)].map((_, i) => `item${i}`), + value: [...Array(5)].map((_, i) => `item${i}`), + stylingMode, + }; + + if (isMaterial(theme)) { + await insertStylesheetRulesToPage(page, '#container .dx-widget { font-family: sans-serif }'); + } + + await appendElementTo(page, '#container', 'div', 'tagBox1'); + await appendElementTo(page, '#container', 'div', 'tagBox2'); + + await createWidget(page, 'dxTagBox', { + ...componentOptions, + multiline: false, + }, '#tagBox1'); + + await createWidget(page, 'dxTagBox', { + ...componentOptions, + multiline: true, + }, '#tagBox2'); + + await page.locator('#tagBox2').click(); + + await testScreenshot(page, `TagBox label with stylingMode=${stylingMode}.png`); + }); + }); + + labelModes.forEach((labelMode) => { + test.describe(() => { + test.use({ browserSize: [300, 400] }); + + test(`Label shouldn't be cutted for dxTagBox in stylingMode=${stylingMode}, labelMode=${labelMode} (T1104913)`, async ({ page }) => { + await setStyleAttribute(page, '#container', 'top: 250px;'); + + // The factory runs in the page, so the loop values come in as its argument. + await createWidget(page, 'dxTagBox', (modes) => ({ + width: 200, + label: 'Label text', + ...modes, + dataSource: { + load() { + return new Promise((resolve) => { + resolve([ + { text: 'item_1' }, + { text: 'item_2' }, + { text: 'item_3' }, + { text: 'item_4' }, + ]); + }); + }, + paginate: true, + pageSize: 20, + }, + }), '#container', { arg: { labelMode, stylingMode } }); + + const tagBox = new TagBox(page, '#container'); + + await tagBox.element.click(); + + const screenshotName = `TagBox label with stylingMode=${stylingMode},labelMode=${labelMode}.png`; + + await tagBox.element.click(); + await tagBox.element.click(); + + await testScreenshot(page, screenshotName); + }); + }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/textBox/validationMessage.spec.ts b/e2e/playwright/tests/editors/textBox/validationMessage.spec.ts index 7f315e10beea..703272c95d03 100644 --- a/e2e/playwright/tests/editors/textBox/validationMessage.spec.ts +++ b/e2e/playwright/tests/editors/textBox/validationMessage.spec.ts @@ -1,8 +1,6 @@ import { test } from '../../../fixtures'; import { createWidget } from '../../../helpers/createWidget'; -import { - addFocusableElementBefore, appendElementTo, removeAttribute, setAttribute, waitForNextFrame, -} from '../../../helpers/domUtils'; +import { addFocusableElementBefore, appendElementTo } from '../../../helpers/domUtils'; import { testScreenshot } from '../../../helpers/screenshots'; const TEXTEDITOR_INPUT_CLASS = 'dx-texteditor-input'; @@ -10,7 +8,7 @@ const TEXTEDITOR_INPUT_CLASS = 'dx-texteditor-input'; test.describe('ValidationMessage', () => { test.use({ browserSize: [300, 200] }); - test('Validation Message position should be correct after change visibility of parent container (T1095900)', async ({ page }) => { + test('TextBox ValidationMessage position is correct', async ({ page }) => { await appendElementTo(page, '#container', 'div', 'textbox'); await createWidget(page, 'dxTextBox', { value: 'a', @@ -31,10 +29,6 @@ test.describe('ValidationMessage', () => { await page.keyboard.press('Enter'); await page.locator('#focusable-start').click(); - await setAttribute(page, '#container', 'hidden', 'true'); - await waitForNextFrame(page); - await removeAttribute(page, '#container', 'hidden'); - await testScreenshot(page, 'Textbox validation message.png'); }); }); diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/common.ts b/e2e/testcafe-devextreme/tests/editors/calendar/common.ts deleted file mode 100644 index 958a0efcc15b..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/calendar/common.ts +++ /dev/null @@ -1,417 +0,0 @@ -import { ClientFunction, Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import Calendar from 'devextreme-testcafe-models/calendar'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { - appendElementTo, setClassAttribute, setStyleAttribute, -} from '../../../helpers/domUtils'; - -const STATE_HOVER_CLASS = 'dx-state-hover'; -const STATE_ACTIVE_CLASS = 'dx-state-active'; -const CALENDAR_CELL_CLASS = 'dx-calendar-cell'; -const CALENDAR_TODAY_CLASS = 'dx-calendar-today'; -const CALENDAR_SELECTED_DATE_CLASS = 'dx-calendar-selected-date'; -const CALENDAR_EMPTY_CELL_CLASS = 'dx-calendar-empty-cell'; -const CALENDAR_OTHER_VIEW_CLASS = 'dx-calendar-other-view'; -const CALENDAR_CONTOURED_DATE_CLASS = 'dx-calendar-contoured-date'; - -const GESTURE_COVER_CLASS = 'dx-gesture-cover'; - -fixture.disablePageReloads`Calendar` - .page(url(__dirname, '../../container.html')); - -test('Caption button text should be ellipsis when width is limit', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'Calendar with limit width.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxCalendar', { - width: 150, - value: new Date(2021, 9, 17), -})); - -test('Grabbing cursor should be shown during swipe', async (t) => { - const calendar = new Calendar('#container'); - - await calendar.showGestureCover(); - - const gestureCover = Selector(`.${GESTURE_COVER_CLASS}`); - - await t - .expect(gestureCover.getStyleProperty('cursor')) - .eql('auto'); - - await calendar.swipeStart(); - - await t - .expect(gestureCover.getStyleProperty('cursor')) - .eql('grabbing'); - - await calendar.swipe(0.4); - - await t - .expect(gestureCover.getStyleProperty('cursor')) - .eql('grabbing'); - - await calendar.swipeEnd(); - - await t - .expect(gestureCover.getStyleProperty('cursor')) - .eql('auto'); -}).before(async () => createWidget('dxCalendar', { - value: new Date(2021, 9, 17), -})); - -test('Cells on month view should have hover state class after hover when zoomLevel has been changed from "year" to "month" by click on cell', async (t) => { - const calendar = new Calendar('#container'); - - await t - .click(calendar.getView().getMonthCellByDate(new Date(2021, 9, 17))); - - const targetCell = calendar.getView().getCellByDate(new Date(2021, 9, 19)); - await t - .hover(targetCell) - .expect(targetCell.hasClass(STATE_HOVER_CLASS)) - .eql(true); -}).before(async () => createWidget('dxCalendar', { - zoomLevel: 'year', - value: new Date(2021, 9, 17), -})); - -test('Calendar with showWeekNumbers rendered correct', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'Calendar with showWeekNumbers.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxCalendar', { - value: new Date(2022, 0, 1), - showWeekNumbers: true, -})); - -test('Calendar with showWeekNumbers rendered correct for last week of year value', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'Calendar with showWeekNumbers last week.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxCalendar', { - value: new Date(2021, 11, 31), - showWeekNumbers: true, - weekNumberRule: 'firstDay', -})); - -test('Calendar with showWeekNumbers rendered correct with rtlEnabled', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'Calendar with showWeekNumbers rtl=true.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxCalendar', { - value: new Date(2022, 0, 1), - showWeekNumbers: true, - rtlEnabled: true, -})); - -test('Calendar with showWeekNumbers rendered correct with cellTemplate', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'Calendar with showWeekNumbers and cell template.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxCalendar', { - value: new Date(2022, 0, 1), - showWeekNumbers: true, - cellTemplate(cellData, cellIndex) { - const italic = $('').css('font-style', 'italic') - .text(cellData.text); - const bold = $('').css('font-weight', '900') - .text(cellData.text); - return cellIndex === -1 ? bold : italic; - }, -})); - -['multiple', 'range'].forEach((selectionMode) => { - test(`Calendar with ${selectionMode} selectionMode rendered correct`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `Calendar with ${selectionMode} selectionMode.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => createWidget('dxCalendar', { - value: [new Date(2023, 0, 5), new Date(2023, 0, 17), new Date(2023, 1, 2)], - selectionMode, - })); - - test(`Week cell click selection (selectionMode=${selectionMode})`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const calendar = new Calendar('#container'); - - await t - .click(calendar.getView().getWeekNumberCellByIndex(3)); - - await testScreenshot(t, takeScreenshot, `Week cell click selection (selectionMode=${selectionMode}).png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => createWidget('dxCalendar', { - value: [new Date(2023, 0, 5), new Date(2023, 0, 17), new Date(2023, 1, 2)], - selectionMode, - showWeekNumbers: true, - firstDayOfWeek: 1, - disabledDates: ({ date }) => { - const day = date.getDay(); - return day === 1 || day === 4 || day === 0; - }, - })); -}); - -test('Calendar with multiview rendered correct', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'Calendar with multiview.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxCalendar', { - value: [new Date(2023, 0, 5), new Date(2023, 1, 14)], - selectionMode: 'range', - viewsCount: 2, -})); - -['month', 'year', 'decade', 'century'].forEach((zoomLevel) => { - test(`Calendar ${zoomLevel} view rendered correct`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `Calendar ${zoomLevel} view.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await setStyleAttribute(Selector('#container'), 'width: 400px; height: 400px;'); - await appendElementTo('#container', 'div', 'calendar'); - - return createWidget('dxCalendar', { - value: new Date(2021, 9, 17), - zoomLevel, - _todayDate: () => new Date(2023, 9, 17), - }, '#calendar'); - }); - - test(`Calendar ${zoomLevel} view rendered correct in RTL`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `Calendar ${zoomLevel} view in RTL mode.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await setStyleAttribute(Selector('#container'), 'width: 400px; height: 400px;'); - await appendElementTo('#container', 'div', 'calendar'); - - return createWidget('dxCalendar', { - value: new Date(2021, 9, 17), - zoomLevel, - rtlEnabled: true, - _todayDate: () => new Date(2023, 9, 17), - }, '#calendar'); - }); - - test(`Calendar ${zoomLevel} view with today button rendered correct`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `Calendar ${zoomLevel} view with today button.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await setStyleAttribute(Selector('#container'), 'width: 600px; height: 800px;'); - await appendElementTo('#container', 'div', 'calendar'); - - return createWidget('dxCalendar', { - value: new Date(2021, 9, 17), - width: 450, - height: 450, - zoomLevel, - showTodayButton: true, - _todayDate: () => new Date(2023, 9, 17), - }, '#calendar'); - }); -}); - -test('Calendar with disabled dates rendered correct', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'Calendar with disabled dates.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxCalendar', { - value: new Date(2021, 9, 17), - showTodayButton: true, - showWeekNumbers: true, - min: new Date(2021, 9, 10), - disabledDates: [new Date(2021, 9, 18)], -})); - -[CALENDAR_CELL_CLASS, CALENDAR_TODAY_CLASS].forEach((cellClass) => { - const testName = `Calendar ${cellClass === CALENDAR_TODAY_CLASS ? 'today ' : ''}cell styles`; - - test(testName, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const calendar = new Calendar('#calendar'); - - const startCellDate = new Date(2021, 9, 3); - const view = calendar.getView(); - - let cellOffset = 0; - - // eslint-disable-next-line no-restricted-syntax - for (const cellTypeClass of [ - cellClass, - `${cellClass} ${CALENDAR_OTHER_VIEW_CLASS}`, - `${cellClass} ${CALENDAR_OTHER_VIEW_CLASS} ${CALENDAR_SELECTED_DATE_CLASS}`, - `${cellClass} ${CALENDAR_OTHER_VIEW_CLASS} ${CALENDAR_EMPTY_CELL_CLASS}`, - `${cellClass} ${CALENDAR_EMPTY_CELL_CLASS}`, - `${cellClass} ${CALENDAR_EMPTY_CELL_CLASS} ${CALENDAR_SELECTED_DATE_CLASS}`, - `${cellClass} ${CALENDAR_CONTOURED_DATE_CLASS}`, - `${cellClass} ${CALENDAR_CONTOURED_DATE_CLASS} ${CALENDAR_SELECTED_DATE_CLASS}`, - `${cellClass} ${CALENDAR_SELECTED_DATE_CLASS}`, - ]) { - // eslint-disable-next-line no-restricted-syntax - for (const stateClass of [ - '', - STATE_HOVER_CLASS, - STATE_ACTIVE_CLASS, - ]) { - const cellClasses = `${cellTypeClass} ${stateClass}`; - - await setClassAttribute(view.getCellByOffset(startCellDate, cellOffset), cellClasses); - - const cellNumber = startCellDate.getDate() + cellOffset; - const cellId = `cell-${cellNumber}`; - await appendElementTo('#container', 'div', cellId); - - await ClientFunction(() => { - $(`#${cellId}`).text(`${cellNumber} - ${cellClasses}`); - }, { - dependencies: { - cellNumber, cellId, cellClasses, - }, - })(); - - cellOffset += 1; - } - } - - await testScreenshot(t, takeScreenshot, `${testName}.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await setStyleAttribute(Selector('#container'), 'width: 600px; height: 800px;'); - await appendElementTo('#container', 'div', 'calendar'); - - return createWidget('dxCalendar', { - currentDate: new Date(2021, 9, 15), - }, '#calendar'); - }); -}); - -['year', 'decade', 'century'].forEach((zoomLevel) => { - const testName = `Calendar ${zoomLevel} view cell styles`; - - test(testName, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const calendar = new Calendar('#calendar'); - - const startCellDate = new Date(2021, 9, 3); - const view = calendar.getView(); - - let cellOffset = 0; - - // eslint-disable-next-line no-restricted-syntax - for (const cellTypeClass of [ - STATE_HOVER_CLASS, - STATE_ACTIVE_CLASS, - CALENDAR_TODAY_CLASS, - CALENDAR_OTHER_VIEW_CLASS, - CALENDAR_EMPTY_CELL_CLASS, - CALENDAR_CONTOURED_DATE_CLASS, - CALENDAR_SELECTED_DATE_CLASS, - `${CALENDAR_CONTOURED_DATE_CLASS} ${CALENDAR_SELECTED_DATE_CLASS}`, - ]) { - const cellClasses = `${cellTypeClass}`; - - await setClassAttribute(view.getCellByIndex(cellOffset), cellClasses); - - const cellNumber = startCellDate.getDate() + cellOffset; - const cellId = `cell-${cellNumber}`; - await appendElementTo('#container', 'div', cellId); - - await ClientFunction(() => { - $(`#${cellId}`).text(`${cellNumber} - ${cellClasses}`); - }, { - dependencies: { - cellNumber, cellId, cellClasses, - }, - })(); - - cellOffset += 1; - } - - await testScreenshot(t, takeScreenshot, `${testName}.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await setStyleAttribute(Selector('#container'), 'width: 600px; height: 800px;'); - await appendElementTo('#container', 'div', 'calendar'); - - return createWidget('dxCalendar', { - currentDate: new Date(2021, 9, 17), - zoomLevel, - _todayDate: () => new Date(2023, 9, 17), - }, '#calendar'); - }); - - test(`Calendar with range selectionMode rendered correct (maxZoomLevel=${zoomLevel})`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `Calendar with range selection (maxZoomLevel=${zoomLevel}).png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => createWidget('dxCalendar', { - value: [new Date(1023, 0, 5), new Date(1023, 0, 17), new Date(1099, 1, 2)], - selectionMode: 'range', - maxZoomLevel: zoomLevel, - })); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar cell styles (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar cell styles (fluent-next.blue.light).png deleted file mode 100644 index 8ede73b8450b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar cell styles (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar cell styles (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar cell styles (fluent.blue.light).png deleted file mode 100644 index feba711596b1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar cell styles (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view (fluent-next.blue.light).png deleted file mode 100644 index 27a90aa13d7e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view (fluent.blue.light).png deleted file mode 100644 index 1427678fad48..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view cell styles (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view cell styles (fluent-next.blue.light).png deleted file mode 100644 index 98cbfb664270..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view cell styles (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view cell styles (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view cell styles (fluent.blue.light).png deleted file mode 100644 index cf955d42b98c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view cell styles (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent-next.blue.light).png deleted file mode 100644 index fca7f362de4f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent.blue.light).png deleted file mode 100644 index fe1fe0ff5de7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view in RTL mode (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view with today button (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view with today button (fluent-next.blue.light).png deleted file mode 100644 index e5cb7be8d5b6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view with today button (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view with today button (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view with today button (fluent.blue.light).png deleted file mode 100644 index 1cd7e532092a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar century view with today button (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view (fluent-next.blue.light).png deleted file mode 100644 index 31c0c13a73db..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view (fluent.blue.light).png deleted file mode 100644 index f67675ea48a9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent-next.blue.light).png deleted file mode 100644 index 3e4d55c6579e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent.blue.light).png deleted file mode 100644 index 3048b51ddcf9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view cell styles (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent-next.blue.light).png deleted file mode 100644 index 7bcecf5b74f2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent.blue.light).png deleted file mode 100644 index 0a35b2165a84..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view in RTL mode (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view with today button (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view with today button (fluent-next.blue.light).png deleted file mode 100644 index 14882af7e86f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view with today button (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view with today button (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view with today button (fluent.blue.light).png deleted file mode 100644 index 88152b06eaab..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar decade view with today button (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view (fluent-next.blue.light).png deleted file mode 100644 index 9695461fcb69..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view (fluent.blue.light).png deleted file mode 100644 index 6a7f4adc170b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent-next.blue.light).png deleted file mode 100644 index bf98909d5a7d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent.blue.light).png deleted file mode 100644 index dd90239212e9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view in RTL mode (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view with today button (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view with today button (fluent-next.blue.light).png deleted file mode 100644 index fc9e54a8cb8c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view with today button (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view with today button (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view with today button (fluent.blue.light).png deleted file mode 100644 index ba034d348460..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar month view with today button (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar today cell styles (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar today cell styles (fluent-next.blue.light).png deleted file mode 100644 index 2fbe5f8edbd9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar today cell styles (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar today cell styles (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar today cell styles (fluent.blue.light).png deleted file mode 100644 index 9e68fd844f13..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar today cell styles (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with disabled dates (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with disabled dates (fluent-next.blue.light).png deleted file mode 100644 index de9c5f6db29e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with disabled dates (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with disabled dates (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with disabled dates (fluent.blue.light).png deleted file mode 100644 index 4b8ef1a74cd8..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with disabled dates (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with limit width (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with limit width (fluent-next.blue.light).png deleted file mode 100644 index 979750fea6a9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with limit width (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with limit width (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with limit width (fluent.blue.light).png deleted file mode 100644 index b7d839604dea..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with limit width (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent-next.blue.light).png deleted file mode 100644 index 9d033bf4234c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent.blue.light).png deleted file mode 100644 index 0942dcb9f891..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiple selectionMode (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiview (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiview (fluent-next.blue.light).png deleted file mode 100644 index 39bfcfd1c346..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiview (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiview (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiview (fluent.blue.light).png deleted file mode 100644 index b87e971d156e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with multiview (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent-next.blue.light).png deleted file mode 100644 index e927523a9570..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent.blue.light).png deleted file mode 100644 index 6f2cca3ab230..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=century) (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent-next.blue.light).png deleted file mode 100644 index 06227d3cda9a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent.blue.light).png deleted file mode 100644 index a724ebe7a63d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=decade) (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent-next.blue.light).png deleted file mode 100644 index 5967960fcf3f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent.blue.light).png deleted file mode 100644 index 05f555d261c1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selection (maxZoomLevel=year) (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent-next.blue.light).png deleted file mode 100644 index 8ff23322b2db..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent.blue.light).png deleted file mode 100644 index 6d15db6cfd60..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with range selectionMode (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent-next.blue.light).png deleted file mode 100644 index e5b91f3a6d23..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent.blue.light).png deleted file mode 100644 index 28a336dc52ed..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent-next.blue.light).png deleted file mode 100644 index d309bf20a747..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent.blue.light).png deleted file mode 100644 index 547535226a71..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers and cell template (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent-next.blue.light).png deleted file mode 100644 index 19a07bc4899c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent.blue.light).png deleted file mode 100644 index 63d55fbbed11..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers last week (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent-next.blue.light).png deleted file mode 100644 index 1904b357dccf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent.blue.light).png deleted file mode 100644 index 6dd17125de98..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar with showWeekNumbers rtl=true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view (fluent-next.blue.light).png deleted file mode 100644 index 08b08e090cce..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view (fluent.blue.light).png deleted file mode 100644 index 23ea779d0ab5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view cell styles (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view cell styles (fluent-next.blue.light).png deleted file mode 100644 index e3a55936b762..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view cell styles (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view cell styles (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view cell styles (fluent.blue.light).png deleted file mode 100644 index 9e797744f297..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view cell styles (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent-next.blue.light).png deleted file mode 100644 index dba2b9627b25..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent.blue.light).png deleted file mode 100644 index 50398248482c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view in RTL mode (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view with today button (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view with today button (fluent-next.blue.light).png deleted file mode 100644 index 68347fdb784c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view with today button (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view with today button (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view with today button (fluent.blue.light).png deleted file mode 100644 index 4298c7cad9a0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Calendar year view with today button (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent-next.blue.light).png deleted file mode 100644 index b06ac7379cfc..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent.blue.light).png deleted file mode 100644 index b4d6bcfb50d0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=multiple) (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent-next.blue.light).png deleted file mode 100644 index 032fca9fccd7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent.blue.light).png deleted file mode 100644 index a60a76d4ef0b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/calendar/etalons/Week cell click selection (selectionMode=range) (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/calendar/keyboard.ts b/e2e/testcafe-devextreme/tests/editors/calendar/keyboard.ts deleted file mode 100644 index 7e7e4fc7bf24..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/calendar/keyboard.ts +++ /dev/null @@ -1,160 +0,0 @@ -import { ClientFunction, Selector } from 'testcafe'; -import Calendar from 'devextreme-testcafe-models/calendar'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -const CALENDAR_SELECTED_DATE_CLASS = 'dx-calendar-selected-date'; -const CALENDAR_CONTOURED_DATE_CLASS = 'dx-calendar-contoured-date'; - -fixture.disablePageReloads`Calendar keyboard navigation` - .page(url(__dirname, '../../container.html')); - -test('Tab navigation order prevButton-caption-nextButton-viewdWrapper-todayButton', async (t) => { - const calendar = new Calendar('#container'); - - await t - .click(Selector('body')) - .pressKey('tab'); - - await t - .expect(calendar.getNavigatorPrevButton().isFocused) - .ok() - .pressKey('tab') - .expect(calendar.getNavigatorCaption().isFocused) - .ok() - .pressKey('tab') - .expect(calendar.getNavigatorNextButton().isFocused) - .ok() - .pressKey('tab'); - - const cell = calendar.getView().getCellByDate(new Date(2021, 9, 17)); - await t - .expect(cell.hasClass(CALENDAR_CONTOURED_DATE_CLASS)) - .ok() - .expect(cell.hasClass(CALENDAR_SELECTED_DATE_CLASS)) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(calendar.getTodayButton().isFocused) - .ok(); - - await t - .pressKey('enter'); - - const currentDate = await calendar.option('value') as Date; - const today = new Date(); - - currentDate.setHours(0, 0, 0, 0); - today.setHours(0, 0, 0, 0); - - await t - .expect(currentDate) - .eql(today); - - const todayCell = calendar.getView().getCellByDate(today); - - await t - .expect(todayCell.hasClass(CALENDAR_SELECTED_DATE_CLASS)) - .ok(); -}).before(async () => createWidget('dxCalendar', { - value: new Date(2021, 9, 17), - showTodayButton: true, -})); - -test('focusin and focusout event handlers should not be called on tab navigate inside calendar', async (t) => { - const calendar = new Calendar('#container'); - - await t - .click(Selector('body')) - .pressKey('tab'); - - await t - .expect(calendar.getNavigatorPrevButton().isFocused) - .ok() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .pressKey('tab'); - - await t - .expect(calendar.getNavigatorCaption().isFocused) - .ok() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .pressKey('tab'); - - await t - .expect(calendar.getNavigatorNextButton().isFocused) - .ok() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .pressKey('tab'); - - const cell = calendar.getView().getCellByDate(new Date(2021, 9, 17)); - await t - .expect(cell.hasClass(CALENDAR_CONTOURED_DATE_CLASS)) - .ok() - .expect(cell.hasClass(CALENDAR_SELECTED_DATE_CLASS)) - .ok() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .pressKey('tab'); - - await t - .expect(calendar.getTodayButton().isFocused) - .ok() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .pressKey('tab'); - - await t - .expect(calendar.isFocused) - .notOk() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onFocusInCounter = 0; - (window as any).onFocusOutCounter = 0; - })(); - - return createWidget('dxCalendar', { - value: new Date(2021, 9, 17), - showTodayButton: true, - onFocusIn() { - ((window as any).onFocusInCounter as number) += 1; - }, - onFocusOut() { - ((window as any).onFocusOutCounter as number) += 1; - }, - }); -}).after(async () => { - await ClientFunction(() => { - delete (window as any).onFocusInCounter; - delete (window as any).onFocusOutCounter; - })(); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/common.ts b/e2e/testcafe-devextreme/tests/editors/dateBox/common.ts deleted file mode 100644 index 169066a83a2e..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateBox/common.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* eslint-disable no-restricted-syntax */ -import type { DatePickerType, DateType, Properties } from 'devextreme/ui/date_box.d'; -import { EditorStyle } from 'devextreme/common'; -import { Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import Guid from 'devextreme/core/guid'; -import { - insertStylesheetRulesToPage, - appendElementTo, setClassAttribute, - removeClassAttribute, -} from '../../../helpers/domUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; - -const DATEBOX_CLASS = 'dx-datebox'; -const DROP_DOWN_EDITOR_ACTIVE_CLASS = 'dx-dropdowneditor-active'; -const FOCUSED_STATE_CLASS = 'dx-state-focused'; - -const stylingModes: EditorStyle[] = ['outlined', 'underlined', 'filled']; -const pickerTypes: DatePickerType[] = ['calendar', 'list', 'native', 'rollers']; -const types: DateType[] = ['date', 'datetime', 'time']; - -fixture.disablePageReloads`DateBox render` - .page(url(__dirname, '../../container.html')); - -const createDateBox = async (options?: Properties, state?: string): Promise => { - const id = `${`dx${new Guid()}`}`; - - await appendElementTo('#container', 'div', id, {}); - await createWidget('dxDateBox', { - width: 220, - label: 'label text', - showClearButton: true, - value: new Date(2021, 9, 17, 16, 34), - ...options, - }, `#${id}`); - - if (state) { - await setClassAttribute(Selector(`#${id}`), state); - } - - return id; -}; - -test('DateBox styles', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'Datebox.png'); - - for (const state of [DROP_DOWN_EDITOR_ACTIVE_CLASS, FOCUSED_STATE_CLASS] as any[]) { - for (const id of t.ctx.ids) { - await setClassAttribute(Selector(`#${id}`), state); - } - - await testScreenshot(t, takeScreenshot, `Datebox ${state.replaceAll('dx-', '').replaceAll('dropdowneditor-', '').replaceAll('state-', '')}.png`); - - for (const id of t.ctx.ids) { - await removeClassAttribute(Selector(`#${id}`), state); - } - } - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async (t) => { - t.ctx.ids = []; - - await insertStylesheetRulesToPage(`.${DATEBOX_CLASS} { display: inline-block; margin: 5px; }`); - - for (const stylingMode of stylingModes) { - for (const type of types) { - const options = { - stylingMode, - type, - }; - for (const pickerType of pickerTypes) { - const id = await createDateBox({ ...options, pickerType }); - - t.ctx.ids.push(id); - } - - const id = await createDateBox({ ...options, rtlEnabled: true }); - t.ctx.ids.push(id); - } - } -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/dateBox.ts b/e2e/testcafe-devextreme/tests/editors/dateBox/dateBox.ts deleted file mode 100644 index 9ca096090000..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateBox/dateBox.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import DateBox from 'devextreme-testcafe-models/dateBox'; -import { Selector } from 'testcafe'; -import url from '../../../helpers/getPageUrl'; -import asyncForEach from '../../../helpers/asyncForEach'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { Themes } from '../../../helpers/themes'; - -fixture.disablePageReloads`DateBox` - .page(url(__dirname, '../../container.html')); - -const ITEM_HEIGHT = 40; - -const TIME_VIEW_FIELD_CLASS = 'dx-timeview-field'; -const SELECT_BOX_CONTAINER_CLASS = 'dx-selectbox-container'; - -[[11, 12, 1925], [10, 23, 2001]].forEach(([month, day, year]) => { - test.meta({ runInTheme: Themes.genericLight })(`Rollers should be scrolled correctly when value is changed to ${day}/${month}/${year} using kbn and valueChangeEvent=keyup (T948310)`, async (t) => { - const dateBox = new DateBox('#container'); - const { dropDownEditorButton } = dateBox; - - await t - .click(dropDownEditorButton); - - await t - .click(DateBox.getDoneButton()); - - await t - .typeText(dateBox.input, `${month}${day}${year}`); - - await t - .click(dropDownEditorButton); - - const views = { - month: month - 1, - day: day - 1, - year: year - 1900, - }; - await asyncForEach(Object.keys(views), async (viewName) => { - const scrollTop = await DateBox.getRollerScrollTop(viewName); - - await t - .expect(scrollTop) - .eql(views[viewName] * ITEM_HEIGHT, `${viewName} view is scrolled correctly`); - }); - }).before(async () => createWidget('dxDateBox', { - pickerType: 'rollers', - openOnFieldClick: false, - useMaskBehavior: true, - valueChangeEvent: 'keyup', - })); -}); - -test('DateBox with datetime and root element as container (T1193495)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - await testScreenshot(t, takeScreenshot, 'DateBox with datetime and root element as container.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxDateBox', { - value: new Date(2022, 10, 23, 17, 23), - type: 'datetime', - pickerType: 'calendar', - opened: true, - width: 300, - dropDownOptions: { - container: '#container', - }, -}, '#container')); - -test.meta({ themes: [Themes.materialBlue, Themes.genericLight, Themes.fluentBlue] })('DateBox with datetime and opened AM/PM select (T1312677, T1327616)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const timeViewSelect = Selector(`#container .${TIME_VIEW_FIELD_CLASS} .${SELECT_BOX_CONTAINER_CLASS}`); - - await t - .click(timeViewSelect); - - await testScreenshot( - t, - takeScreenshot, - 'DateBox with datetime and opened AMPM select.png', - { element: '#container' }, - ); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxDateBox', { - value: new Date(2022, 10, 23, 17, 23), - type: 'datetime', - pickerType: 'calendar', - opened: true, - applyValueMode: 'instantly', - dropDownOptions: { - container: '#container', - }, -}, '#container')); diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/dateBoxGeometry.ts b/e2e/testcafe-devextreme/tests/editors/dateBox/dateBoxGeometry.ts deleted file mode 100644 index 424d6d18f2e7..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateBox/dateBoxGeometry.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { ClientFunction } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import DateBox from 'devextreme-testcafe-models/dateBox'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -const waitFont = ClientFunction(() => (window as any).DevExpress.ui.themes.waitWebFont('1234567890APM/:', 400)); - -fixture.disablePageReloads`DateBox (datetime) geometry (T896846)` - .page(url(__dirname, '../../container.html')); - -test.meta({ browserSize: [600, 550] })('Geometry is good', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const dateBox = new DateBox('#container'); - - await dateBox.option('opened', true); - - await testScreenshot(t, takeScreenshot, 'Datebox with calendar.png'); - - await dateBox.option('opened', false); - await dateBox.option('type', 'datetime'); - await dateBox.option('opened', true); - - await testScreenshot(t, takeScreenshot, 'Datebox with datetime.png'); - - await dateBox.option('opened', false); - await dateBox.option({ showAnalogClock: false }); - await dateBox.option('opened', true); - - await testScreenshot(t, takeScreenshot, 'Datebox with datetime without analog clock.png'); - - await dateBox.option('opened', false); - await dateBox.option({ displayFormat: 'HH:mm', calendarOptions: { visible: false }, showAnalogClock: true }); - await dateBox.option('opened', true); - - await testScreenshot(t, takeScreenshot, 'Datebox with datetime without calendar.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await waitFont(); - - return createWidget('dxDateBox', { - pickerType: 'calendar', - width: 200, - value: new Date(1.5e12), - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent-next.blue.light).png deleted file mode 100644 index 672b1c857692..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent.blue.light).png deleted file mode 100644 index 3e811cb341d1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox render with buttons container (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent-next.blue.light).png deleted file mode 100644 index 8ef8a12382fc..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent.blue.light).png deleted file mode 100644 index 46c399715574..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (generic.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (generic.light).png deleted file mode 100644 index 66a55d50f663..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (generic.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (material.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (material.blue.light).png deleted file mode 100644 index 4673369543c6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and opened AMPM select (material.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent-next.blue.light).png deleted file mode 100644 index 8c36aed3e620..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent.blue.light).png deleted file mode 100644 index e21ff7583fa9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/DateBox with datetime and root element as container (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox (fluent-next.blue.light).png deleted file mode 100644 index bda6832a8028..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox (fluent.blue.light).png deleted file mode 100644 index b99199f6c9bf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox active (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox active (fluent-next.blue.light).png deleted file mode 100644 index 0c5907ad5fd6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox active (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox active (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox active (fluent.blue.light).png deleted file mode 100644 index b99199f6c9bf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox active (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox focused (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox focused (fluent-next.blue.light).png deleted file mode 100644 index a9cf8238fdb5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox focused (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox focused (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox focused (fluent.blue.light).png deleted file mode 100644 index 132e210e9a23..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox focused (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox label symbols (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox label symbols (fluent-next.blue.light).png deleted file mode 100644 index adf6b8dfd380..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox label symbols (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox label symbols (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox label symbols (fluent.blue.light).png deleted file mode 100644 index b2aed6c37def..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox label symbols (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox validation message (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox validation message (fluent-next.blue.light).png deleted file mode 100644 index d932dbc70717..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox validation message (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox validation message (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox validation message (fluent.blue.light).png deleted file mode 100644 index c34920dcfe6e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox validation message (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with calendar (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with calendar (fluent-next.blue.light).png deleted file mode 100644 index 304ea7fc7bbb..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with calendar (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with calendar (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with calendar (fluent.blue.light).png deleted file mode 100644 index b21ea956ec69..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with calendar (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime (fluent-next.blue.light).png deleted file mode 100644 index d232fd71250d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime (fluent.blue.light).png deleted file mode 100644 index 24d4bd2f91f8..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent-next.blue.light).png deleted file mode 100644 index 9b7cb668b34f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent.blue.light).png deleted file mode 100644 index 4af4741ac7a0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without analog clock (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent-next.blue.light).png deleted file mode 100644 index 81668730386f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent.blue.light).png deleted file mode 100644 index 46239bfb3e28..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateBox/etalons/Datebox with datetime without calendar (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/keyboard.ts b/e2e/testcafe-devextreme/tests/editors/dateBox/keyboard.ts deleted file mode 100644 index 25ce7758f0f9..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateBox/keyboard.ts +++ /dev/null @@ -1,710 +0,0 @@ -import { Selector } from 'testcafe'; -import DateBox from 'devextreme-testcafe-models/dateBox'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { appendElementTo } from '../../../helpers/domUtils'; - -fixture.disablePageReloads`DateBox keyboard navigation` - .page(url(__dirname, '../../container.html')); - -test('DateBox should be closed by press esc key when navigator element in popup is focused, applyValueMode is useButtons', async (t) => { - const dateBox = new DateBox('#container'); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.getPopup().getNavigatorPrevButton().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateBox.option('opened')) - .eql(false); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateBox.getPopup().getNavigatorCaption().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateBox.option('opened')) - .eql(false); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateBox.getPopup().getNavigatorNextButton().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateBox.option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateBox', { - openOnFieldClick: true, - applyValueMode: 'useButtons', -})); - -test('DateBox should be closed by press esc key when views wrapper in popup is focused, applyValueMode is useButtons', async (t) => { - const dateBox = new DateBox('#container'); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateBox.getPopup().getViewsWrapper().focused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateBox.option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateBox', { - openOnFieldClick: true, - applyValueMode: 'useButtons', -})); - -test('DateBox should be closed by press esc key when today/cancel/apply button in popup is focused, applyValueMode is useButtons', async (t) => { - const dateBox = new DateBox('#container'); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateBox.getPopup().getTodayButton().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateBox.option('opened')) - .eql(false); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateBox.getPopup().getApplyButton().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateBox.option('opened')) - .eql(false); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateBox.getPopup().getCancelButton().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateBox.option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateBox', { - openOnFieldClick: true, - applyValueMode: 'useButtons', -})); - -test('dateBox keyboard navigation via `tab` key if applyValueMode is useButtons, input -> prev -> caption -> next -> views -> today -> apply -> cancel -> input', async (t) => { - const dateBox = new DateBox('#dateBox'); - - await t - .click(Selector('#firstFocusableElement')) - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input().focused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorPrevButton().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorCaption().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorNextButton().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getViewsWrapper().focused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getTodayButton().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getApplyButton().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getCancelButton().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.input.focused) - .ok(); -}).before(async () => { - await appendElementTo('#container', 'div', 'firstFocusableElement'); - await appendElementTo('#container', 'div', 'dateBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'First Focusable Element', - }, '#firstFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focusable Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateBox', { - openOnFieldClick: true, - applyValueMode: 'useButtons', - opened: true, - dropDownOptions: { - hideOnOutsideClick: false, - }, - }, '#dateBox'); -}); - -test('dateBox keyboard navigation via `shift+tab` key if applyValueMode is useButtons, input -> cancel -> apply -> today -> views -> next -> caption -> prev -> input', async (t) => { - const dateBox = new DateBox('#dateBox'); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input.focused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getCancelButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getApplyButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getTodayButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getViewsWrapper().focused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorNextButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorCaption().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorPrevButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input().focused) - .ok(); -}).before(async () => { - await appendElementTo('#container', 'div', 'firstFocusableElement'); - await appendElementTo('#container', 'div', 'dateBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'First Focused Element', - }, '#firstFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focused Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateBox', { - openOnFieldClick: true, - applyValueMode: 'useButtons', - opened: false, - }, '#dateBox'); -}); - -test('dateBox keyboard navigation via `tab` key if applyValueMode is instantly, input -> prev -> caption -> next -> views -> input', async (t) => { - const dateBox = new DateBox('#dateBox'); - - await t - .click(Selector('#firstFocusableElement')) - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input().focused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorPrevButton().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorCaption().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorNextButton().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getViewsWrapper().focused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.input.focused) - .ok(); -}).before(async () => { - await appendElementTo('#container', 'div', 'firstFocusableElement'); - await appendElementTo('#container', 'div', 'dateBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'First Focusable Element', - }, '#firstFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focusable Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateBox', { - openOnFieldClick: true, - applyValueMode: 'instantly', - opened: true, - dropDownOptions: { - hideOnOutsideClick: false, - }, - }, '#dateBox'); -}); - -test('dateBox keyboard navigation via `shift+tab` key if applyValueMode is instantly, input -> views -> next -> caption -> prev -> input', async (t) => { - const dateBox = new DateBox('#dateBox'); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input.focused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getViewsWrapper().focused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorNextButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorCaption().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorPrevButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input().focused) - .ok(); -}).before(async () => { - await appendElementTo('#container', 'div', 'firstFocusableElement'); - await appendElementTo('#container', 'div', 'dateBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'First Focused Element', - }, '#firstFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focused Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateBox', { - openOnFieldClick: true, - applyValueMode: 'instantly', - opened: false, - }, '#dateBox'); -}); - -test('dateBox keyboard navigation via `tab` and `shift+tab` when calendar is not focusable', async (t) => { - const dateBox = new DateBox('#dateBox'); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input.focused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getTodayButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input().focused) - .ok(); -}).before(async () => { - await appendElementTo('#container', 'div', 'firstFocusableElement'); - await appendElementTo('#container', 'div', 'dateBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'First Focused Element', - }, '#firstFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focused Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateBox', { - openOnFieldClick: true, - applyValueMode: 'useButtons', - calendarOptions: { - focusStateEnabled: false, - }, - }, '#dateBox'); -}); - -test('dateBox keyboard navigation via `tab` and `shift+tab` when navigator prev button is not focusable', async (t) => { - const dateBox = new DateBox('#dateBox'); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input.focused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.getPopup().getNavigatorCaption().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input().focused) - .ok(); -}).before(async () => { - await appendElementTo('#container', 'div', 'firstFocusableElement'); - await appendElementTo('#container', 'div', 'dateBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'First Focused Element', - }, '#firstFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focused Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateBox', { - openOnFieldClick: true, - min: new Date(), - }, '#dateBox'); -}); - -test('dateBox keyboard navigation via `tab` should close popup when there is no focusable elements', async (t) => { - const dateBox = new DateBox('#container'); - - await t - .click(dateBox.input); - - await t - .expect(dateBox.option('opened')) - .eql(true) - .expect(dateBox.isFocused) - .ok() - .expect(dateBox.input.focused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateBox.option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateBox', { - openOnFieldClick: true, - applyValueMode: 'instantly', - calendarOptions: { - focusStateEnabled: false, - }, -}, '#container')); diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/label.ts b/e2e/testcafe-devextreme/tests/editors/dateBox/label.ts deleted file mode 100644 index ee4b2939837c..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateBox/label.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* eslint-disable no-restricted-syntax */ -import { Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import Guid from 'devextreme/core/guid'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { - appendElementTo, setStyleAttribute, removeStylesheetRulesFromPage, insertStylesheetRulesToPage, - hasHorizontalScroll, -} from '../../../helpers/domUtils'; - -const DATEBOX_CLASS = 'dx-datebox'; - -const stylingModes = ['outlined', 'underlined', 'filled']; -const visibleLabelModes = ['floating', 'static', 'outside']; - -fixture`DateBox_Label` - .page(url(__dirname, '../../container.html')); - -test('Symbol parts in label should not be cropped', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await t - .expect(hasHorizontalScroll(Selector('#container'))) - .notOk(); - - await testScreenshot(t, takeScreenshot, 'Datebox label symbols.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateBox'); - await setStyleAttribute(Selector('#container'), 'box-sizing: border-box; width: 300px; height: 600px; padding: 8px;'); - - for (const stylingMode of stylingModes) { - for (const labelMode of visibleLabelModes) { - const id = `${`dx${new Guid()}`}`; - - await appendElementTo('#container', 'div', id, { }); - - await createWidget('dxDateBox', { - label: 'qwerty QWERTY 1234567890', - stylingMode, - labelMode, - value: new Date(1900, 0, 1), - }, `#${id}`); - } - } -}); - -test('DateBox with buttons container', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'DateBox render with buttons container.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - for (const stylingMode of stylingModes) { - for (const buttons of [ - ['clear'], - ['clear', 'dropDown'], - [{ name: 'custom', location: 'after', options: { icon: 'home' } }, 'clear', 'dropDown'], - ['clear', { name: 'custom', location: 'after', options: { icon: 'home' } }, 'dropDown'], - ['clear', 'dropDown', { name: 'custom', location: 'after', options: { icon: 'home' } }], - ]) { - for (const isValid of [true, false]) { - const id = `${`dx${new Guid()}`}`; - - await appendElementTo('#container', 'div', id, { }); - - await createWidget('dxDateBox', { - value: new Date(2021, 9, 17), - stylingMode, - buttons, - showClearButton: true, - isValid, - }, `#${id}`); - } - } - } - - await insertStylesheetRulesToPage(`#container { display: flex; flex-wrap: wrap; } .${DATEBOX_CLASS} { width: 220px; margin: 2px; }`); -}).after(async () => { - await removeStylesheetRulesFromPage(); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dateBox/validationMessage.ts b/e2e/testcafe-devextreme/tests/editors/dateBox/validationMessage.ts deleted file mode 100644 index 6b51d02cd7d0..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateBox/validationMessage.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import DateBox from 'devextreme-testcafe-models/dateBox'; -import Guid from 'devextreme/core/guid'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { appendElementTo } from '../../../helpers/domUtils'; - -fixture.disablePageReloads`DateBox ValidationMessagePosition` - .page(url(__dirname, '../../container.html')); - -const positions = ['top', 'right', 'bottom', 'left']; - -test.meta({ browserSize: [600, 400] })('DateBox ValidationMessage position is correct', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - // eslint-disable-next-line no-restricted-syntax - for (const id of t.ctx.ids) { - const dateBox = new DateBox(`#${id}`); - await dateBox.option('value', new Date(2022, 6, 14)); - } - - await testScreenshot(t, takeScreenshot, 'Datebox validation message.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async (t) => { - t.ctx.ids = []; - - // eslint-disable-next-line no-restricted-syntax - for (const position of positions) { - const id = `${`dx${new Guid()}`}`; - - await appendElementTo('#container', 'div', id, {}); - - t.ctx.ids.push(id); - await createWidget('dxDateBox', { - elementAttr: { style: 'display: inline-block; margin: 50px 100px 0 0;' }, - width: 150, - height: 40, - validationMessageMode: 'always', - validationMessagePosition: position, - }, `#${id}`); - - await createWidget('dxValidator', { - validationRules: [{ - type: 'range', - max: new Date(1), - message: 'out of range', - }], - }, `#${id}`); - } -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/behavior.ts b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/behavior.ts deleted file mode 100644 index 45d79fefe028..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/behavior.ts +++ /dev/null @@ -1,1548 +0,0 @@ -import { ClientFunction } from 'testcafe'; -import DateRangeBox from 'devextreme-testcafe-models/dateRangeBox'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -fixture.disablePageReloads`DateRangeBox behavior (applyValueMode='instantly')` - .page(url(__dirname, '../../container.html')); - -test('Open by click on startDate input and select date in calendar, value: [null, null]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(21)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), new Date(2021, 9, 17)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(2) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [null, null], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on startDate input and reselect start date in calendar, value: ["2021/09/17", null]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(21)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(2) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(25)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 21)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(3) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [null, null], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on endDate input and select date in calendar, value: [null, null]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(21)) - .expect(dateRangeBox.option('value')) - .eql([null, new Date(2021, 9, 17)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), new Date(2021, 9, 17)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(2); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(27)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), new Date(2021, 9, 23)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(3); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [null, null], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on startDate input and select date in calendar < endDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on startDate input and select date in calendar > startDate, value: ["2021/09/17", "2021/09/28"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(25)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 21), new Date(2021, 9, 28)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 28)], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on startDate input and select date in calendar > endDate, value: ["2021/09/17", "2021/09/21"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(30)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 26), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(31)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 27), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(2); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(32)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 28), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(3); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 21)], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on endDate input and select date in calendar > endDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(30)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 26)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on endDate input and select date in calendar < endDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(25)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 21)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on endDate input and select date in calendar < startDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(9)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 5), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(2); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(8)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 4), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(3); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 4), new Date(2021, 9, 6)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(4); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on endDate input and select date in calendar = endDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(28)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}).after(async () => { - await ClientFunction(() => { - delete (window as any).onValueChangedCounter; - })(); -}); - -test('Open by click on endDate input and select date in calendar = startDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(21)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 17)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on startDate input and select date in calendar = startDate -> endDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(21)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(28)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Value in calendar should be updated by click on clear button if popup is open', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .click(dateRangeBox.clearButton) - .expect(dateRangeBox.option('value')) - .eql([null, null]) - .expect(dateRangeBox.getCalendar().option('value')) - .eql([null, null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - opened: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - showClearButton: true, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Value in calendar should be updated after change start date value by keyboard and click on endDate input if popup is open', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('backspace') - .typeText(dateRangeBox.getStartDateBox().input, '0'); - - await t - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(dateRangeBox.getCalendar().option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.option('value')) - .eql([new Date(2020, 9, 17), new Date(2021, 9, 24)]) - .expect(dateRangeBox.getCalendar().option('value')) - .eql([new Date(2020, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - opened: false, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - showClearButton: true, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Value in calendar should be updated after change start date value by keyboard and press `tab` if popup is open', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('backspace') - .pressKey('backspace') - .typeText(dateRangeBox.getStartDateBox().input, '19'); - - await t - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(dateRangeBox.getCalendar().option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.option('value')) - .eql([new Date(2019, 9, 17), new Date(2021, 9, 24)]) - .expect(dateRangeBox.getCalendar().option('value')) - .eql([new Date(2019, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .typeText(dateRangeBox.getEndDateBox().input, '10/24/2023') - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.option('value')) - .eql([new Date(2019, 9, 17), new Date(2023, 9, 24)]) - .expect(dateRangeBox.getCalendar().option('value')) - .eql([new Date(2019, 9, 17), new Date(2023, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(2); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - opened: false, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - showClearButton: true, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -fixture.disablePageReloads`DateRangeBox behavior (applyValueMode='useButtons')` - .page(url(__dirname, '../../container.html')); - -test('Value should be saved after select range in calendar and click on apply button, value: [null, null]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('value')) - .eql([null, null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(21)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.option('value')) - .eql([null, null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), new Date(2021, 9, 17)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [null, null], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Value should not be saved after select range and click on cancel button', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .click(dateRangeBox.getCalendarCell(21)) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getCancelButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.option('value')) - .eql([null, null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [null, null], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on startDate input and reselect start date in calendar, value: [null, null]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([null, null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(21)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(2) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok(); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [null, null], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on endDate input and select date in calendar, value: [null, null]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(21)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([null, null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([null, null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getCalendarCell(27)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([null, null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), new Date(2021, 9, 23)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [null, null], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on startDate input and select date in calendar < endDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 6), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on startDate input and select date in calendar > startDate, value: ["2021/09/17", "2021/09/28"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(25)) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 28)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 21), new Date(2021, 9, 28)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 28)], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on startDate input and select date in calendar > endDate, value: ["2021/09/17", "2021/09/21"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(30)) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 21)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(31)) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 21)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(32)) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 21)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 28), null]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 21)], - openOnFieldClick: true, - width: 500, - applyValueMode: 'useButtons', - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on endDate input and select date in calendar > endDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(30)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 26)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on endDate input and select date in calendar < endDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(25)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 21)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on endDate input and select date in calendar < startDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getCalendarCell(9)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getCalendarCell(8)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 4), new Date(2021, 9, 6)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on endDate input and select date in calendar = endDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(28)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}).after(async () => { - await ClientFunction(() => { - delete (window as any).onValueChangedCounter; - })(); -}); - -test('Open by click on endDate input and select date in calendar = startDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getCalendarCell(21)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 17)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); - -test('Open by click on startDate input and select date in calendar = startDate -> endDate, value: ["2021/09/17", "2021/09/24"]', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .click(dateRangeBox.getCalendarCell(21)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getCalendarCell(28)) - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getPopup().getApplyButton().element) - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 9, 17), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onValueChangedCounter)()) - .eql(0); -}).before(async () => { - await ClientFunction(() => { - (window as any).onValueChangedCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 24)], - openOnFieldClick: true, - applyValueMode: 'useButtons', - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - onValueChanged() { - ((window as any).onValueChangedCounter as number) += 1; - }, - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/calendar.ts b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/calendar.ts deleted file mode 100644 index 667054f6326f..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/calendar.ts +++ /dev/null @@ -1,748 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import DateRangeBox from 'devextreme-testcafe-models/dateRangeBox'; -import { - appendElementTo, - setAttribute, -} from '../../../helpers/domUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; - -const STATE_HOVER_CLASS = 'dx-state-hover'; - -fixture.disablePageReloads`DateRangeBox range selection` - .page(url(__dirname, '../../container.html')); - -test('DateRangeBox calendar appearance after change rtl mode in runtime', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await dateRangeBox.option('rtlEnabled', true); - - await testScreenshot(t, takeScreenshot, 'DRB appearance after change rtl mode in runtime.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;'); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 10, 30)], - openOnFieldClick: true, - opened: true, - }, '#dateRangeBox'); -}); - -test('Cells classes after hover cells, value: [null, null]', async (t) => { - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - const calendar = dateRangeBox.getCalendar(); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(0) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(0) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(0) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); - - await t - .hover(calendar.getCellByDate('2021/10/12')); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(0) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(0) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(0) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); - - await t - .hover(calendar.getCellByDate('2021/10/25')); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(0) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(0) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(0) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px;'); - - return createWidget('dxDateRangeBox', { - value: [null, null], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - }, '#dateRangeBox'); -}); - -test('Cells classes after hover date < startDate & date > startDate, currentSelection: startDate, value: [new Date(2021, 9, 17), null]', async (t) => { - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - const calendar = dateRangeBox.getCalendar(); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(0) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(1) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(0) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); - - await t - .hover(calendar.getCellByDate('2021/10/12')); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(0) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(1) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(0) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); - - await t - .hover(calendar.getCellByDate('2021/10/25')); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(0) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(1) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(0) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px;'); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), null], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - }, '#dateRangeBox'); -}); - -test('Cells classes after hover date < startDate, currentSelection: endDate, value: [new Date(2021, 9, 17), null]', async (t) => { - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - const calendar = dateRangeBox.getCalendar(); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(0) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(1) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(0) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); - - await t - .hover(calendar.getCellByDate('2021/10/12')); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(0) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(1) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(0) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px;'); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), null], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - }, '#dateRangeBox'); -}); - -test('Cells classes after hover and select date > startDate, currentSelection: endDate, value: [new Date(2021, 9, 17), null]', async (t) => { - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - const calendar = dateRangeBox.getCalendar(); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(0) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(1) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(0) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); - - await t - .hover(calendar.getCellByDate('2021/10/24')); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(0) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(1) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(0) - .expect(calendar.getHoveredRangeCells().count) - .eql(8) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(1) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(1); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;'); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), null], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - }, '#dateRangeBox'); -}); - -test('Selected range if endDate = startDate, currentSelection: startDate', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - const calendar = dateRangeBox.getCalendar(); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(1) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(1) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(1) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); - - await testScreenshot(t, takeScreenshot, 'DRB range, endDate = startDate.png', { element: '#container' }); - - await t - .hover(calendar.getCellByDate('2021/10/18')); - - await t - .expect(calendar.getSelectedRangeCells().count) - .eql(1) - .expect(calendar.getSelectedRangeStartCell().count) - .eql(1) - .expect(calendar.getSelectedRangeEndCell().count) - .eql(1) - .expect(calendar.getHoveredRangeCells().count) - .eql(0) - .expect(calendar.getHoveredRangeStartCell().count) - .eql(0) - .expect(calendar.getHoveredRangeEndCell().count) - .eql(0); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;'); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 18), new Date(2021, 9, 18)], - openOnFieldClick: true, - width: 500, - calendarOptions: { - currentDate: new Date(2021, 9, 19), - }, - }, '#dateRangeBox'); -}); - -test('Start date cell in selected range', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - const calendar = dateRangeBox.getCalendar(); - - await t - .hover(calendar.getCellByDate('2021/10/01')); - - await testScreenshot(t, takeScreenshot, 'DRB range, startDate is start in row, hover is start in view.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2021/10/31')) - .click(dateRangeBox.getStartDateBox().input) - .hover(calendar.getCellByDate('2021/10/16')); - - await testScreenshot(t, takeScreenshot, 'DRB range, startDate is end in view & start row, hover is end row.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2021/10/23')) - .click(dateRangeBox.getStartDateBox().input) - .hover(calendar.getCellByDate('2021/10/03')); - - await testScreenshot(t, takeScreenshot, 'DRB range, startDate is end cell row, hover is start in row.png', { element: '#container' }); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 8, 1)); - - await t - .click(calendar.getCellByDate('2021/10/01')) - .click(dateRangeBox.getStartDateBox().input); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 8, 1)); - - await t - .hover(calendar.getCellByDate('2021/09/30')); - - await testScreenshot(t, takeScreenshot, 'DRB range, startDate is start in view, hover is end in view.png', { element: '#container' }); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 8, 1)); - - await t - .click(calendar.getCellByDate('2021/09/30')) - .click(dateRangeBox.getStartDateBox().input) - .hover(calendar.getCellByDate('2021/09/15')); - - await testScreenshot(t, takeScreenshot, 'DRB range, startDate is end in view, hover inside row.png', { element: '#container' }); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 7, 1)); - - await t - .click(calendar.getCellByDate('2021/09/15')) - .click(dateRangeBox.getStartDateBox().input); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 7, 1)); - - await t - .hover(calendar.getCellByDate('2021/08/01')); - - await testScreenshot(t, takeScreenshot, 'DRB range, startDate inside row, hover is start in view & row.png', { element: '#container' }); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 6, 1)); - - await t - .click(calendar.getCellByDate('2021/08/01')) - .click(dateRangeBox.getStartDateBox().input); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 6, 1)); - - await t - .hover(calendar.getCellByDate('2021/07/31')); - - await testScreenshot(t, takeScreenshot, 'DRB range, startDate is start view & row, hover is end view & row.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2021/07/31')) - .click(dateRangeBox.getStartDateBox().input); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 6, 1)); - - await t - .hover(calendar.getCellByDate('2021/07/02')); - - await testScreenshot(t, takeScreenshot, 'DRB range, startDate is end in view & row, hover inside row.png', { element: '#container' }); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 4, 1)); - - await t - .hover(calendar.getCellByDate('2021/05/01')); - - await testScreenshot(t, takeScreenshot, 'DRB range, hover is start in view & end cell row.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2021/05/01')) - .click(dateRangeBox.getStartDateBox().input); - - await testScreenshot(t, takeScreenshot, 'DRB range, startDate cell is start in view & end cell row.png', { element: '#container' }); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 1, 1)); - - await t - .hover(calendar.getCellByDate('2021/02/28')); - - await testScreenshot(t, takeScreenshot, 'DRB range, hover is end in view & start in row.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;'); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 10, 6)], - openOnFieldClick: true, - width: 500, - }, '#dateRangeBox'); -}); - -test('End date cell in selected range', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - const calendar = dateRangeBox.getCalendar(); - - await t - .click(calendar.getCellByDate('2021/10/24')) - .click(dateRangeBox.getEndDateBox().input) - .hover(calendar.getCellByDate('2021/10/31')); - - await testScreenshot(t, takeScreenshot, 'DRB range, endDate is start in row, hover is end view & start row.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2021/10/25')) - .click(dateRangeBox.getEndDateBox().input) - .hover(calendar.getCellByDate('2021/11/01')); - - await testScreenshot(t, takeScreenshot, 'DRB range, endDate is cell inside row, hover is start in view.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2021/10/30')) - .click(dateRangeBox.getEndDateBox().input) - .hover(calendar.getCellByDate('2021/11/30')); - - await testScreenshot(t, takeScreenshot, 'DRB range, endDate is end cell row, hover is end in view.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2021/10/31')) - .click(dateRangeBox.getEndDateBox().input) - .hover(calendar.getCellByDate('2021/11/21')); - - await testScreenshot(t, takeScreenshot, 'DRB range, endDate is end in view & start row, hover is start row.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2021/11/01')) - .click(dateRangeBox.getEndDateBox().input) - .hover(calendar.getCellByDate('2021/11/21')); - - await testScreenshot(t, takeScreenshot, 'DRB range, endDate is start in view, hover is end in row.png', { element: '#container' }); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 11, 15)); - - await t - .click(calendar.getCellByDate('2021/12/31')) - .click(dateRangeBox.getEndDateBox().input); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 12, 15)); - - await t - .hover(calendar.getCellByDate('2022/01/01')); - - await testScreenshot(t, takeScreenshot, 'DRB range, endDate is end in view, hover is start view & end row.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2022/01/01')) - .click(dateRangeBox.getEndDateBox().input); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 12, 15)); - - await t - .hover(calendar.getCellByDate('2022/01/25')); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 12, 15)); - - await testScreenshot(t, takeScreenshot, 'DRB range, endDate is start view & end cell row, hover inside row.png', { element: '#container' }); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2022, 3, 15)); - - await t - .hover(calendar.getCellByDate('2022/04/30')); - - await testScreenshot(t, takeScreenshot, 'DRB range, hover is end in view & end cell row.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2022/04/30')) - .click(dateRangeBox.getEndDateBox().input); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2022, 2, 15)); - await testScreenshot(t, takeScreenshot, 'DRB range, endDate is end in view & end cell row.png', { element: '#container' }); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2022, 3, 15)); - - await t - .hover(calendar.getCellByDate('2022/05/01')); - - await testScreenshot(t, takeScreenshot, 'DRB range, hover is start in view & start in row.png', { element: '#container' }); - - await t - .click(calendar.getCellByDate('2022/05/01')) - .click(dateRangeBox.getEndDateBox().input); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2022, 3, 15)); - - await testScreenshot(t, takeScreenshot, 'DRB range, endDate is start in view & start in row.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;'); - - return createWidget('dxDateRangeBox', { - value: [new Date(2021, 9, 17), new Date(2021, 9, 23)], - openOnFieldClick: true, - width: 500, - }, '#dateRangeBox'); -}); - -test('Cell in range', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2023, 2, 1)); - - await testScreenshot(t, takeScreenshot, 'DRB range cells, start in view and end in row & vise versa.png', { element: '#container' }); - - await dateRangeBox.getCalendar().option('currentDate', new Date(2021, 6, 1)); - - await testScreenshot(t, takeScreenshot, 'DRB range cells, start in view and in row & end in view and in row.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;'); - - return createWidget('dxDateRangeBox', { - value: [new Date(2020, 2, 2), new Date(2024, 2, 2)], - openOnFieldClick: true, - opened: true, - width: 500, - }, '#dateRangeBox'); -}); - -test('Disabled dates on start date select (disableOutOfRangeSelection: true)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - const calendar = dateRangeBox.getCalendar(); - - await t - .click(calendar.getCellByDate('2020/02/20')); - - await testScreenshot(t, takeScreenshot, 'DRB disabled dates before start date select.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;'); - - return createWidget('dxDateRangeBox', { - width: 500, - disableOutOfRangeSelection: true, - calendarOptions: { - currentDate: new Date('2020/02/20'), - }, - }, '#dateRangeBox'); -}); - -test('Disabled dates on end date select (disableOutOfRangeSelection: true)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - const calendar = dateRangeBox.getCalendar(); - - await t - .click(calendar.getCellByDate('2020/02/22')); - - await testScreenshot(t, takeScreenshot, 'DRB disabled dates after end date select.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;'); - - return createWidget('dxDateRangeBox', { - width: 500, - disableOutOfRangeSelection: true, - calendarOptions: { - currentDate: new Date('2020/02/20'), - }, - }, '#dateRangeBox'); -}); - -test('Disabled dates on inputs focus (disableOutOfRangeSelection: true)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getStartDateBox().input) - .hover(dateRangeBox.getStartDateBox().input); - - await testScreenshot(t, takeScreenshot, 'DRB disabled dates on popup opening.png', { element: '#container' }); - - await t - .click(dateRangeBox.getEndDateBox().input) - .hover(dateRangeBox.getEndDateBox().input); - - await testScreenshot(t, takeScreenshot, 'DRB disabled dates on end date input focus.png', { element: '#container' }); - - await t - .click(dateRangeBox.getStartDateBox().input) - .hover(dateRangeBox.getStartDateBox().input); - - await testScreenshot(t, takeScreenshot, 'DRB disabled dates on start date input focus.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;'); - - return createWidget('dxDateRangeBox', { - value: [new Date('2020/02/20'), new Date('2020/02/22')], - width: 500, - disableOutOfRangeSelection: true, - }, '#dateRangeBox'); -}); - -test(`Hovered cell should have "${STATE_HOVER_CLASS}" class after one date selected (disableOutOfRangeSelection=true)`, async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - const calendar = dateRangeBox.getCalendar(); - - await t - .click(calendar.getCellByDate('2020/02/20')); - - const targetCell = calendar.getView().getCellByDate(new Date('2020/02/22')); - await t - .hover(targetCell) - .expect(targetCell.hasClass(STATE_HOVER_CLASS)) - .eql(true); -}).before(async () => createWidget('dxDateRangeBox', { - disableOutOfRangeSelection: true, - calendarOptions: { - currentDate: new Date('2020/02/20'), - }, -}, '#container')); - -test('Dates selection with focusStateEnabled=false', async (t) => { - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - const calendar = dateRangeBox.getCalendar(); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .click(calendar.getCellByDate('2020/02/10')); - - await t - .click(calendar.getCellByDate('2020/02/25')); - - const expectedStartDate = new Date('2020/02/10'); - const expectedEndDate = new Date('2020/02/25'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.option('value')) - .eql([expectedStartDate, expectedEndDate]); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - - return createWidget('dxDateRangeBox', { - value: [new Date('2020/02/20'), new Date('2020/02/22')], - width: 500, - focusStateEnabled: false, - }, '#dateRangeBox'); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/common.ts b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/common.ts deleted file mode 100644 index 10599f45f495..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/common.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* eslint-disable no-restricted-syntax */ -import { Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import Guid from 'devextreme/core/guid'; -import DateRangeBox from 'devextreme-testcafe-models/dateRangeBox'; -import type { Properties as DateRangeBoxProperties } from 'devextreme/ui/date_range_box.d'; -import type { Properties as DropDownEditorProperties } from 'devextreme/ui/drop_down_editor/ui.drop_down_editor.d'; -import type { EditorStyle, LabelMode } from 'devextreme/common'; -import { - insertStylesheetRulesToPage, - appendElementTo, - setAttribute, - setClassAttribute, -} from '../../../helpers/domUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; - -const DATERANGEBOX_CLASS = 'dx-daterangebox'; -const DROP_DOWN_EDITOR_ACTIVE_CLASS = 'dx-dropdowneditor-active'; -const FOCUSED_STATE_CLASS = 'dx-state-focused'; -const HOVER_STATE_CLASS = 'dx-state-hover'; -const READONLY_STATE_CLASS = 'dx-state-readonly'; -const DISABLED_STATE_CLASS = 'dx-state-disabled'; - -const stylingModes: EditorStyle[] = ['outlined', 'underlined', 'filled']; -const labelModes: LabelMode[] = ['static', 'floating', 'hidden', 'outside']; - -fixture.disablePageReloads`DateRangeBox render` - .page(url(__dirname, '../../container.html')); - -const TEST_VALUE = [new Date(2021, 9, 17, 16, 34), new Date(2021, 9, 18, 16, 34)]; - -const createDateRangeBox = async ( - options?: DateRangeBoxProperties, - state?: string, -): Promise => { - const id = `${`dx${new Guid()}`}`; - - await appendElementTo('#container', 'div', id, { }); - - const config: any = { - width: 500, - labelMode: 'static', - endDateLabel: 'static', - startDateLabel: 'qwertyQWERTYg', - showClearButton: true, - ...options, - }; - - await createWidget('dxDateRangeBox', config, `#${id}`); - - if (state) { - await setClassAttribute(Selector(`#${id}`), state); - await setClassAttribute(Selector(`#${id} .dx-start-datebox`), state); - } - - return id; -}; - -test('DateRangeBox styles', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'DateRangeBox styles.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await insertStylesheetRulesToPage(`.${DATERANGEBOX_CLASS} { display: inline-flex; margin: 5px; }`); - - for (const stylingMode of stylingModes) { - for (const state of [ - DROP_DOWN_EDITOR_ACTIVE_CLASS, - FOCUSED_STATE_CLASS, - HOVER_STATE_CLASS, - READONLY_STATE_CLASS, - DISABLED_STATE_CLASS, - ] as any[] - ) { - await createDateRangeBox({ value: TEST_VALUE, stylingMode }, state); - } - } - - await createDateRangeBox({ value: TEST_VALUE, rtlEnabled: true }); - await createDateRangeBox({ value: TEST_VALUE, isValid: false }); -}); - -test('DateRangeBox with buttons container', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'DateRangeBox with buttons container.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await insertStylesheetRulesToPage('#container { display: flex; flex-wrap: wrap; gap: 4px; }'); - - const testButtons: DropDownEditorProperties['buttons'][] = [ - ['clear'], - [{ name: 'custom', location: 'after', options: { icon: 'home' } }, 'clear', 'dropDown'], - ['clear', { name: 'custom', location: 'after', options: { icon: 'home' } }, 'dropDown'], - [{ name: 'custom', location: 'before', options: { icon: 'home' } }, 'clear', 'dropDown'], - ]; - - for (const buttons of testButtons) { - await createDateRangeBox({ - value: TEST_VALUE, - buttons, - }); - await createDateRangeBox({ - value: TEST_VALUE, - buttons, - rtlEnabled: true, - }); - } -}); - -labelModes.forEach((labelMode) => { - test('Custom placeholders and labels appearance', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const dateRangeBox = new DateRangeBox(`#${t.ctx.id}`); - - await testScreenshot(t, takeScreenshot, `Placeholder and label by default labelMode=${labelMode}.png`, { element: '#container' }); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await testScreenshot(t, takeScreenshot, `Placeholder and label on start date input focus labelMode=${labelMode}.png`, { element: '#container' }); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await testScreenshot(t, takeScreenshot, `Placeholder and label on end date input labelMode=${labelMode} focus.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async (t) => { - await setAttribute('#container', 'style', 'width: 800px; height: 300px; padding-top: 10px;'); - - t.ctx.id = await createDateRangeBox({ - labelMode, - width: 600, - openOnFieldClick: false, - startDateLabel: 'first date', - endDateLabel: 'second date', - startDatePlaceholder: 'enter start date', - endDatePlaceholder: 'enter end date', - }); - await appendElementTo('#container', 'div', t.ctx.id); - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent-next.blue.light).png deleted file mode 100644 index 6a55d46b32a5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent.blue.light).png deleted file mode 100644 index c7358b83000c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB appearance after change rtl mode in runtime (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent-next.blue.light).png deleted file mode 100644 index 119d332ac424..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent.blue.light).png deleted file mode 100644 index 76b2bb579872..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates after end date select (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent-next.blue.light).png deleted file mode 100644 index c3ae14d1049e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent.blue.light).png deleted file mode 100644 index d3c629db2583..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates before start date select (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent-next.blue.light).png deleted file mode 100644 index 3cf6b94cfb25..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent.blue.light).png deleted file mode 100644 index baa4541617dd..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on end date input focus (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent-next.blue.light).png deleted file mode 100644 index 5181bb5ba330..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent.blue.light).png deleted file mode 100644 index 6d139d3e90b7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on popup opening (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent-next.blue.light).png deleted file mode 100644 index d93f3a774074..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent.blue.light).png deleted file mode 100644 index 74e0b1e2142a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB disabled dates on start date input focus (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent-next.blue.light).png deleted file mode 100644 index 3a4e3c720e36..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent.blue.light).png deleted file mode 100644 index 7558abb191b8..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and end in row & vise versa (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent-next.blue.light).png deleted file mode 100644 index 579d9a1268fd..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent.blue.light).png deleted file mode 100644 index cb69828778ee..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range cells, start in view and in row & end in view and in row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent-next.blue.light).png deleted file mode 100644 index 696f0f32c006..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent.blue.light).png deleted file mode 100644 index 597f5fdf7b79..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate = startDate (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent-next.blue.light).png deleted file mode 100644 index 58f737f20fe4..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent.blue.light).png deleted file mode 100644 index 475c8777c12e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is cell inside row, hover is start in view (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent-next.blue.light).png deleted file mode 100644 index b5117de9f16e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent.blue.light).png deleted file mode 100644 index d3da94ca7d47..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end cell row, hover is end in view (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent-next.blue.light).png deleted file mode 100644 index 75eba245ee16..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent.blue.light).png deleted file mode 100644 index ca8ae00241fa..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & end cell row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent-next.blue.light).png deleted file mode 100644 index 00aae7271b34..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent.blue.light).png deleted file mode 100644 index dcd676859c55..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view & start row, hover is start row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent-next.blue.light).png deleted file mode 100644 index 31f8e1b2e1d9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent.blue.light).png deleted file mode 100644 index 1733397b7aba..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is end in view, hover is start view & end row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent-next.blue.light).png deleted file mode 100644 index 516125a24edf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent.blue.light).png deleted file mode 100644 index 5519b285b8e6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in row, hover is end view & start row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent-next.blue.light).png deleted file mode 100644 index 2c911df89f3e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent.blue.light).png deleted file mode 100644 index 3e7561405de9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view & start in row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent-next.blue.light).png deleted file mode 100644 index 8756d3f5e4ee..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent.blue.light).png deleted file mode 100644 index 5ddff50a85f9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start in view, hover is end in row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent-next.blue.light).png deleted file mode 100644 index f6da6b521bd9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent.blue.light).png deleted file mode 100644 index 2731de4c62c3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, endDate is start view & end cell row, hover inside row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent-next.blue.light).png deleted file mode 100644 index b879fff53fa7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent.blue.light).png deleted file mode 100644 index 13e87ee789c3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & end cell row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent-next.blue.light).png deleted file mode 100644 index b7b44382b424..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent.blue.light).png deleted file mode 100644 index 2a874aec0bf2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is end in view & start in row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent-next.blue.light).png deleted file mode 100644 index 343c56cdf92c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent.blue.light).png deleted file mode 100644 index 0455eb1abf91..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & end cell row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent-next.blue.light).png deleted file mode 100644 index 79a70c6dcc63..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent.blue.light).png deleted file mode 100644 index 0ba4fcacba3d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, hover is start in view & start in row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent-next.blue.light).png deleted file mode 100644 index 9b057de7e005..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent.blue.light).png deleted file mode 100644 index 18ec654d5473..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate cell is start in view & end cell row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent-next.blue.light).png deleted file mode 100644 index caa3f2a1ed1c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent.blue.light).png deleted file mode 100644 index ac4a8a3588bc..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate inside row, hover is start in view & row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent-next.blue.light).png deleted file mode 100644 index ff7a8c66f549..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent.blue.light).png deleted file mode 100644 index 8ed3f4d4b88d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end cell row, hover is start in row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent-next.blue.light).png deleted file mode 100644 index 30ebe493d02f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent.blue.light).png deleted file mode 100644 index 69c38bb1f3e1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & row, hover inside row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent-next.blue.light).png deleted file mode 100644 index 5bdeb297f8cb..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent.blue.light).png deleted file mode 100644 index c16efb06d056..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view & start row, hover is end row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent-next.blue.light).png deleted file mode 100644 index 25fc1ea1f80a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent.blue.light).png deleted file mode 100644 index ed80c4885de2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is end in view, hover inside row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent-next.blue.light).png deleted file mode 100644 index 382fcd87f948..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent.blue.light).png deleted file mode 100644 index 952920bc444b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in row, hover is start in view (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent-next.blue.light).png deleted file mode 100644 index 647f68ed384b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent.blue.light).png deleted file mode 100644 index 516c36048a0b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start in view, hover is end in view (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent-next.blue.light).png deleted file mode 100644 index 52d93aef59fb..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent.blue.light).png deleted file mode 100644 index 7c6cb965fc05..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DRB range, startDate is start view & row, hover is end view & row (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent-next.blue.light).png deleted file mode 100644 index aa2209217e6f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent.blue.light).png deleted file mode 100644 index 5cbbcb0fa972..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox styles (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent-next.blue.light).png deleted file mode 100644 index c4da54caae46..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent.blue.light).png deleted file mode 100644 index 8e61ec53e6b9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/DateRangeBox with buttons container (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent-next.blue.light).png deleted file mode 100644 index 23a30948853b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent.blue.light).png deleted file mode 100644 index 1cab6f61395f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=floating (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent-next.blue.light).png deleted file mode 100644 index 14f1c3cf487e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent.blue.light).png deleted file mode 100644 index fed13195f9f7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=hidden (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent-next.blue.light).png deleted file mode 100644 index eaaa35571709..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent.blue.light).png deleted file mode 100644 index cbca544275b3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=outside (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent-next.blue.light).png deleted file mode 100644 index caeef9f81da5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent.blue.light).png deleted file mode 100644 index f88e8c51177b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label by default labelMode=static (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent-next.blue.light).png deleted file mode 100644 index 14b5f678dfbc..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent.blue.light).png deleted file mode 100644 index 72d02a09bec4..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=floating focus (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent-next.blue.light).png deleted file mode 100644 index 2b22914acc7e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent.blue.light).png deleted file mode 100644 index 706641b3d11a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=hidden focus (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent-next.blue.light).png deleted file mode 100644 index a3efb55b61c7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent.blue.light).png deleted file mode 100644 index 299e2e29b9f5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=outside focus (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent-next.blue.light).png deleted file mode 100644 index 14b5f678dfbc..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent.blue.light).png deleted file mode 100644 index 72d02a09bec4..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on end date input labelMode=static focus (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent-next.blue.light).png deleted file mode 100644 index 12bbf088f788..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent.blue.light).png deleted file mode 100644 index f98f98b06c08..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=floating (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent-next.blue.light).png deleted file mode 100644 index 8d4e909a65aa..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent.blue.light).png deleted file mode 100644 index 327c38986723..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=hidden (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent-next.blue.light).png deleted file mode 100644 index 63e9c8bc442d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent.blue.light).png deleted file mode 100644 index 33ea21b76575..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=outside (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent-next.blue.light).png deleted file mode 100644 index 12bbf088f788..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent.blue.light).png deleted file mode 100644 index f98f98b06c08..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/Placeholder and label on start date input focus labelMode=static (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent-next.blue.light).png deleted file mode 100644 index b6a60caf20ba..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent.blue.light).png deleted file mode 100644 index 8a8016864895..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox after opening (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent-next.blue.light).png deleted file mode 100644 index 56c569d50ef6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent.blue.light).png deleted file mode 100644 index d313a7a3b9d4..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/etalons/The validation message overlay position for DateRangeBox before opening (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/focus.ts b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/focus.ts deleted file mode 100644 index f1bd2c85ca43..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/focus.ts +++ /dev/null @@ -1,730 +0,0 @@ -import { ClientFunction, Selector } from 'testcafe'; -import DateRangeBox from 'devextreme-testcafe-models/dateRangeBox'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { addFocusableElementBefore } from '../../../helpers/domUtils'; - -fixture.disablePageReloads`DateRangeBox focus state` - .page(url(__dirname, '../../container.html')); - -test('DateRangeBox & DateBoxes should have focus class if inputs are focused by tab', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .pressKey('tab') - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .pressKey('tab') - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, - width: 500, -})); - -test('DateRangeBox & DateBoxes should have focus class if inputs are focused by click', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .click(dateRangeBox.getEndDateBox().input) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(Selector('body'), { offsetX: -50 }) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, - width: 500, -})); - -test('DateRangeBox & Start DateBox should have focus class after click on drop down button', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.dropDownButton) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, -})); - -test('DateRangeBox & StartDateBox should be focused if dateRangeBox open by click on drop down button and endDateBox was focused', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().element); - - await t - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.dropDownButton); - - await t - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, -})); - -test('onFocusIn should be called only after first click on drop down button', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.element, { offsetX: -20, offsetY: -20 }); - - await t - .expect(dateRangeBox.option('opened')) - .ok(); - - await t - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .click(dateRangeBox.dropDownButton); - - await t - .expect(dateRangeBox.option('opened')) - .notOk() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .click(dateRangeBox.element, { offsetX: -20, offsetY: -20 }); - - await t - .expect(dateRangeBox.option('opened')) - .ok() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); -}).before(async () => { - await ClientFunction(() => { - (window as any).onFocusInCounter = 0; - (window as any).onFocusOutCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, - onFocusIn() { - ((window as any).onFocusInCounter as number) += 1; - }, - onFocusOut() { - ((window as any).onFocusOutCounter as number) += 1; - }, - }); -}).after(async () => { - await ClientFunction(() => { - delete (window as any).onFocusInCounter; - delete (window as any).onFocusOutCounter; - })(); -}); - -test('onFocusIn should be called only on focus of startDate input', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - const focusableElementBeforeDateRangeBox = Selector('#focusable-start'); - - await addFocusableElementBefore('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .pressKey('tab'); - - await t - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .ok() - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 8, 8), new Date(2021, 9, 24)]) - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .expect(dateRangeBox.option('opened')) - .ok() - .click(dateRangeBox.getCalendarCell(20)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 8, 8), new Date(2021, 8, 18)]) - .expect(dateRangeBox.option('opened')) - .notOk() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .pressKey('shift+tab') - .wait(100) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .pressKey('shift+tab') - .wait(100) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(focusableElementBeforeDateRangeBox.focused) - .ok() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onFocusInCounter = 0; - (window as any).onFocusOutCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: [new Date('2021/09/17'), new Date('2021/10/24')], - openOnFieldClick: true, - width: 500, - onFocusIn() { - ((window as any).onFocusInCounter as number) += 1; - }, - onFocusOut() { - ((window as any).onFocusOutCounter as number) += 1; - }, - }); -}).after(async () => { - await ClientFunction(() => { - delete (window as any).onFocusInCounter; - delete (window as any).onFocusOutCounter; - })(); -}); - -test('Click by separator element should focus DateRangeBox or leave active input focused without call onFocusIn event handler', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.separator); - - await t - .expect(dateRangeBox.option('opened')) - .notOk() - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .click(dateRangeBox.separator); - - await t - .expect(dateRangeBox.option('opened')) - .notOk() - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .ok() - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .click(dateRangeBox.separator); - - await t - .expect(dateRangeBox.option('opened')) - .ok() - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(0); - - await t - .click(Selector('body'), { offsetX: -50 }) - .expect(dateRangeBox.option('opened')) - .notOk() - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(ClientFunction(() => (window as any).onFocusInCounter)()) - .eql(1) - .expect(ClientFunction(() => (window as any).onFocusOutCounter)()) - .eql(1); -}).before(async () => { - await ClientFunction(() => { - (window as any).onFocusInCounter = 0; - (window as any).onFocusOutCounter = 0; - })(); - - return createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - width: 500, - onFocusIn() { - ((window as any).onFocusInCounter as number) += 1; - }, - onFocusOut() { - ((window as any).onFocusOutCounter as number) += 1; - }, - }); -}).after(async () => { - await ClientFunction(() => { - delete (window as any).onFocusInCounter; - delete (window as any).onFocusOutCounter; - })(); -}); - -test('EndDateBox should be stay focused after close popup by click on drop down button', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.element, { offsetX: -20, offsetY: -20 }); - - await t - .expect(dateRangeBox.option('opened')) - .ok(); - - await t - .click(dateRangeBox.getCalendarCell(10)) - .expect(dateRangeBox.option('value')) - .eql([new Date(2021, 8, 8), new Date(2021, 9, 24)]) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.dropDownButton); - - await t - .expect(dateRangeBox.option('opened')) - .notOk() - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => createWidget('dxDateRangeBox', { - value: [new Date('2021/09/17'), new Date('2021/10/24')], - openOnFieldClick: false, -})); - -test('DateRangeBox & StartDateBox should be focused after click on clear button', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().element); - - await t - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.clearButton); - - await t - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - showClearButton: true, - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, -})); - -test('DateRangeBox & StartDateBox should be focused and stay opened after click on clear button when popup is opened', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().element); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .click(dateRangeBox.clearButton); - - await t.wait(500); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - showClearButton: true, - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, -}, '#container')); - -test('DateRangeBox & StartDateBox should be focused after click on clear button', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input) - .click(dateRangeBox.dropDownButton); - - await t - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.clearButton); - - await t - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - showClearButton: true, - value: [null, '2021/10/24'], - openOnFieldClick: false, - opened: true, -})); - -test('DateRangeBox & StartDateBox should be focused if startDateBox open by keyboard, alt+down, alt+up', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .pressKey('alt+down'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .pressKey('alt+up'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, -})); - -test('DateRangeBox & StartDateBox should be focused if endDateBox open and close by keyboard, alt+down, alt+up', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .pressKey('alt+down'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .pressKey('alt+up'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, -})); - -test('Opened dateRangeBox should not be closed after click on inputs, openOnFieldClick: true', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - opened: true, -})); - -test('Opened dateRangeBox should be closed after outside click, openOnFieldClick: true', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(Selector('body'), { offsetX: -50 }); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .click(dateRangeBox.dropDownButton); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - width: 500, - openOnFieldClick: true, - opened: true, -})); - -test('DateRangeBox and StartDateBox should have focus class after focus via accessKey', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input) - .expect(dateRangeBox.getStartDateBox().input.getAttribute('accesskey')) - .eql('x'); - - await ClientFunction(() => { - (document.querySelector('[accesskey="x"]') as HTMLElement).focus(); - })(); - - await t - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => createWidget('dxDateRangeBox', { - accessKey: 'x', - openOnFieldClick: false, -})); diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/keyboard.ts b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/keyboard.ts deleted file mode 100644 index 193caf54d307..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/keyboard.ts +++ /dev/null @@ -1,1394 +0,0 @@ -import { Selector } from 'testcafe'; -import DateRangeBox from 'devextreme-testcafe-models/dateRangeBox'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { appendElementTo } from '../../../helpers/domUtils'; - -fixture`DateRangeBox keyboard navigation` - .page(url(__dirname, '../../container.html')); - -const initialValue = [new Date('2021/10/17'), new Date('2021/11/24')]; - -const getDateByOffset = (date: Date | string, offset: number) => { - const resultDate = new Date(date); - - return new Date(resultDate.setDate(resultDate.getDate() + offset)); -}; - -test('DateRangeBox should be opened and close by press alt+down and alt+up respectively when startDateBox is focused', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(false); - - await t - .pressKey('alt+down'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(true); - - await t - .pressKey('alt+up'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(false); - - await t - .pressKey('alt+down'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(true); - - await t - .pressKey('alt+up'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, -})); - -test('DateRangeBox should be opened and close by press alt+down and alt+up respectively when endDateBox is focused', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(false); - - await t - .pressKey('alt+down'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(true); - - await t - .pressKey('alt+up'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(false); - - await t - .pressKey('alt+down'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(true); - - await t - .pressKey('alt+up'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, -})); - -test('DateRangeBox should be opened by press alt+down if startDate input is focused and close by press alt+up if endDateBox is focused', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(false); - - await t - .pressKey('alt+down'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(true); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(true); - - await t - .pressKey('alt+up'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.getStartDateBox().option('opened')) - .eql(false) - .expect(dateRangeBox.getEndDateBox().option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: false, -})); - -test('DateRangeBox should be closed by press esc key when startDateBox is focused', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, -})); - -test('DateRangeBox should be closed by press esc key when endDateBox is focused', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, -})); - -test('DateRangeBox should be closed by press esc key when today/cancel/apply button in popup is focused, applyValueMode is useButtons', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - applyValueMode: 'useButtons', -})); - -test('DateRangeBox should be closed by press esc key when navigator element in popup is focused, applyValueMode is useButtons', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - applyValueMode: 'useButtons', -})); - -test('DateRangeBox should be closed by press esc key when views wrapper in popup is focused, applyValueMode is useButtons', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true); - - await t - .pressKey('tab') - .pressKey('tab') - .pressKey('tab') - .pressKey('tab'); - - await t - .expect(dateRangeBox.getPopup().getViewsWrapper().focused) - .eql(true); - - await t - .pressKey('esc'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - applyValueMode: 'useButtons', -})); - -test('DateRangeBox should not be closed by press tab key on startDate input', async (t) => { - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getStartDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(Selector('#lastFocusableElement').hasClass('dx-state-focused')) - .ok() - .expect(dateRangeBox.isFocused) - .notOk(); -}).before(async () => { - await appendElementTo('#container', 'div', 'dateRangeBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focusable Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - opened: true, - width: 500, - dropDownOptions: { - hideOnOutsideClick: false, - }, - calendarOptions: { - focusStateEnabled: false, - }, - }, '#dateRangeBox'); -}); - -test('DateRangeBox keyboard navigation via `tab` key if applyValueMode is useButtons, start -> end -> prev -> caption -> next -> views -> today -> apply -> cancel -> start -> end', async (t) => { - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(Selector('#firstFocusableElement')) - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getViewsWrapper().focused) - .ok() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); -}).before(async () => { - await appendElementTo('#container', 'div', 'firstFocusableElement'); - await appendElementTo('#container', 'div', 'dateRangeBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'First Focusable Element', - }, '#firstFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focusable Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - applyValueMode: 'useButtons', - opened: true, - width: 500, - dropDownOptions: { - hideOnOutsideClick: false, - }, - }, '#dateRangeBox'); -}); - -test('DateRangeBox keyboard navigation via `shift+tab` key if applyValueMode is useButtons, end -> start -> cancel -> apply -> today -> views -> next -> caption -> prev -> end -> start', async (t) => { - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getViewsWrapper().focused) - .ok() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .notOk() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getApplyButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getCancelButton().isFocused) - .notOk() - .expect(dateRangeBox.getPopup().getTodayButton().isFocused) - .notOk(); -}).before(async () => { - await appendElementTo('#container', 'div', 'firstFocusableElement'); - await appendElementTo('#container', 'div', 'dateRangeBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'First Focused Element', - }, '#firstFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focused Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - applyValueMode: 'useButtons', - opened: false, - width: 500, - }, '#dateRangeBox'); -}); - -test('DateRangeBox keyboard navigation via `tab` key if applyValueMode is instantly, start -> end -> prev -> caption -> next -> views -> start -> end', async (t) => { - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(Selector('#firstFocusableElement')) - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getPopup().getViewsWrapper().focused) - .ok(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .pressKey('tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); -}).before(async () => { - await appendElementTo('#container', 'div', 'firstFocusableElement'); - await appendElementTo('#container', 'div', 'dateRangeBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'First Focusable Element', - }, '#firstFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focusable Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - applyValueMode: 'instantly', - opened: true, - width: 500, - dropDownOptions: { - hideOnOutsideClick: false, - }, - }, '#dateRangeBox'); -}); - -test('DateRangeBox keyboard navigation via `shift+tab` key if applyValueMode is instantly, end -> start -> views -> next -> caption -> prev -> end -> start', async (t) => { - const dateRangeBox = new DateRangeBox('#dateRangeBox'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .notOk() - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getPopup().getViewsWrapper().focused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getPopup().getNavigatorNextButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getPopup().getNavigatorCaption().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getPopup().getNavigatorPrevButton().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .pressKey('shift+tab'); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.isFocused) - .ok() - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok() - .expect(dateRangeBox.getEndDateBox().isFocused) - .notOk(); -}).before(async () => { - await appendElementTo('#container', 'div', 'firstFocusableElement'); - await appendElementTo('#container', 'div', 'dateRangeBox'); - await appendElementTo('#container', 'div', 'lastFocusableElement'); - - await createWidget('dxButton', { - text: 'First Focused Element', - }, '#firstFocusableElement'); - - await createWidget('dxButton', { - text: 'Last Focused Element', - }, '#lastFocusableElement'); - - return createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - applyValueMode: 'instantly', - opened: false, - width: 500, - }, '#dateRangeBox'); -}); - -test('DateRangeBox should not be closed by press shift+tab key on endDate input', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.getEndDateBox().input); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getEndDateBox().isFocused) - .ok(); - - await t - .pressKey('shift+tab') - .wait(100); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.getStartDateBox().isFocused) - .ok(); - - await t - .pressKey('shift+tab') - .wait(100); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false); -}).before(async () => createWidget('dxDateRangeBox', { - value: ['2021/09/17', '2021/10/24'], - openOnFieldClick: true, - opened: true, - width: 500, - dropDownOptions: { - hideOnOutsideClick: false, - }, - calendarOptions: { - focusStateEnabled: false, - }, -})); - -[ - { key: 'left', offsetInDays: -1 }, - { key: 'right', offsetInDays: 1 }, - { key: 'up', offsetInDays: -7 }, - { key: 'down', offsetInDays: 7 }, -].forEach(({ key, offsetInDays }) => { - test(`DateRangeBox start value should be changed after after opening and navigation by '${key}' key and click on 'enter' key`, async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.dropDownButton); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.option('value')) - .eql(initialValue); - - await t - .pressKey(key) - .pressKey('enter'); - - const expectedStartDate = getDateByOffset(initialValue[0], offsetInDays); - - await t - .expect(dateRangeBox.option('opened')) - .eql(true) - .expect(dateRangeBox.option('value')) - .eql([expectedStartDate, new Date(initialValue[1])]); - }).before(async () => createWidget('dxDateRangeBox', { - value: initialValue, - openOnFieldClick: false, - })); - - test('Selection in calendar should be started with current startDate value after select startDate if endDate is not specified', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.dropDownButton); - - await t - .pressKey(key) - .pressKey('enter'); - - await t - .pressKey('right') - .pressKey('right') - .pressKey('right') - .pressKey('right') - .pressKey('right') - .pressKey('enter'); - - const expectedStartDate = getDateByOffset(initialValue[0], offsetInDays); - const expectedEndDate = getDateByOffset(expectedStartDate, 5); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.option('value')) - .eql([expectedStartDate, expectedEndDate]); - }).before(async () => createWidget('dxDateRangeBox', { - value: [initialValue[0], null], - })); - - test('Selection in calendar should be started with endDate value after select startDate if endDate is specified', async (t) => { - const dateRangeBox = new DateRangeBox('#container'); - - await t - .click(dateRangeBox.dropDownButton); - - await t - .pressKey('left') - .pressKey('enter'); - - await t - .pressKey(key) - .pressKey('enter'); - - const expectedStartDate = getDateByOffset(initialValue[0], -1); - const expectedEndDate = getDateByOffset(initialValue[1], offsetInDays); - - await t - .expect(dateRangeBox.option('opened')) - .eql(false) - .expect(dateRangeBox.option('value')) - .eql([expectedStartDate, expectedEndDate]); - }).before(async () => createWidget('dxDateRangeBox', { - value: initialValue, - openOnFieldClick: false, - })); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/validationMessage.ts b/e2e/testcafe-devextreme/tests/editors/dateRangeBox/validationMessage.ts deleted file mode 100644 index f6232e34dd8e..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dateRangeBox/validationMessage.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* eslint-disable no-restricted-syntax */ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import Form from 'devextreme-testcafe-models/form/form'; -import DateRangeBox from 'devextreme-testcafe-models/dateRangeBox'; -import Guid from 'devextreme/core/guid'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { appendElementTo, insertStylesheetRulesToPage } from '../../../helpers/domUtils'; - -const DATERANGEBOX_CLASS = 'dx-daterangebox'; - -fixture.disablePageReloads`DateRangeBox validation message position` - .page(url(__dirname, '../../container.html')); - -const validationMessagePositions = ['auto', 'bottom', 'left', 'right', 'top']; - -const createFormWithDateRangeBox = async (validationMessagePosition: string): Promise => { - const id = `${`dx${new Guid()}`}`; - await appendElementTo('#container', 'div', id, { }); - - const config: any = { - width: '100%', - labelLocation: 'top', - formData: { - DateRange: ['2021/09/17', null], - }, - colCount: 1, - items: [{ - dataField: 'DateRange', - editorType: 'dxDateRangeBox', - label: { - text: 'Date Range', - }, - validationRules: [{ - type: 'required', - message: 'Some message', - }], - editorOptions: { - startDatePlaceholder: 'Start Date', - endDatePlaceholder: 'End Date', - validationMessageMode: 'always', - validationMessagePosition, - }, - }], - }; - - await createWidget('dxForm', config, `#${id}`); - - return id; -}; - -test('The validation message overlay for DateRangeBox should be correctly positioned before and after opening', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - for (const id of t.ctx.ids) { - await new Form(`#${id}`).validate(); - } - - await testScreenshot(t, takeScreenshot, 'The validation message overlay position for DateRangeBox before opening.png', { element: '#container' }); - - for (const id of t.ctx.ids) { - const form = new Form(`#${id}`); - const dateRangeBox = new DateRangeBox(`#${id} .${DATERANGEBOX_CLASS}`); - - await form.validate(); - - await t - .click(dateRangeBox.dropDownButton) - .click(dateRangeBox.dropDownButton); - } - - await testScreenshot(t, takeScreenshot, 'The validation message overlay position for DateRangeBox after opening.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async (t) => { - t.ctx.ids = []; - - await insertStylesheetRulesToPage(` - #container { width: 900px; height: 800px; display: flex; flex-direction: column; padding: 50px; } - .dx-form { margin: 25px 50px; } - `); - - for (const validationMessagePosition of validationMessagePositions) { - const id = await createFormWithDateRangeBox(validationMessagePosition); - t.ctx.ids.push(id); - } -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownBox/T1245111_dropDownBox_height.ts b/e2e/testcafe-devextreme/tests/editors/dropDownBox/T1245111_dropDownBox_height.ts deleted file mode 100644 index 4823d4cb8c4c..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dropDownBox/T1245111_dropDownBox_height.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import { Selector } from 'testcafe'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; - -fixture.disablePageReloads`Grid on Drop Down Box`.page( - url(__dirname, '../../container.html'), -); - -// T1245111 -test('DataGrid on dropDownBox should appear correctly on window resize', async (t) => { - const dropDownBox = Selector('#container'); - const overlay = Selector('.dx-overlay-content'); - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await t.click(dropDownBox); - await t.hover(overlay); - await t.resizeWindow(800, 800); - await testScreenshot(t, takeScreenshot, 'T1245111-dropDownBox-resize.png'); - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxDropDownBox', { - dataSource: Array.from({ length: 100 }, (_, index) => ({ - Value: index + 1, - Text: `item ${index + 1}`, - })), - dropDownOptions: { - width: 'auto', - }, - contentTemplate: (e) => ($('
') as any).dxDataGrid({ - dataSource: e.component.getDataSource(), - }), -})); diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent-next.blue.light).png deleted file mode 100644 index ac3eca6a4895..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent.blue.light).png deleted file mode 100644 index 18adfdd283f9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/Popup has correct height on the first opening (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent-next.blue.light).png deleted file mode 100644 index 411704771004..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent.blue.light).png deleted file mode 100644 index 6a5bac5674cc..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownBox/etalons/T1245111-dropDownBox-resize (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownBox/popup.ts b/e2e/testcafe-devextreme/tests/editors/dropDownBox/popup.ts deleted file mode 100644 index dece4184e60f..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dropDownBox/popup.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; - -const BUTTON_CLASS = 'dx-dropdowneditor-button'; - -fixture.disablePageReloads`Drop Down Box's Popup` - .page(url(__dirname, '../../container.html')); - -test.meta({ browserSize: [900, 600] })('Popup should have correct height when DropDownBox is opened first time (T1130045)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await t - .click(`.${BUTTON_CLASS}`); - - await testScreenshot(t, takeScreenshot, 'Popup has correct height on the first opening.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxDropDownBox', { - dropDownOptions: { - templatesRenderAsynchronously: true, - }, - contentTemplate: '
', -})); diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/common.ts b/e2e/testcafe-devextreme/tests/editors/dropDownButton/common.ts deleted file mode 100644 index 9d1eabb24ace..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dropDownButton/common.ts +++ /dev/null @@ -1,135 +0,0 @@ -/* eslint-disable no-restricted-syntax */ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import { ClientFunction } from 'testcafe'; -import DropDownButton from 'devextreme-testcafe-models/dropDownButton'; -import Guid from 'devextreme/core/guid'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { - appendElementTo, - insertStylesheetRulesToPage, -} from '../../../helpers/domUtils'; - -const DROP_DOWN_BUTTON_CLASS = 'dx-dropdownbutton'; -const BUTTON_GROUP_CLASS = 'dx-buttongroup'; - -const stylingModes = ['text', 'outlined', 'contained']; -const types = ['normal', 'default', 'danger', 'success']; - -fixture.disablePageReloads`Drop Down Button` - .page(url(__dirname, '../../container.html')); - -test('Item collection should be updated after direct option changing (T817436)', async (t) => { - const dropDownButton1 = new DropDownButton('#dropDownButton1'); - const dropDownButton2 = new DropDownButton('#dropDownButton2'); - - await t.click(dropDownButton1.element); - const list1 = await dropDownButton1.getList(); - await t.click(dropDownButton2.element); - const list2 = await dropDownButton2.getList(); - - await t - .expect(list1.getItem().isDisabled).notOk() - .expect(list2.getItem().isDisabled).notOk(); - - await dropDownButton1.option('items[0].disabled', true); - await dropDownButton2.option('dataSource[0].disabled', true); - - await t - .click(dropDownButton1.element) - .expect(list1.getItem().isDisabled) - .ok() - .click(dropDownButton2.element) - .expect(list2.getItem().isDisabled) - .ok(); -}).before(async () => { - await appendElementTo('#container', 'div', 'dropDownButton1', { }); - await appendElementTo('#container', 'div', 'dropDownButton2', { }); - - await createWidget('dxDropDownButton', { - items: [{ text: 'text1' }, { text: 'text2' }], - displayExpr: 'text', - }, '#dropDownButton1'); - - await createWidget('dxDropDownButton', { - dataSource: [{ text: 'text1' }, { text: 'text2' }], - displayExpr: 'text', - }, '#dropDownButton2'); -}); - -[undefined, 120].forEach((width) => { - types.forEach((type) => { - if (width && type !== 'normal') { - return; - } - - test('DropDownButton renders correctly', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await insertStylesheetRulesToPage(`.${DROP_DOWN_BUTTON_CLASS}.dx-widget { display: inline-flex; vertical-align: middle; margin: 2px; } .${BUTTON_GROUP_CLASS} { vertical-align: middle; }`); - - await testScreenshot(t, takeScreenshot, `DropDownButton render${width ? ' with fixed width' : ''}${type !== 'normal' ? `, type=${type}` : ''}.png`); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async (t) => { - t.ctx.ids = []; - - for (const rtlEnabled of [false, true]) { - for (const stylingMode of stylingModes) { - await appendElementTo('#container', 'div', `${stylingMode}-${rtlEnabled}`, { fontSize: '10px' }); - await ClientFunction(() => { - $(`#${stylingMode}-${rtlEnabled}`).text(`StylingMode: ${stylingMode}, rtlEnabled: ${rtlEnabled}`); - }, { - dependencies: { - stylingMode, rtlEnabled, - }, - })(); - - for (const splitButton of [true, false]) { - for (const showArrowIcon of [true, false]) { - for (const icon of ['image', '']) { - for (const text of ['', 'Text']) { - const id = `${`dx${new Guid()}`}`; - - t.ctx.ids.push(id); - await appendElementTo('#container', 'div', id, { }); - await createWidget('dxDropDownButton', { - width, - rtlEnabled, - items: [{ text: 'text1' }, { text: 'text2' }], - displayExpr: 'text', - type, - text, - icon, - stylingMode, - showArrowIcon, - splitButton, - }, `#${id}`); - } - } - } - } - } - } - }); - }); -}); - -[false, true].forEach((splitButton) => { - test('Button template', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `Button template, splitButton=${splitButton}.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => createWidget('dxDropDownButton', { - splitButton, - width: 200, - template: () => $('
Custom text
'), - })); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent-next.blue.light).png deleted file mode 100644 index 6dc16646984a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent.blue.light).png deleted file mode 100644 index e01d1f0614e2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent-next.blue.light).png deleted file mode 100644 index c16011cc8d36..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent.blue.light).png deleted file mode 100644 index 32bf10bfd973..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/Button template, splitButton=true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render (fluent-next.blue.light).png deleted file mode 100644 index d4cb2beaeeb6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render (fluent.blue.light).png deleted file mode 100644 index 24da5d90fae5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent-next.blue.light).png deleted file mode 100644 index a770e2358835..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent.blue.light).png deleted file mode 100644 index 1c5cb645a6af..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render with fixed width (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent-next.blue.light).png deleted file mode 100644 index cad5e2bc99f2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent.blue.light).png deleted file mode 100644 index 40a55b866400..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=danger (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent-next.blue.light).png deleted file mode 100644 index e81c47716f82..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent.blue.light).png deleted file mode 100644 index a733ed73a14c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=default (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent-next.blue.light).png deleted file mode 100644 index 9731cead942b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent.blue.light).png deleted file mode 100644 index 64879780db28..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/dropDownButton/etalons/DropDownButton render, type=success (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/dropDownButton/popup.ts b/e2e/testcafe-devextreme/tests/editors/dropDownButton/popup.ts deleted file mode 100644 index 5fb89df3649f..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/dropDownButton/popup.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Selector } from 'testcafe'; -import DropDownButton from 'devextreme-testcafe-models/dropDownButton'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -fixture.disablePageReloads`Drop Down Button's Popup` - .page(url(__dirname, '../../container.html')); - -test('Popup should have correct position when DropDownButton is placed in the right bottom(T1034931)', async (t) => { - const dropDownButton = new DropDownButton('#container'); - const dropDownButtonRect = { - top: await dropDownButton.element.getBoundingClientRectProperty('top'), - left: await dropDownButton.element.getBoundingClientRectProperty('left'), - }; - - const popupContent = Selector('.dx-overlay-content'); - const popupContentRect = { - bottom: await popupContent.getBoundingClientRectProperty('bottom'), - left: await popupContent.getBoundingClientRectProperty('left'), - }; - - await t - .expect(Math.abs(dropDownButtonRect.left - popupContentRect.left)) - .lt(1) - .expect(Math.abs(dropDownButtonRect.left - popupContentRect.left)) - .lt(1); -}).before(async () => createWidget('dxDropDownButton', { - items: [1, 2, 3, 4, 5, 6, 7], - elementAttr: { style: 'position: absolute; right: 10px; bottom: 10px;' }, - opened: true, -})); diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/common.ts b/e2e/testcafe-devextreme/tests/editors/lookup/common.ts deleted file mode 100644 index 138dbd74b715..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/lookup/common.ts +++ /dev/null @@ -1,181 +0,0 @@ -/* eslint-disable no-restricted-syntax */ -import { ClientFunction, Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import Lookup from 'devextreme-testcafe-models/lookup'; -import Guid from 'devextreme/core/guid'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { Themes } from '../../../helpers/themes'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { - appendElementTo, insertStylesheetRulesToPage, removeStylesheetRulesFromPage, setStyleAttribute, -} from '../../../helpers/domUtils'; - -const LOOKUP_FIELD_CLASS = 'dx-lookup-field'; -const OVERLAY_CLASS = 'dx-overlay-content'; - -const LOADINDICATOR_SEGMENT_CLASS = 'dx-loadindicator-segment'; -const LOADINDICATOR_CONTENT_CLASS = 'dx-loadindicator-content'; -const LOADINDICATOR_ICON_CLASS = 'dx-loadindicator-icon'; -const LOADINDICATOR_SEGMENT_INNER_CLASS = 'dx-loadindicator-segment-inner'; - -const stylingModes = ['outlined', 'underlined', 'filled']; -const labelModes = ['static', 'floating', 'hidden', 'outside']; - -fixture.disablePageReloads`Lookup` - .page(url(__dirname, '../../container.html')); - -test('Popup should not be closed if lookup is placed at the page bottom (T1018037)', async (t) => { - const lookup = new Lookup('#container'); - - const { getInstance } = lookup; - await ClientFunction(() => { - const $element = (getInstance() as any).$element(); - $element.css({ top: window.innerHeight - $element.height() }); - }, { - dependencies: { getInstance }, - })(); - - await lookup.open(); - - await t - .expect(await lookup.isOpened()) - .ok(); -}).before(async () => createWidget('dxLookup', { - items: [1, 2, 3], - usePopover: false, -})); - -test.meta({ runInTheme: Themes.materialBlue })('Popup should be flipped if lookup is placed at the page bottom', async (t) => { - const popupWrapper = Selector('.dx-overlay-wrapper'); - const popupContent = Selector('.dx-overlay-content'); - - const popupWrapperTop = await popupWrapper.getBoundingClientRectProperty('top'); - const popupContentTop = await popupContent.getBoundingClientRectProperty('top'); - - await t - .expect(popupContentTop) - .lt(popupWrapperTop); -}).before(async () => { - await ClientFunction(() => { - const $element = $('#container'); - $element.css({ top: $(window).height() - $element.height() }); - })(); - - return createWidget('dxLookup', { - items: [1, 2, 3], - usePopover: false, - opened: true, - dropDownOptions: { - hideOnParentScroll: false, - }, - }); -}); - -test.meta({ runInTheme: Themes.genericLight })('Popover should have correct vertical position (T1048128)', async (t) => { - const lookup = new Lookup('#container'); - await lookup.open(); - - const popoverArrow = Selector('.dx-popover-arrow'); - - const lookupElementBottom = await lookup.element.getBoundingClientRectProperty('bottom'); - const popoverArrowTop = await popoverArrow.getBoundingClientRectProperty('top'); - - await t - .expect(lookupElementBottom) - .eql(popoverArrowTop); -}).before(async () => createWidget('dxLookup', { - items: Array.from(Array(100).keys()), -})); - -test.meta({ browserSize: [300, 400] })('Check popup height with no found data option', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - await t.click(Selector(`.${LOOKUP_FIELD_CLASS}`)); - await t.hover(`.${OVERLAY_CLASS}`); - - await testScreenshot(t, takeScreenshot, 'Lookup with no found data.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxLookup', { dataSource: [], searchEnabled: true })); - -test.meta({ browserSize: [300, 400] })('Check popup height in loading state', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await t.click(Selector(`.${LOOKUP_FIELD_CLASS}`)); - await t.hover(`.${OVERLAY_CLASS}`); - - await testScreenshot(t, takeScreenshot, 'Lookup in loading.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await insertStylesheetRulesToPage(` - .${LOADINDICATOR_SEGMENT_CLASS}, - .${LOADINDICATOR_CONTENT_CLASS}, - .${LOADINDICATOR_ICON_CLASS}, - .${LOADINDICATOR_SEGMENT_INNER_CLASS} { - animation: none !important; - } - `); - - return createWidget('dxLookup', { - dataSource: { - load: () => new Promise(() => {}), - }, - valueExpr: 'id', - displayExpr: 'text', - }); -}).after(async () => removeStylesheetRulesFromPage()); - -test('Lookup appearance', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'Lookup appearance.png'); - - for (const id of t.ctx.ids) { - await setStyleAttribute(Selector(`#${id}`), 'width: fit-content;'); - } - - await testScreenshot(t, takeScreenshot, 'Lookup width adjust to fit its content.png'); - - for (const id of t.ctx.ids) { - await setStyleAttribute(Selector(`#${id}`), 'width: 100px;'); - } - - await testScreenshot(t, takeScreenshot, 'Lookup appearance with limited width.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async (t) => { - t.ctx.ids = []; - - await insertStylesheetRulesToPage('#container { display: grid; align-items: end; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 5px; }'); - - for (const stylingMode of stylingModes) { - for (const labelMode of labelModes) { - for (const rtlEnabled of [true, false]) { - for (const value of [null, 'Item_text_2']) { - const id = `${`dx${new Guid()}`}`; - - t.ctx.ids.push(id); - await appendElementTo('#container', 'div', id, { }); - - const options: any = { - items: ['Item_text_1', 'Item_text_2'], - label: 'label text', - labelMode, - stylingMode, - rtlEnabled, - value, - }; - - await createWidget('dxLookup', options, `#${id}`); - } - } - } - } -}); diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance (fluent-next.blue.light).png deleted file mode 100644 index 9f8120789eca..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance (fluent.blue.light).png deleted file mode 100644 index 252ce82bb3d7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent-next.blue.light).png deleted file mode 100644 index 6d6009dc6d69..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent.blue.light).png deleted file mode 100644 index 7a8aa8ae70b0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup appearance with limited width (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup in loading (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup in loading (fluent-next.blue.light).png deleted file mode 100644 index 2c543519cdd6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup in loading (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup in loading (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup in loading (fluent.blue.light).png deleted file mode 100644 index cd9aaa9e89da..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup in loading (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup in loading (fluent.blue.light)_mask.png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup in loading (fluent.blue.light)_mask.png deleted file mode 100644 index 2e8194a8951e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup in loading (fluent.blue.light)_mask.png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent-next.blue.light).png deleted file mode 100644 index fd35af87e4eb..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent.blue.light).png deleted file mode 100644 index be370c1f237f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup width adjust to fit its content (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup with no found data (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup with no found data (fluent-next.blue.light).png deleted file mode 100644 index 3efa646eec2c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup with no found data (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup with no found data (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup with no found data (fluent.blue.light).png deleted file mode 100644 index d87a75e2e373..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/lookup/etalons/Lookup with no found data (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/actionButton.ts b/e2e/testcafe-devextreme/tests/editors/selectBox/actionButton.ts deleted file mode 100644 index d43ebea2af05..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/selectBox/actionButton.ts +++ /dev/null @@ -1,193 +0,0 @@ -import { ClientFunction } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import SelectBox from 'devextreme-testcafe-models/selectBox'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { appendElementTo } from '../../../helpers/domUtils'; - -fixture.disablePageReloads`SelectBox` - .page(url(__dirname, '../../container.html')); - -const purePressKey = async (t, key): Promise => { - await t - .pressKey(key) - .wait(100); -}; - -const focusOutByTab = async (t, editor): Promise => { - await purePressKey(t, 'tab'); - - if (await editor.isFocused) { - await purePressKey(t, 'tab'); - } -}; - -test('Click on action button should correctly work with SelectBox containing the field template (T811890)', async (t) => { - const selectBox = new SelectBox('#container'); - const { getInstance } = selectBox; - - await ClientFunction( - () => { - (getInstance() as any).option('buttons', [{ - name: 'test', - options: { - icon: 'home', - onClick: () => { - (getInstance() as any).option('value', 'item2'); - (getInstance() as any).focus(); // NOTE: need because of editor input rerendering - }, - }, - }]); - }, - { dependencies: { getInstance } }, - )(); - - await t.click(selectBox.element); - await purePressKey(t, 'alt+up'); - await t - .expect(selectBox.isFocused).ok() - .expect(await selectBox.isOpened()) - .notOk(); - - const actionButton = selectBox.getButton(0); - await t - .click(actionButton.element) - .expect(selectBox.isFocused).ok() - .expect(selectBox.value) - .eql('item2'); -}).before(async () => createWidget('dxSelectBox', { - items: ['item1', 'item2'], - fieldTemplate: (value) => ($('
') as any).dxTextBox({ value }), -})); - -test('Click on action button after typing should correctly work with SelectBox containing the field template (T811890)', async (t) => { - const selectBox = new SelectBox('#container'); - const { getInstance } = selectBox; - - await ClientFunction( - () => { - (getInstance() as any).option('buttons', [{ - name: 'test', - options: { - icon: 'home', - onClick: () => { - (getInstance() as any).option('value', 'item2'); - (getInstance() as any).focus(); // NOTE: need because of editor input rerendering - }, - }, - }]); - }, - { dependencies: { getInstance } }, - )(); - - await t.click(selectBox.element); - await purePressKey(t, 'alt+up'); - await t - .expect(selectBox.isFocused).ok() - .expect(await selectBox.isOpened()) - .notOk(); - - const actionButton = selectBox.getButton(0); - - await t - .typeText(selectBox.input, 'tt'); - await t - .click(actionButton.element) - .expect(selectBox.isFocused).ok() - .expect(selectBox.value) - .eql('item2'); -}).before(async () => createWidget('dxSelectBox', { - items: ['item1', 'item2'], - fieldTemplate: (value) => ($('
') as any).dxTextBox({ value }), -})); - -test('editor can be focused out after click on action button', async (t) => { - const selectBox = new SelectBox('#container'); - const { getInstance } = selectBox; - - await ClientFunction( - () => { - (getInstance() as any).option('buttons', [{ - name: 'test', - options: { - icon: 'home', - onClick: () => { - (getInstance() as any).option('value', 'item2'); - }, - }, - }]); - }, - { dependencies: { getInstance } }, - )(); - - await t.click(selectBox.element); - await t - .expect(selectBox.isFocused).ok(); - - const actionButton = selectBox.getButton(0); - await t - .click(actionButton.element) - .expect(selectBox.isFocused).ok(); - - await focusOutByTab(t, selectBox); - await t - .expect(selectBox.isFocused).notOk(); -}).before(async () => createWidget('dxSelectBox', { - items: ['item1', 'item2'], -})); - -test('selectbox should not be opened after click on disabled action button (T1117453)', async (t) => { - const selectBox = new SelectBox('#container'); - const { getInstance } = selectBox; - - await ClientFunction( - () => { - (getInstance() as any).option('buttons', [{ - name: 'test', - options: { - icon: 'home', - type: 'default', - disabled: true, - onClick: () => { - (getInstance() as any).option('value', 'item2'); - }, - }, - }]); - }, - { dependencies: { getInstance } }, - )(); - - const actionButton = selectBox.getButton(0); - await t - .click(actionButton.element) - .expect(selectBox.isFocused) - .notOk() - .expect(await selectBox.isOpened()) - .notOk() - .expect(selectBox.value) - .eql('item1'); -}).before(async () => createWidget('dxSelectBox', { - items: ['item1', 'item2'], - value: 'item1', -})); - -test('SelectBox: positioning content in the custom dropdown button', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'SelectBox Customize DropDown Button.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'selectBox'); - - return createWidget('dxSelectBox', { - items: ['item1', 'item2'], - value: 'item1', - dropDownButtonTemplate() { - return 'X'; - }, - }, '#container'); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/common.ts b/e2e/testcafe-devextreme/tests/editors/selectBox/common.ts deleted file mode 100644 index 323e8b584ee9..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/selectBox/common.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { ClientFunction, Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import SelectBox from 'devextreme-testcafe-models/selectBox'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -fixture.disablePageReloads`SelectBox placeholder` - .page(url(__dirname, '../../container.html')); - -test('Placeholder is visible after items option change when value is not chosen (T1099804)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const selectBox = new SelectBox('#selectBox'); - - await selectBox.option('items', [1, 2, 3]); - await testScreenshot(t, takeScreenshot, 'SelectBox placeholder after items change if value is not choosen.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'selectBox'); - await setStyleAttribute(Selector('#container'), 'box-sizing: border-box; width: 300px; height: 100px; padding: 8px;'); - - return createWidget('dxSelectBox', { - width: '100%', - placeholder: 'Choose a value', - }, '#selectBox'); -}); - -test('Pages should be loaded consistently after closing the dropdown popup and filtering the data (T1274576)', async (t) => { - const selectBox = new SelectBox('#selectBox'); - - await selectBox.option('opened', true); - - const list = await selectBox.getList(); - const items = list.getItems(); - - await t.expect(items.count) - .eql(12) - .expect(items.nth(0).textContent) - .eql('item 1') - .expect(items.nth(11).textContent) - .eql('item 12'); - - const scrollingDistance = 50; - await list.scrollTo(scrollingDistance); - await t.wait(500); - - await t.click(Selector('body')); - - const { getInstance } = selectBox; - - await ClientFunction( - () => { - const dataSource = (getInstance() as any).getDataSource(); - dataSource.filter(['anotherId', '=', 2]); - dataSource.load(); - }, - { dependencies: { getInstance } }, - )(); - await t.wait(500); - - await selectBox.option('opened', true); - - await t.wait(500); - - await t.expect(items.count) - .eql(12) - .expect(items.nth(0).textContent) - .eql('item 2') - .expect(items.nth(11).textContent) - .eql('item 24'); -}).before(async () => { - await appendElementTo('#container', 'div', 'selectBox'); - await setStyleAttribute(Selector('#container'), 'box-sizing: border-box; width: 300px; height: 100px; padding: 8px;'); - - return createWidget('dxSelectBox', () => { - const data: { id: number; text: string; anotherId: number }[] = []; - - for (let index = 0; index < 100; index += 1) { - data.push({ - id: index + 1, - text: `item ${index + 1}`, - anotherId: index % 2 === 0 ? 1 : 2, - }); - } - - const sampleAPI = new (window as any).DevExpress.data.ArrayStore({ key: 'id', data }); - const store = new (window as any).DevExpress.data.CustomStore({ - key: 'id', - load(loadOptions) { - return new Promise((resolve) => { - setTimeout(() => { - sampleAPI.load(loadOptions).done((items) => { - resolve(items); - }); - }, 100); - }); - }, - totalCount(loadOptions) { - return sampleAPI.totalCount(loadOptions); - }, - byKey(key) { - return sampleAPI.byKey(key); - }, - }); - - return { - dataSource: { - store, - paginate: true, - pageSize: 6, - }, - valueExpr: 'id', - displayExpr: 'text', - }; - }, '#selectBox'); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent-next.blue.light).png deleted file mode 100644 index 34f8b7d5d3b3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent.blue.light).png deleted file mode 100644 index 44fc76cbf7d9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox Customize DropDown Button (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox no data (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox no data (fluent-next.blue.light).png deleted file mode 100644 index e2cf2fbd6ae5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox no data (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox no data (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox no data (fluent.blue.light).png deleted file mode 100644 index ab36229e9a0f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox no data (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent-next.blue.light).png deleted file mode 100644 index e90fbfea1b34..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent.blue.light).png deleted file mode 100644 index 71e98a0a96b8..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize equal datasource items count (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent-next.blue.light).png deleted file mode 100644 index e90fbfea1b34..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent.blue.light).png deleted file mode 100644 index 71e98a0a96b8..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize less datasource items count (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent-next.blue.light).png deleted file mode 100644 index e90fbfea1b34..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent.blue.light).png deleted file mode 100644 index 71e98a0a96b8..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox pagesize more datasource items count (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent-next.blue.light).png deleted file mode 100644 index 464d8e77cb9c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent.blue.light).png deleted file mode 100644 index 88b57028bcfb..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox placeholder after items change if value is not choosen (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent-next.blue.light).png deleted file mode 100644 index f55736ca45d3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent.blue.light).png deleted file mode 100644 index 29c6fb049320..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox popup height after last page load (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent-next.blue.light).png deleted file mode 100644 index 7bae60df337f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png deleted file mode 100644 index 5d28a4f65a57..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent-next.blue.light).png deleted file mode 100644 index 6650783503ab..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png deleted file mode 100644 index 55d3e64796a2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent-next.blue.light).png deleted file mode 100644 index 4b2209e2cbe1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png deleted file mode 100644 index 9826176a65a6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent-next.blue.light).png deleted file mode 100644 index 542ff17c97c7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png deleted file mode 100644 index ca2ef32d3084..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent-next.blue.light).png deleted file mode 100644 index b490f822d724..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png deleted file mode 100644 index 42767f7edf65..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent-next.blue.light).png deleted file mode 100644 index 3f5c51a39128..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png deleted file mode 100644 index 6bb9fc9b8da2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent-next.blue.light).png deleted file mode 100644 index 820db7dbae4b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent.blue.light).png deleted file mode 100644 index f6c62f915ab4..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=filled (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent-next.blue.light).png deleted file mode 100644 index 46bc222d4a1e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png deleted file mode 100644 index 8e73727392a4..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent-next.blue.light).png deleted file mode 100644 index 2aecd359f275..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png deleted file mode 100644 index 884ed02ae1db..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/selectBox/etalons/SelectBox with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/label.ts b/e2e/testcafe-devextreme/tests/editors/selectBox/label.ts deleted file mode 100644 index e42b9de67e6b..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/selectBox/label.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import SelectBox from 'devextreme-testcafe-models/selectBox'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { - appendElementTo, - setStyleAttribute, -} from '../../../helpers/domUtils'; - -const labelMods = ['floating', 'static', 'outside']; -const stylingModes = ['outlined', 'underlined', 'filled']; - -fixture.disablePageReloads`Label` - .page(url(__dirname, '../../container.html')); - -stylingModes.forEach((stylingMode) => { - labelMods.forEach((labelMode) => { - test(`Label for dxSelectBox labelMode=${labelMode} stylingMode=${stylingMode}`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const selectBox2 = new SelectBox('#selectBox2'); - - await t.click('#selectBox2'); - - await testScreenshot(t, takeScreenshot, `SelectBox with label-labelMode=${labelMode}-stylingMode=${stylingMode}.png`, { element: '#container' }); - - await t.click(await selectBox2.getPopup()); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await setStyleAttribute(Selector('#container'), 'box-sizing: border-box; width: 300px; height: 400px; padding: 8px;'); - - await appendElementTo('#container', 'div', 'selectBox1'); - await appendElementTo('#container', 'div', 'selectBox2'); - - await createWidget('dxSelectBox', { - width: 100, - label: 'label', - text: '', - labelMode, - stylingMode, - }, '#selectBox1'); - - await createWidget('dxSelectBox', { - label: `this label is ${'very '.repeat(10)}long`, - text: `this content is ${'very '.repeat(10)}long`, - items: ['item1', 'item2'], - labelMode, - stylingMode, - }, '#selectBox2'); - }); - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/popup.ts b/e2e/testcafe-devextreme/tests/editors/selectBox/popup.ts deleted file mode 100644 index 466293b0e7f7..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/selectBox/popup.ts +++ /dev/null @@ -1,145 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import SelectBox from 'devextreme-testcafe-models/selectBox'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -fixture.disablePageReloads`popup height after load` - .page(url(__dirname, '../../container.html')); - -test.meta({ browserSize: [300, 400] })('SelectBox without data', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const selectBox = new SelectBox('#container'); - - await t.click(selectBox.element); - - await testScreenshot(t, takeScreenshot, 'SelectBox no data.png'); - - await t.click(await selectBox.getPopup()); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxSelectBox', { - dataSource: { - store: [], - paginate: true, - pageSize: 3, - }, -})); - -test.meta({ browserSize: [300, 400] })('SelectBox has a correct popup height for the first opening if the pageSize is equal to dataSource length (T942881)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const selectBox = new SelectBox('#container'); - - await t.click(selectBox.element); - - await selectBox.option('dataSource', { - store: [1, 2, 3], - paginate: true, - pageSize: 3, - }); - - await testScreenshot(t, takeScreenshot, 'SelectBox pagesize equal datasource items count.png'); - - await t.click(await selectBox.getPopup()); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxSelectBox', { - dataSource: { - store: [], - paginate: true, - pageSize: 3, - }, -})); - -test.meta({ browserSize: [300, 400] })('SelectBox has a correct popup height for the first opening if the pageSize is less than dataSource items count', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const selectBox = new SelectBox('#container'); - - await t.click(selectBox.element); - - await selectBox.option('dataSource', { - store: [1, 2, 3], - paginate: true, - pageSize: 2, - }); - - await testScreenshot(t, takeScreenshot, 'SelectBox pagesize less datasource items count.png'); - - await t.click(await selectBox.getPopup()); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxSelectBox', { - dataSource: { - store: [], - paginate: true, - pageSize: 3, - }, -})); - -test.meta({ browserSize: [300, 400] })('SelectBox has a correct popup height for the first opening if the pageSize is more than dataSource items count', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const selectBox = new SelectBox('#container'); - - await t.click(selectBox.element); - - await selectBox.option('dataSource', { - store: [1, 2, 3], - paginate: true, - pageSize: 5, - }); - - await testScreenshot(t, takeScreenshot, 'SelectBox pagesize more datasource items count.png'); - - await t.click(await selectBox.getPopup()); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxSelectBox', { - dataSource: { - store: [], - paginate: true, - pageSize: 3, - }, -})); - -test.meta({ browserSize: [300, 400] })('SelectBox does not change a popup height after load the last page', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const selectBox = new SelectBox('#container'); - - await t.click(selectBox.element); - - await selectBox.option('dataSource', { - store: [1, 2, 3, 4, 5], - paginate: true, - pageSize: 2, - }); - - const list = await selectBox.getList(); - await list.scrollTo(100); - - await testScreenshot(t, takeScreenshot, 'SelectBox popup height after last page load.png'); - - await t.click(await selectBox.getPopup()); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxSelectBox', { - dataSource: { - store: [], - paginate: true, - pageSize: 3, - }, -})); diff --git a/e2e/testcafe-devextreme/tests/editors/selectBox/toolbarIntegration.ts b/e2e/testcafe-devextreme/tests/editors/selectBox/toolbarIntegration.ts deleted file mode 100644 index 2e0f4b408682..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/selectBox/toolbarIntegration.ts +++ /dev/null @@ -1,36 +0,0 @@ -import SelectBox from 'devextreme-testcafe-models/selectBox'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { isMaterial } from '../../../helpers/themeUtils'; - -fixture.disablePageReloads`SelectBox as Toolbar item` - .page(url(__dirname, '../../container.html')); - -test('SelectBox should correctly render its buttons if editor is rendered as a Toolbar item with fieldTemplate (T949859)', async (t) => { - const selectBox = new SelectBox('#container'); - const actionButton = selectBox.getButton(0); - - await t - .expect(actionButton.getText().innerText) - .eql(isMaterial() ? 'TEST' : 'test'); -}).before(async () => createWidget('dxToolbar', { - items: [ - { - widget: 'dxSelectBox', - options: { - buttons: [ - { - name: 'test', - options: { - text: 'test', - }, - }, - ], - fieldTemplate: (_, wrapper) => { - ($('
').appendTo(wrapper) as any).dxTextBox(); - }, - items: [1, 2, 3, 4], - }, - }, - ], -})); diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/common.ts b/e2e/testcafe-devextreme/tests/editors/tagBox/common.ts deleted file mode 100644 index a702ef24477e..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/tagBox/common.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import TagBox from 'devextreme-testcafe-models/tagBox'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -fixture.disablePageReloads`TagBox` - .page(url(__dirname, '../../container.html')); - -test('Keyboard navigation should work then tagBox is focused or list is focused', async (t) => { - const tagBox = new TagBox('#container'); - - await t - .click(tagBox.element); - - await t - .expect(tagBox.isFocused).ok() - .expect(await tagBox.isOpened()) - .ok(); - - const list = await tagBox.getList(); - const { selectAll } = list; - const selectAllCheckBox = selectAll.checkBox; - const firstItemCheckBox = list.getItem().checkBox; - const secondItemCheckBox = list.getItem(1).checkBox; - const thirdItemCheckBox = list.getItem(2).checkBox; - - await t - // List is focused - .pressKey('tab') - .expect(selectAllCheckBox.isFocused).ok() - .pressKey('down down down') - .expect(thirdItemCheckBox.isFocused) - .ok() - .pressKey('down') - .expect(selectAllCheckBox.isFocused) - .ok() - .pressKey('up up up') - .expect(firstItemCheckBox.isFocused) - .ok() - .expect(firstItemCheckBox.isChecked) - .notOk() - .pressKey('space') - .expect(firstItemCheckBox.isChecked) - .ok() - .pressKey('enter') - .expect(firstItemCheckBox.isChecked) - .notOk() - - // TagBox is focused - .pressKey('shift+tab') - .expect(tagBox.isFocused) - .ok() - .pressKey('down') - .expect(secondItemCheckBox.isFocused) - .ok() - .pressKey('down down') - .expect(selectAllCheckBox.isFocused) - .ok() - .pressKey('up up up') - .expect(firstItemCheckBox.isFocused) - .ok() - .expect(firstItemCheckBox.isChecked) - .notOk() - .pressKey('space') - .expect(firstItemCheckBox.isChecked) - .ok() - .pressKey('enter') - .expect(firstItemCheckBox.isChecked) - .notOk(); -}).before(async () => createWidget('dxTagBox', { - items: ['item1', 'item2', 'item3'], - showSelectionControls: true, - selectionMode: 'all', - applyValueMode: 'useButtons', -})); - -test('Select all checkbox should be focused by tab and closed by escape (T389453)', async (t) => { - const tagBox = new TagBox('#container'); - - await t - .click(tagBox.element); - - await t - .expect(tagBox.isFocused).ok() - .expect(await tagBox.isOpened()) - .ok(); - - const list = await tagBox.getList(); - const { selectAll } = list; - const selectAllCheckBox = selectAll.checkBox; - - await t - .pressKey('tab') - .expect(tagBox.isFocused).notOk() - .expect(selectAllCheckBox.isFocused) - .ok() - - .pressKey('shift+tab') - .expect(tagBox.isFocused) - .ok() - .expect(selectAllCheckBox.isFocused) - .notOk() - - .pressKey('tab') - .expect(tagBox.isFocused) - .notOk() - .expect(selectAllCheckBox.isFocused) - .ok(); - - await t - .pressKey('esc'); - - await t - .expect(tagBox.isFocused) - .ok() - .expect(await tagBox.isOpened()) - .notOk(); -}).before(async () => createWidget('dxTagBox', { - items: ['item1', 'item2', 'item3'], - showSelectionControls: true, - selectionMode: 'all', - applyValueMode: 'useButtons', -})); - -test.meta({ browserSize: [300, 300] })('TagBox with selection controls', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const tagBox = new TagBox('#container'); - - await t.click(tagBox.element); - - await testScreenshot(t, takeScreenshot, 'TagBox with selection controls.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxTagBox', { - items: [1, 2, 3, 4, 5, 6, 7], - showSelectionControls: true, - width: 300, -})); - -test('Placeholder is visible after items option change when value is not chosen (T1099804)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const tagBox = new TagBox('#container'); - - await tagBox.option('items', [1, 2, 3]); - - await testScreenshot(t, takeScreenshot, 'TagBox placeholder if value is not choosen.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxTagBox', { - width: 300, - placeholder: 'Choose a value', -})); diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent-next.blue.light).png deleted file mode 100644 index 52ac6f6782e8..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent.blue.light).png deleted file mode 100644 index bd6c5845a4eb..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent-next.blue.light).png deleted file mode 100644 index 27b9a201bbdf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent.blue.light).png deleted file mode 100644 index 9fca4520c75d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=floating (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent-next.blue.light).png deleted file mode 100644 index f0a94739e0c5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent.blue.light).png deleted file mode 100644 index baf32e08285e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=hidden (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent-next.blue.light).png deleted file mode 100644 index 349a6d5ff154..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent.blue.light).png deleted file mode 100644 index ddf6765b86f9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=outside (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent-next.blue.light).png deleted file mode 100644 index 27b9a201bbdf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent.blue.light).png deleted file mode 100644 index 9fca4520c75d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=filled,labelMode=static (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent-next.blue.light).png deleted file mode 100644 index c57b150def29..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent.blue.light).png deleted file mode 100644 index 719d25d6804c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent-next.blue.light).png deleted file mode 100644 index 8dcf513e0334..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent.blue.light).png deleted file mode 100644 index acc1e91856d6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=floating (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent-next.blue.light).png deleted file mode 100644 index 0aabe4353f47..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent.blue.light).png deleted file mode 100644 index 4c99787f1155..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=hidden (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent-next.blue.light).png deleted file mode 100644 index c4445af4b7f3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent.blue.light).png deleted file mode 100644 index 53717ef86860..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=outside (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent-next.blue.light).png deleted file mode 100644 index 8dcf513e0334..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent.blue.light).png deleted file mode 100644 index acc1e91856d6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=outlined,labelMode=static (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent-next.blue.light).png deleted file mode 100644 index b64e4b28bf67..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent.blue.light).png deleted file mode 100644 index f4a5670c5c9b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent-next.blue.light).png deleted file mode 100644 index fedc3da7143c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent.blue.light).png deleted file mode 100644 index 5bd11638b43e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=floating (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent-next.blue.light).png deleted file mode 100644 index ca7398ec314d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent.blue.light).png deleted file mode 100644 index 2f6b706d01e9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=hidden (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent-next.blue.light).png deleted file mode 100644 index caecb02a631b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent.blue.light).png deleted file mode 100644 index 79226716e37a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=outside (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent-next.blue.light).png deleted file mode 100644 index fedc3da7143c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent.blue.light).png deleted file mode 100644 index 5bd11638b43e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox label with stylingMode=underlined,labelMode=static (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent-next.blue.light).png deleted file mode 100644 index 8884fd208b6b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent.blue.light).png deleted file mode 100644 index 3e259e0f4aed..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox placeholder if value is not choosen (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox with selection controls (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox with selection controls (fluent-next.blue.light).png deleted file mode 100644 index 70be58d09a36..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox with selection controls (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox with selection controls (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox with selection controls (fluent.blue.light).png deleted file mode 100644 index 8f2acb94daf7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/tagBox/etalons/TagBox with selection controls (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/tagBox/label.ts b/e2e/testcafe-devextreme/tests/editors/tagBox/label.ts deleted file mode 100644 index e1c9ea6615d3..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/tagBox/label.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import TagBox from 'devextreme-testcafe-models/tagBox'; -import { isMaterial, testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { - appendElementTo, - setStyleAttribute, - insertStylesheetRulesToPage, -} from '../../../helpers/domUtils'; - -const stylingModes = ['outlined', 'underlined', 'filled']; -const labelModes = ['static', 'floating', 'hidden', 'outside']; - -fixture.disablePageReloads`TagBox_Label` - .page(url(__dirname, '../../container.html')); - -stylingModes.forEach((stylingMode) => { - test.meta({ browserSize: [300, 800] })(`Label for dxTagBox stylingMode=${stylingMode}`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await t.click('#tagBox2'); - - await testScreenshot(t, takeScreenshot, `TagBox label with stylingMode=${stylingMode}.png`); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - const componentOptions = { - label: 'label text', - items: [...Array(10)].map((_, i) => `item${i}`), - value: [...Array(5)].map((_, i) => `item${i}`), - stylingMode, - }; - - if (isMaterial()) { - await insertStylesheetRulesToPage('#container .dx-widget { font-family: sans-serif }'); - } - - await appendElementTo('#container', 'div', 'tagBox1', { }); - await appendElementTo('#container', 'div', 'tagBox2', { }); - - await createWidget('dxTagBox', { - ...componentOptions, - multiline: false, - }, '#tagBox1'); - - await createWidget('dxTagBox', { - ...componentOptions, - multiline: true, - }, '#tagBox2'); - }); - - labelModes.forEach((labelMode) => { - test.meta({ browserSize: [300, 400] })(`Label shouldn't be cutted for dxTagBox in stylingMode=${stylingMode}, labelMode=${labelMode} (T1104913)`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const tagBox = new TagBox('#container'); - - await t.click(tagBox.element); - - const screenshotName = `TagBox label with stylingMode=${stylingMode},labelMode=${labelMode}.png`; - - await t.click(tagBox.element); - await t.click(tagBox.element); - - await testScreenshot(t, takeScreenshot, screenshotName); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await setStyleAttribute(Selector('#container'), 'top: 250px;'); - - return createWidget('dxTagBox', { - width: 200, - label: 'Label text', - labelMode, - stylingMode, - dataSource: { - load() { - return new Promise((resolve) => { - resolve([ - { text: 'item_1' }, - { text: 'item_2' }, - { text: 'item_3' }, - { text: 'item_4' }, - ]); - }); - }, - paginate: true, - pageSize: 20, - }, - }); - }); - }); -}); diff --git a/packages/testcafe-models/dateRangeBox/index.ts b/packages/testcafe-models/dateRangeBox/index.ts deleted file mode 100644 index 435613024d12..000000000000 --- a/packages/testcafe-models/dateRangeBox/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Selector } from 'testcafe'; -import type { WidgetName } from '../types'; -import Widget from '../internal/widget'; -import DateBox from '../dateBox'; -import Calendar from '../calendar'; -import Popup from '../popup'; - -const CLASS = { - popup: 'dx-popup', - calendar: 'dx-calendar', - calendarCellClass: 'dx-calendar-cell', - startDateDateBox: 'dx-start-datebox', - endDateDateBox: 'dx-end-datebox', - dropDownButton: 'dx-dropdowneditor-button', - clearButton: 'dx-clear-button-area', - buttonsContainer: 'dx-texteditor-buttons-container', - doneButton: 'dx-popup-done', - separator: 'dx-daterangebox-separator', -}; - -export default class DateRangeBox extends Widget { - dropDownButton: Selector; - - clearButton: Selector; - - separator: Selector; - - constructor(id: string | Selector) { - super(id); - - this.dropDownButton = this.element.find(`.${CLASS.dropDownButton}`); - this.separator = this.element.find(`.${CLASS.separator}`); - this.clearButton = this.element.find(`.${CLASS.buttonsContainer}`).find(`.${CLASS.clearButton}`); - } - - // eslint-disable-next-line class-methods-use-this - getName(): WidgetName { return 'dxDateRangeBox'; } - - getPopup(): Popup { - return new Popup(this.getStartDateBox().element.find(`.${CLASS.popup}`)); - } - - // eslint-disable-next-line class-methods-use-this - getCalendar(): Calendar { - return new Calendar(this.getPopup().getContent().find(`.${CLASS.calendar}`)); - } - - getCalendarCell(index: number): Selector { - return Selector(this.getCalendar().element.find(`.${CLASS.calendarCellClass}`)).nth(index); - } - - getStartDateBox(): DateBox { - return new DateBox(this.element.find(`.${CLASS.startDateDateBox}`)); - } - - getEndDateBox(): DateBox { - return new DateBox(this.element.find(`.${CLASS.endDateDateBox}`)); - } -} diff --git a/packages/testcafe-models/lookup.ts b/packages/testcafe-models/lookup.ts deleted file mode 100644 index 918788b273d4..000000000000 --- a/packages/testcafe-models/lookup.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Selector } from 'testcafe'; -import type { WidgetName } from './types'; -import DropDownList from './internal/dropDownList'; - -const CLASS = { - inputField: 'dx-lookup-field', -}; - -export default class Lookup extends DropDownList { - // eslint-disable-next-line class-methods-use-this - getName(): WidgetName { return 'dxLookup'; } - - // eslint-disable-next-line class-methods-use-this - getInput(): Selector { - return Selector(`.${CLASS.inputField}`); - } -}