diff --git a/e2e/playwright/README.md b/e2e/playwright/README.md index 5891f87c6999..455688a952e1 100644 --- a/e2e/playwright/README.md +++ b/e2e/playwright/README.md @@ -52,11 +52,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 +239,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`. @@ -202,5 +265,15 @@ the observer runs. 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/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/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/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..c3d8cf2b6a08 --- /dev/null +++ b/e2e/playwright/tests/editors/dropDownButton/popup.spec.ts @@ -0,0 +1,28 @@ +import type { Locator } from '@playwright/test'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import DropDownButton from '../../../models/dropDownButton'; + +const getLeft = (locator: Locator): Promise => locator.evaluate( + (element) => element.getBoundingClientRect().left, +); + +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 dropDownButtonLeft = await getLeft(dropDownButton.element); + const popupContentLeft = await getLeft(popupContent); + + return Math.abs(dropDownButtonLeft - popupContentLeft); + }).toBeLessThan(1); + }); +}); 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..b98239194056 --- /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('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.describe(() => { + test.use({ theme: 'material.blue.light' }); + + 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..24d04eeb10ce --- /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 expect.poll(() => isDataSourceLoading(page)).toBe(false); + + 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(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/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/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}`); - } -}