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/helpers/domUtils.ts b/e2e/playwright/helpers/domUtils.ts index 02145bde32ab..6beafa0b5401 100644 --- a/e2e/playwright/helpers/domUtils.ts +++ b/e2e/playwright/helpers/domUtils.ts @@ -165,6 +165,26 @@ export const addFocusableElementBefore = async ( { selector: targetSelector, id: elementId }, ); +export const addFocusableElementAfter = async ( + page: Page, + targetSelector: string, + elementId = 'focusable-end', +): Promise => page.evaluate( + ({ selector, id }) => { + document.getElementById(id)?.remove(); + + const target = document.querySelector(selector); + const button = document.createElement('button'); + + button.id = id; + button.textContent = 'End'; + target?.parentElement?.insertBefore(button, target.nextElementSibling); + + return button.id; + }, + { selector: targetSelector, id: elementId }, +); + export const waitForNextFrame = async (page: Page): Promise => page.evaluate( () => new Promise((resolve) => { requestAnimationFrame(() => requestAnimationFrame(() => resolve())); 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/fileUploader/fileContent.ts b/e2e/playwright/models/fileUploader/fileContent.ts new file mode 100644 index 000000000000..0a030eb0248e --- /dev/null +++ b/e2e/playwright/models/fileUploader/fileContent.ts @@ -0,0 +1,34 @@ +import type { Locator, Page } from '@playwright/test'; +import Button from '../button'; + +const CLASS = { + cancelButton: 'dx-fileuploader-cancel-button', + fileName: 'dx-fileuploader-file-name', + fileSize: 'dx-fileuploader-file-size', + statusMessage: 'dx-fileuploader-file-status-message', +}; + +export default class FileContent { + public static className = 'dx-fileuploader-file-container'; + + public readonly element: Locator; + + public readonly cancelButton: Button; + + public readonly fileName: Locator; + + public readonly fileSize: Locator; + + public readonly statusMessage: Locator; + + public readonly validationMessage: Locator; + + constructor(page: Page, element: Locator) { + this.element = element; + this.cancelButton = new Button(page, element.locator(`.${CLASS.cancelButton}`)); + this.fileName = element.locator(`.${CLASS.fileName}`); + this.fileSize = element.locator(`.${CLASS.fileSize}`); + this.statusMessage = element.locator(`.${CLASS.statusMessage}`); + this.validationMessage = this.statusMessage.locator('> span'); + } +} diff --git a/e2e/playwright/models/fileUploader/index.ts b/e2e/playwright/models/fileUploader/index.ts new file mode 100644 index 000000000000..e312964fcc81 --- /dev/null +++ b/e2e/playwright/models/fileUploader/index.ts @@ -0,0 +1,31 @@ +import type { Locator, Page } from '@playwright/test'; +import type { WidgetName } from '../types'; +import Widget from '../internal/widget'; +import FileContent from './fileContent'; + +const CLASS = { + input: 'dx-fileuploader-input', + filesContainer: 'dx-fileuploader-files-container', +}; + +export default class FileUploader extends Widget { + public static className = 'dx-fileuploader'; + + public readonly input: Locator; + + public readonly files: Locator; + + constructor(page: Page, selector: Locator | string) { + super(page, selector); + + this.input = this.element.locator(`.${CLASS.input}`); + this.files = this.element.locator(`.${CLASS.filesContainer} .${FileContent.className}`); + } + + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxFileUploader'; } + + public getFile(index = 0): FileContent { + return new FileContent(this.page, this.files.nth(index)); + } +} diff --git a/e2e/playwright/models/htmlEditor/aiDialog.ts b/e2e/playwright/models/htmlEditor/aiDialog.ts new file mode 100644 index 000000000000..a0b64680c80d --- /dev/null +++ b/e2e/playwright/models/htmlEditor/aiDialog.ts @@ -0,0 +1,48 @@ +import type { Page } from '@playwright/test'; +import Button from '../button'; +import Popup from '../popup'; +import TextArea from '../textArea'; + +const CLASS = { + wrapper: 'dx-aidialog', + bottomToolbar: 'dx-popup-bottom', + button: 'dx-button', + menuButton: 'dx-dropdownmenu-button', + textArea: 'dx-textarea', +}; + +export default class AIDialog extends Popup { + constructor(page: Page) { + super(page, `${Popup.className}.${CLASS.wrapper}`); + } + + private getFooterButton(index: number): Button { + return new Button( + this.page, + this.element.locator(`.${CLASS.bottomToolbar} .${CLASS.button}`).nth(index), + ); + } + + public getGenerateButton(): Button { + return this.getFooterButton(0); + } + + public getCancelButton(): Button { + return this.getFooterButton(0); + } + + public getSplitButton(): Button { + return this.getFooterButton(3); + } + + public getMenuButton(): Button { + return new Button( + this.page, + this.element.locator(`.${CLASS.bottomToolbar} .${CLASS.menuButton}`), + ); + } + + public getPromptTextArea(): TextArea { + return new TextArea(this.page, this.element.locator(`.${CLASS.textArea}`).first()); + } +} diff --git a/e2e/playwright/models/htmlEditor/dialog.ts b/e2e/playwright/models/htmlEditor/dialog.ts new file mode 100644 index 000000000000..c9345cc479d5 --- /dev/null +++ b/e2e/playwright/models/htmlEditor/dialog.ts @@ -0,0 +1,46 @@ +import type { Locator, Page } from '@playwright/test'; +import Button from '../button'; +import FileUploader from '../fileUploader'; +import Popup from '../popup'; +import TextBox from '../textBox'; + +const CLASS = { + wrapper: 'dx-formdialog', + tab: 'dx-tab', + bottomToolbar: 'dx-popup-bottom', + button: 'dx-button', + form: 'dx-formdialog-form', + textBox: 'dx-textbox', + buttonGroup: 'dx-buttongroup', +}; + +export default class Dialog extends Popup { + public readonly form: Locator; + + public readonly addButton: Button; + + public readonly cancelButton: Button; + + public readonly fileUploader: FileUploader; + + public readonly url: TextBox; + + public readonly lockButton: Button; + + constructor(page: Page) { + super(page, `${Popup.className}.${CLASS.wrapper}`); + + const footerButtons = this.element.locator(`.${CLASS.bottomToolbar} .${CLASS.button}`); + + this.form = this.element.locator(`.${CLASS.form}`); + this.addButton = new Button(page, footerButtons.nth(0)); + this.cancelButton = new Button(page, footerButtons.nth(1)); + this.fileUploader = new FileUploader(page, this.form.locator(`.${FileUploader.className}`)); + this.url = new TextBox(page, this.form.locator(`.${CLASS.textBox}:has(input[name="src"])`)); + this.lockButton = new Button(page, this.form.locator(`.${CLASS.buttonGroup} .${CLASS.button}`)); + } + + public getTab(index: number): Locator { + return this.element.locator(`.${CLASS.tab}`).nth(index); + } +} diff --git a/e2e/playwright/models/htmlEditor/index.ts b/e2e/playwright/models/htmlEditor/index.ts new file mode 100644 index 000000000000..620e09159e08 --- /dev/null +++ b/e2e/playwright/models/htmlEditor/index.ts @@ -0,0 +1,49 @@ +import type { Locator, Page } from '@playwright/test'; +import { expect } from '@playwright/test'; +import type { WidgetName } from '../types'; +import Widget from '../internal/widget'; +import Button from '../button'; +import AIDialog from './aiDialog'; +import Dialog from './dialog'; + +const CLASS = { + content: 'dx-htmleditor-content', + toolbar: 'dx-htmleditor-toolbar', +}; + +type ToolbarItemName = 'image' | 'color' | 'link' | 'ai' | 'bold'; + +export default class HtmlEditor extends Widget { + public readonly content: Locator; + + public readonly dialog: Dialog; + + public readonly aiDialog: AIDialog; + + constructor(page: Page, selector: Locator | string) { + super(page, selector); + + this.content = this.element.locator(`.${CLASS.content}`); + this.dialog = new Dialog(page); + this.aiDialog = new AIDialog(page); + } + + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxHtmlEditor'; } + + public async expectImageLoaded(src?: string): Promise { + const image = this.content.locator('img'); + + if (src !== undefined) { + await expect(image).toHaveAttribute('src', src); + } + + await expect.poll(() => image.evaluate( + (element: HTMLImageElement) => element.complete && element.naturalWidth > 0, + )).toBe(true); + } + + public getToolbarItem(name: ToolbarItemName): Button { + return new Button(this.page, this.element.locator(`.${CLASS.toolbar} .dx-${name}-format`)); + } +} 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/container.html b/e2e/playwright/tests/container.html index 7207c8b44dc1..e86e1b10aeea 100644 --- a/e2e/playwright/tests/container.html +++ b/e2e/playwright/tests/container.html @@ -16,6 +16,7 @@ + diff --git a/e2e/playwright/tests/editors/chat/data/index.ts b/e2e/playwright/tests/editors/chat/data/index.ts new file mode 100644 index 000000000000..5a7471bdddb6 --- /dev/null +++ b/e2e/playwright/tests/editors/chat/data/index.ts @@ -0,0 +1,10 @@ +export const lineBreaks = '\n\n'; + +export const getLongText = (useLineBreaks = false, length = 1): string => { + const UUID = '9138cf2e-ced3-426a-bb53-4478536f690b'; + const longItem = '1826403415222858765740359115719081097182452189907242163763639765588452014727158270738379423360950761826403415222858765740359115719081097182452189907'; + const longItemArray = Array(length).fill(longItem); + const longString = longItemArray.join(''); + + return `${UUID}:${useLineBreaks ? lineBreaks : ''}${longString}`; +}; 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/fileManager/common.spec.ts b/e2e/playwright/tests/editors/fileManager/common.spec.ts new file mode 100644 index 000000000000..91289dc84da7 --- /dev/null +++ b/e2e/playwright/tests/editors/fileManager/common.spec.ts @@ -0,0 +1,17 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; + +test.describe('FileManager', () => { + test('Custom DropDown width for Material and Fluent themes', async ({ page }) => { + await createWidget(page, 'dxFileManager', { + name: 'fileManager', + fileSystemProvider: [], + height: 450, + }); + + await page.locator('.dx-filemanager-toolbar-viewmode-item').click(); + + await testScreenshot(page, 'drop down width.png', { element: '#container' }); + }); +}); diff --git a/e2e/testcafe-devextreme/tests/editors/fileUploader/images/test-image-1.png b/e2e/playwright/tests/editors/fileUploader/images/test-image-1.png similarity index 100% rename from e2e/testcafe-devextreme/tests/editors/fileUploader/images/test-image-1.png rename to e2e/playwright/tests/editors/fileUploader/images/test-image-1.png diff --git a/e2e/playwright/tests/editors/fileUploader/index.spec.ts b/e2e/playwright/tests/editors/fileUploader/index.spec.ts new file mode 100644 index 000000000000..a56183b072d2 --- /dev/null +++ b/e2e/playwright/tests/editors/fileUploader/index.spec.ts @@ -0,0 +1,42 @@ +import path from 'node:path'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; +import FileUploader from '../../../models/fileUploader'; + +const TEST_FILE = path.join(__dirname, 'images', 'test-image-1.png'); +const LONG_LABEL_TEXT = 'Drag a file from your computer and drop it here, or click the button to choose one'; + +test.describe('FileUploader - file list visibility', () => { + [true, false].forEach((showFileList) => { + test(`FileUploader with showFileList: ${showFileList} - after file selected`, async ({ page }) => { + await createWidget(page, 'dxFileUploader', { showFileList }); + + const fileUploader = new FileUploader(page, '#container'); + + await fileUploader.input.setInputFiles(TEST_FILE); + + if (showFileList) { + await expect(fileUploader.getFile().statusMessage).toHaveText('Upload failed'); + } + + await testScreenshot(page, `fileuploader-show-filelist-${showFileList}.png`, { + element: '#container', + }); + + await fileUploader.input.setInputFiles([]); + }); + }); +}); + +test.describe('FileUploader - label', () => { + [false, true].forEach((rtlEnabled) => { + test(`FileUploader label should not be cut while there is free space, rtlEnabled: ${rtlEnabled} (T1337565)`, async ({ page }) => { + await createWidget(page, 'dxFileUploader', { labelText: LONG_LABEL_TEXT, rtlEnabled }); + + await testScreenshot(page, `fileuploader-long-label-rtl-${rtlEnabled}.png`, { + element: '#container', + }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/htmlEditor/common.spec.ts b/e2e/playwright/tests/editors/htmlEditor/common.spec.ts new file mode 100644 index 000000000000..26e6ecec1e34 --- /dev/null +++ b/e2e/playwright/tests/editors/htmlEditor/common.spec.ts @@ -0,0 +1,64 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import HtmlEditor from '../../../models/htmlEditor'; + +const MENU_ITEM_CLASS = 'dx-menu-item'; +const SUBMENU_CLASS = 'dx-submenu'; + +test.describe('HtmlEditor', () => { + [false, true].forEach((toolbar) => { + const selector = toolbar ? '#otherContainer' : '#container'; + const clickTarget = toolbar ? '#otherContainer .dx-bold-format' : '#container'; + const baseScreenName = toolbar ? 'htmleditor-with-toolbar' : 'htmleditor-without-toolbar'; + + test(`T1025549 - ${baseScreenName}`, async ({ page }) => { + await setStyleAttribute(page, '#container', 'box-sizing: border-box; height: 200px; width: 200px'); + await setStyleAttribute(page, '#otherContainer', 'box-sizing: border-box; height: 200px; width: 200px'); + await appendElementTo(page, '#container', 'div', 'editor'); + await appendElementTo(page, '#otherContainer', 'div', 'editorWithToolbar'); + + await createWidget(page, 'dxHtmlEditor', { + height: 200, + width: '100%', + value: Array(100).fill('string').join('\n'), + }, '#editor'); + + await createWidget(page, 'dxHtmlEditor', { + height: 200, + width: '100%', + value: Array(100).fill('string').join('\n'), + toolbar: { + items: ['bold', 'color'], + }, + }, '#editorWithToolbar'); + + await testScreenshot(page, `${baseScreenName}.png`, { element: selector }); + + await page.locator(clickTarget).click(); + + await testScreenshot(page, `${baseScreenName}-focused.png`, { element: selector }); + }); + }); + + test('AI toolbar item', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 500, + width: 350, + aiIntegration: {}, + toolbar: { + items: ['ai'], + }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + + await testScreenshot(page, 'htmleditor-ai-toolbar-item.png', { element: '#container' }); + + await htmlEditor.getToolbarItem('ai').element.click(); + await page.locator(`.${SUBMENU_CLASS} .${MENU_ITEM_CLASS}`).nth(5).click(); + + await testScreenshot(page, 'htmleditor-ai-toolbar-item-expanded.png', { element: '#container' }); + }); +}); diff --git a/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/addImageFromDevice.spec.ts b/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/addImageFromDevice.spec.ts new file mode 100644 index 000000000000..ab71fda10cca --- /dev/null +++ b/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/addImageFromDevice.spec.ts @@ -0,0 +1,104 @@ +import path from 'node:path'; +import { expect, test } from '../../../../../fixtures'; +import { createWidget } from '../../../../../helpers/createWidget'; +import { testScreenshot } from '../../../../../helpers/screenshots'; +import HtmlEditor from '../../../../../models/htmlEditor'; + +const TEST_IMAGE_PATH_1 = path.join(__dirname, 'images', 'test-image-1.png'); +const TEST_IMAGE_PATH_2 = path.join(__dirname, 'images', 'test-image-2.png'); + +test.describe('HtmlEditor - upload image from device', () => { + test('Image from device should be inserted', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + imageUpload: { + tabs: ['file'], + }, + toolbar: { items: ['image'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + const { dialog } = htmlEditor; + const { fileUploader } = dialog; + + await htmlEditor.getToolbarItem('image').element.click(); + + await dialog.addButton.expectDisabled(); + + await fileUploader.input.setInputFiles(TEST_IMAGE_PATH_1); + + const file = fileUploader.getFile(); + + await expect(file.fileName).toHaveText('test-image-1.png'); + await expect(file.fileSize).toHaveText('7 KB'); + await expect(file.statusMessage).toHaveText('Ready to upload'); + + await file.cancelButton.element.click(); + + await expect(fileUploader.files).toHaveCount(0); + await dialog.addButton.expectDisabled(); + + await fileUploader.input.setInputFiles(TEST_IMAGE_PATH_2); + + await testScreenshot(page, 'editor-before-click-add-button-from-device.png'); + + await dialog.addButton.expectDisabled(false); + + await dialog.addButton.element.click(); + + await htmlEditor.expectImageLoaded(); + + await testScreenshot(page, 'editor-after-add-image-from-device.png', { element: htmlEditor.content }); + }); + + test('Image should be validated and inserted from device', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + imageUpload: { + tabs: ['file'], + fileUploaderOptions: { + maxFileSize: 8500, + }, + }, + toolbar: { items: ['image'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + const { dialog } = htmlEditor; + const { fileUploader } = dialog; + + await htmlEditor.getToolbarItem('image').element.click(); + + await fileUploader.input.setInputFiles(TEST_IMAGE_PATH_2); + + const file = fileUploader.getFile(); + + await expect(file.fileName).toHaveText('test-image-2.png'); + await expect(file.fileSize).toHaveText('10 KB'); + await expect(file.validationMessage).toHaveText('File is too large'); + + await file.cancelButton.element.click(); + + await expect(fileUploader.files).toHaveCount(0); + + await dialog.addButton.expectDisabled(); + + await fileUploader.input.setInputFiles(TEST_IMAGE_PATH_1); + + await expect(file.fileName).toHaveText('test-image-1.png'); + await expect(file.fileSize).toHaveText('7 KB'); + await expect(file.statusMessage).toHaveText('Ready to upload'); + + await testScreenshot(page, 'editor-before-click-add-button-and-validation.png'); + + await dialog.addButton.expectDisabled(false); + + await dialog.addButton.element.click(); + + await htmlEditor.expectImageLoaded(); + + await testScreenshot(page, 'editor-after-click-add-button-and-validation.png', { element: htmlEditor.content }); + }); +}); diff --git a/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/addImageUrl.spec.ts b/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/addImageUrl.spec.ts new file mode 100644 index 000000000000..d5a208ecf4f9 --- /dev/null +++ b/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/addImageUrl.spec.ts @@ -0,0 +1,120 @@ +import { expect, test } from '../../../../../fixtures'; +import { createWidget } from '../../../../../helpers/createWidget'; +import { testScreenshot } from '../../../../../helpers/screenshots'; +import { isMaterial } from '../../../../../helpers/themeUtils'; +import HtmlEditor from '../../../../../models/htmlEditor'; +import { BASE64_IMAGE_1, BASE64_IMAGE_2 } from './images/base64'; + +const ADD_IMAGE_POPUP_CONTENT_SELECTOR = '.dx-htmleditor-add-image-popup .dx-overlay-content'; + +test.describe('HtmlEditor - add image url', () => { + test('Image uploader from url appearance', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + toolbar: { items: ['image'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + const { dialog } = htmlEditor; + + await htmlEditor.getToolbarItem('image').element.click(); + + await dialog.lockButton.element.click(); + + await dialog.url.element.click(); + + await testScreenshot(page, 'Image uploader from url appearance.png', { element: ADD_IMAGE_POPUP_CONTENT_SELECTOR }); + }); + + test('Image url should be validate before wil be inserted by add button click', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + imageUpload: { + tabs: ['url'], + }, + toolbar: { items: ['image'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + const { dialog } = htmlEditor; + + await htmlEditor.getToolbarItem('image').element.click(); + await dialog.addButton.element.click(); + + await dialog.url.expectClass('dx-invalid'); + + await dialog.url.input.fill(BASE64_IMAGE_1); + await dialog.addButton.element.click(); + + await htmlEditor.expectImageLoaded(); + + await testScreenshot(page, 'add-validated-url-image-by-click.png', { element: htmlEditor.content }); + }); + + test('Image url should be validate before wil be inserted by add enter press', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + imageUpload: { + tabs: ['url'], + }, + toolbar: { items: ['image'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + const { dialog } = htmlEditor; + + await htmlEditor.getToolbarItem('image').element.click(); + + await page.keyboard.press('Enter'); + + await dialog.url.expectClass('dx-invalid'); + + await dialog.url.input.fill(BASE64_IMAGE_1); + await page.keyboard.press('Enter'); + + await htmlEditor.expectImageLoaded(); + + await testScreenshot(page, 'editor-add-validated-url-image-by-enter.png', { element: htmlEditor.content }); + }); + + test('Image url should be updated', async ({ page, theme }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + imageUpload: { + tabs: ['url'], + }, + toolbar: { items: ['image'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + const { dialog } = htmlEditor; + + await htmlEditor.getToolbarItem('image').element.click(); + + await expect(dialog.addButton.text) + .toHaveText(isMaterial(theme) ? 'ADD' : 'Add', { useInnerText: true }); + + await dialog.url.input.fill(BASE64_IMAGE_1); + await dialog.addButton.element.click(); + + await htmlEditor.expectImageLoaded(BASE64_IMAGE_1); + + await testScreenshot(page, 'editor-add-url-image-before-updated.png', { element: htmlEditor.content }); + + await htmlEditor.getToolbarItem('image').element.click(); + + await expect(dialog.addButton.text) + .toHaveText(isMaterial(theme) ? 'UPDATE' : 'Update', { useInnerText: true }); + + await dialog.url.input.fill(BASE64_IMAGE_2); + await dialog.addButton.element.click(); + + await htmlEditor.expectImageLoaded(BASE64_IMAGE_2); + + await testScreenshot(page, 'editor-add-url-image-after-updated.png', { element: htmlEditor.content }); + }); +}); diff --git a/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/common.spec.ts b/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/common.spec.ts new file mode 100644 index 000000000000..93b2de0f16c0 --- /dev/null +++ b/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/common.spec.ts @@ -0,0 +1,146 @@ +import path from 'node:path'; +import { test } from '../../../../../fixtures'; +import { createWidget } from '../../../../../helpers/createWidget'; +import { testScreenshot } from '../../../../../helpers/screenshots'; +import HtmlEditor from '../../../../../models/htmlEditor'; +import { BASE64_IMAGE_1 } from './images/base64'; + +const TEST_IMAGE_PATH_1 = path.join(__dirname, 'images', 'test-image-1.png'); + +const ADD_IMAGE_POPUP_CONTENT_SELECTOR = '.dx-htmleditor-add-image-popup .dx-overlay-content'; +const LONG_FILE_UPLOADER_LABEL_TEXT = 'Drop an image here or click the button to browse'; + +test.describe('HtmlEditor - common', () => { + test('TabPanel in HtmlEditor must have correct borders', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + imageUpload: { + tabs: ['file', 'url'], + }, + toolbar: { items: ['image'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + + await htmlEditor.getToolbarItem('image').element.click(); + + await testScreenshot(page, 'tabpanel-in-htmleditor.png', { + element: ADD_IMAGE_POPUP_CONTENT_SELECTOR, + }); + }); + + test('File uploader label container should keep the full dialog width', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + imageUpload: { + tabs: ['file'], + fileUploaderOptions: { + labelText: LONG_FILE_UPLOADER_LABEL_TEXT, + }, + }, + toolbar: { items: ['image'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + + await htmlEditor.getToolbarItem('image').element.click(); + + await testScreenshot(page, 'htmleditor-add-image-long-file-uploader-label.png', { + element: ADD_IMAGE_POPUP_CONTENT_SELECTOR, + }); + }); + + test('Add button should be enabled after switch to url form', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + imageUpload: { + tabs: ['file', 'url'], + }, + toolbar: { items: ['image'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + const { dialog } = htmlEditor; + + await htmlEditor.getToolbarItem('image').element.click(); + + await dialog.addButton.expectDisabled(); + + await dialog.getTab(1).click(); + + await dialog.addButton.expectDisabled(false); + + await dialog.url.input.fill(BASE64_IMAGE_1); + await dialog.addButton.element.click(); + }); + + test('Add button should be disable after switch to image upload form', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + imageUpload: { + tabs: ['url', 'file'], + }, + toolbar: { items: ['image'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + const { dialog } = htmlEditor; + + await htmlEditor.getToolbarItem('image').element.click(); + + await dialog.addButton.expectDisabled(false); + + await dialog.addButton.element.click(); + + await dialog.url.expectClass('dx-invalid'); + + await dialog.getTab(1).click(); + + await dialog.addButton.expectDisabled(); + + await dialog.fileUploader.input.setInputFiles(TEST_IMAGE_PATH_1); + + await dialog.addButton.expectDisabled(false); + + await dialog.addButton.element.click(); + }); + + test('AddImage form shouldn\'t lead to side effects in other forms', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 800, + imageUpload: { + tabs: ['file', 'url'], + }, + toolbar: { items: ['image', 'link', 'color'] }, + }); + + const htmlEditor = new HtmlEditor(page, '#container'); + const { dialog } = htmlEditor; + + await htmlEditor.getToolbarItem('image').element.click(); + + await dialog.addButton.expectDisabled(); + await dialog.cancelButton.expectDisabled(false); + + await dialog.cancelButton.element.click(); + + await htmlEditor.getToolbarItem('link').element.click(); + + await dialog.addButton.expectDisabled(false); + await dialog.cancelButton.expectDisabled(false); + + await dialog.addButton.element.click(); + + await htmlEditor.getToolbarItem('color').element.click(); + + await dialog.addButton.expectDisabled(false); + await dialog.cancelButton.expectDisabled(false); + + await dialog.cancelButton.element.click(); + }); +}); diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/images/base64.ts b/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/images/base64.ts similarity index 100% rename from e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/images/base64.ts rename to e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/images/base64.ts diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/images/test-image-1.png b/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/images/test-image-1.png similarity index 100% rename from e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/images/test-image-1.png rename to e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/images/test-image-1.png diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/images/test-image-2.png b/e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/images/test-image-2.png similarity index 100% rename from e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/images/test-image-2.png rename to e2e/playwright/tests/editors/htmlEditor/dialogs/addImage/images/test-image-2.png diff --git a/e2e/playwright/tests/editors/htmlEditor/dialogs/aiDialog/common.spec.ts b/e2e/playwright/tests/editors/htmlEditor/dialogs/aiDialog/common.spec.ts new file mode 100644 index 000000000000..7492a5ff43df --- /dev/null +++ b/e2e/playwright/tests/editors/htmlEditor/dialogs/aiDialog/common.spec.ts @@ -0,0 +1,254 @@ +import type { Page } from '@playwright/test'; +import { test } from '../../../../../fixtures'; +import { createWidget } from '../../../../../helpers/createWidget'; +import { insertStylesheetRulesToPage } from '../../../../../helpers/domUtils'; +import { testScreenshot } from '../../../../../helpers/screenshots'; +import HtmlEditor from '../../../../../models/htmlEditor'; +import { getLongText } from '../../../chat/data'; + +const MENU_ITEM_CLASS = 'dx-menu-item'; +const SUBMENU_CLASS = 'dx-submenu'; +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 longResult = getLongText(false, 10); + +interface AICallbacks { + onComplete: (result: string) => void; + onError: () => void; +} + +const openAIDialog = async ( + page: Page, + command: number, + option?: number, +): Promise => { + const htmlEditor = new HtmlEditor(page, '#container'); + const commandItem = page.locator(`.${SUBMENU_CLASS} .${MENU_ITEM_CLASS}`).nth(command); + + await htmlEditor.getToolbarItem('ai').element.click(); + await commandItem.click(); + + if (option !== undefined) { + await commandItem.locator(`.${SUBMENU_CLASS} .${MENU_ITEM_CLASS}`).first().click(); + } + + return htmlEditor; +}; + +test.describe('HtmlEditor: AIDialog', () => { + [ + { name: 'with-no-options', command: 0, option: undefined }, + { name: 'with-options', command: 4, option: 0 }, + ].forEach(({ name, command, option }) => { + test(`initial state ${name}`, async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 900, + aiIntegration: {}, + toolbar: { + items: ['ai'], + }, + }); + + await openAIDialog(page, command, option); + await testScreenshot(page, `htmleditor-ai-dialog-initial-state-${name}.png`, { element: '#container' }); + }); + }); + + test('resize window when initial state', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + aiIntegration: {}, + toolbar: { + items: ['ai'], + }, + }); + + const htmlEditor = await openAIDialog(page, 0); + + await page.setViewportSize({ width: 400, height: 600 }); + + await htmlEditor.aiDialog.getMenuButton().element.click(); + await testScreenshot(page, 'htmleditor-ai-dialog-initial-state-resize-window.png', { element: '#container' }); + }); + + test('generating state', async ({ page }) => { + await insertStylesheetRulesToPage(page, ` + .${LOADINDICATOR_SEGMENT_CLASS}, + .${LOADINDICATOR_CONTENT_CLASS}, + .${LOADINDICATOR_ICON_CLASS}, + .${LOADINDICATOR_SEGMENT_INNER_CLASS} { + animation: none !important; + opacity: 1 !important; + } + + .${LOADINDICATOR_SEGMENT_CLASS} { + transform: scale(1) !important; + } + `); + + await createWidget(page, 'dxHtmlEditor', () => ({ + height: 600, + width: 900, + aiIntegration: { + changeStyle() {}, + }, + toolbar: { + items: ['ai'], + }, + })); + + await openAIDialog(page, 4, 0); + await testScreenshot(page, 'htmleditor-ai-dialog-generating-state.png', { element: '#container' }); + }); + + [ + { + name: 'short-result', + result: 'result', + }, + { + name: 'long-result', + result: longResult, + }, + ].forEach(({ name, result }) => { + test(`resultReady state with ${name}`, async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', (aiResult) => ({ + height: 600, + width: 900, + aiIntegration: { + result: aiResult, + changeStyle(_: unknown, { onComplete }: AICallbacks) { onComplete(this.result); }, + }, + toolbar: { + items: ['ai'], + }, + }), '#container', { arg: result }); + + const htmlEditor = await openAIDialog(page, 4, 0); + + await htmlEditor.aiDialog.getSplitButton().element.click(); + + await testScreenshot(page, `htmleditor-ai-dialog-result-ready-state-with-${name}.png`, { element: '#container' }); + }); + }); + + test('asking state', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 600, + width: 900, + aiIntegration: {}, + toolbar: { + items: ['ai'], + }, + }); + + await openAIDialog(page, 7); + await testScreenshot(page, 'htmleditor-ai-dialog-asking-state.png', { element: '#container' }); + }); + + test('askAI result ready state', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', (aiResult) => ({ + height: 600, + width: 900, + aiIntegration: { + result: aiResult, + execute(_: unknown, { onComplete }: AICallbacks) { onComplete(this.result); }, + }, + toolbar: { + items: ['ai'], + }, + }), '#container', { arg: longResult }); + + const htmlEditor = await openAIDialog(page, 7); + const { aiDialog } = htmlEditor; + + await aiDialog.getPromptTextArea().input.pressSequentially('request'); + await aiDialog.getGenerateButton().element.click(); + + await testScreenshot(page, 'htmleditor-ai-dialog-ask-ai-result-ready-state.png', { element: '#container' }); + }); + + test('result ready after canceletion', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', () => ({ + height: 600, + width: 900, + aiIntegration: { + summarize() { return () => {}; }, + }, + toolbar: { + items: ['ai'], + }, + })); + + const htmlEditor = await openAIDialog(page, 0); + + await htmlEditor.aiDialog.getCancelButton().element.click(); + + await testScreenshot(page, 'htmleditor-ai-dialog-result-ready-after-canceletion.png', { element: '#container' }); + }); + + test('error state', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', () => ({ + height: 600, + width: 900, + aiIntegration: { + summarize(_: unknown, { onError }: AICallbacks) { onError(); }, + }, + toolbar: { + items: ['ai'], + }, + })); + + await openAIDialog(page, 0); + await testScreenshot(page, 'htmleditor-ai-dialog-error-state.png', { element: '#container' }); + }); + + test.describe('small screen', () => { + test.use({ browserSize: [400, 700] }); + + ['initial', 'generating', 'result-ready', 'error'].forEach((state) => { + test(`${state} state on small screen`, async ({ page }) => { + await insertStylesheetRulesToPage(page, ` + .${LOADINDICATOR_SEGMENT_CLASS}, + .${LOADINDICATOR_CONTENT_CLASS}, + .${LOADINDICATOR_ICON_CLASS}, + .${LOADINDICATOR_SEGMENT_INNER_CLASS} { + animation: none !important; + opacity: 1 !important; + } + `); + + await createWidget(page, 'dxHtmlEditor', ({ aiState, aiResult }) => { + const configurations = { + initial: {}, + generating: { + summarize() {}, + }, + 'result-ready': { + result: aiResult, + summarize(_: unknown, { onComplete }: AICallbacks) { onComplete(this.result); }, + }, + error: { + summarize(_: unknown, { onError }: AICallbacks) { onError(); }, + }, + }; + + return { + height: 700, + aiIntegration: { ...configurations[aiState as keyof typeof configurations] }, + toolbar: { + items: ['ai'], + }, + }; + }, '#container', { arg: { aiState: state, aiResult: longResult } }); + + await openAIDialog(page, 0); + await testScreenshot(page, `htmleditor-ai-dialog-${state}-state-on-small-screen.png`, { element: '#container' }); + }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/htmlEditor/format.spec.ts b/e2e/playwright/tests/editors/htmlEditor/format.spec.ts new file mode 100644 index 000000000000..4e3203cbd6b3 --- /dev/null +++ b/e2e/playwright/tests/editors/htmlEditor/format.spec.ts @@ -0,0 +1,36 @@ +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import SelectBox from '../../../models/selectBox'; + +test.describe('HtmlEditor - formats', () => { + test('HtmlEditor should keep actual format after "enter" key pressed (T922236)', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 400, + width: 200, + toolbar: { + items: [ + 'bold', + { + name: 'font', + acceptedValues: ['Arial', 'Terminal'], + }, + ], + }, + }); + + const selectBox = new SelectBox(page, '.dx-font-format'); + + await selectBox.element.click(); + + const list = await selectBox.getList(); + + await list.getItem().element.click(); + + await expect(selectBox.input).toHaveValue('Arial'); + + await page.keyboard.press('k'); + await page.keyboard.press('Enter'); + + await expect(selectBox.input).toHaveValue('Arial'); + }); +}); diff --git a/e2e/playwright/tests/editors/htmlEditor/keyboard.spec.ts b/e2e/playwright/tests/editors/htmlEditor/keyboard.spec.ts new file mode 100644 index 000000000000..528d81735c9c --- /dev/null +++ b/e2e/playwright/tests/editors/htmlEditor/keyboard.spec.ts @@ -0,0 +1,48 @@ +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { addFocusableElementAfter, addFocusableElementBefore } from '../../../helpers/domUtils'; +import HtmlEditor from '../../../models/htmlEditor'; + +test.describe('HtmlEditor - focus escape', () => { + test('Ctrl+Shift+Down should move focus to the next focusable element outside the editor', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { value: '

test

' }); + await addFocusableElementBefore(page, '#container'); + await addFocusableElementAfter(page, '#container'); + + const htmlEditor = new HtmlEditor(page, '#container'); + + await htmlEditor.content.click(); + await page.keyboard.press('Control+Shift+ArrowDown'); + + await expect(page.locator('#focusable-end')).toBeFocused(); + }); + + test('Ctrl+Shift+Up should move focus to the previous focusable element when there is no toolbar', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { value: '

test

' }); + await addFocusableElementBefore(page, '#container'); + await addFocusableElementAfter(page, '#container'); + + const htmlEditor = new HtmlEditor(page, '#container'); + + await htmlEditor.content.click(); + await page.keyboard.press('Control+Shift+ArrowUp'); + + await expect(page.locator('#focusable-start')).toBeFocused(); + }); + + test('Ctrl+Shift+Up should move focus into the toolbar when it is present', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + value: '

test

', + toolbar: { items: ['bold', 'italic'] }, + }); + await addFocusableElementBefore(page, '#container'); + await addFocusableElementAfter(page, '#container'); + + const htmlEditor = new HtmlEditor(page, '#container'); + + await htmlEditor.content.click(); + await page.keyboard.press('Control+Shift+ArrowUp'); + + await htmlEditor.getToolbarItem('bold').expectFocused(); + }); +}); diff --git a/e2e/playwright/tests/editors/htmlEditor/list.spec.ts b/e2e/playwright/tests/editors/htmlEditor/list.spec.ts new file mode 100644 index 000000000000..d38e6921d45e --- /dev/null +++ b/e2e/playwright/tests/editors/htmlEditor/list.spec.ts @@ -0,0 +1,64 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; + +const orderedListMarkup = ` +
    +
  1. Item 1 +
      +
    1. +
        +
      1. +
      +
    +
  2. +
  3. Item 2 +
      +
    1. +
        +
      1. +
      +
    +
  4. +
+`; + +const orderedListWithTextMarkup = ` +

Text

+
    +
  1. Text +
      +
    1. 1
    2. +
    3. 2
    4. +
    +
  2. +
  3. Text +
      +
    1. 1
    2. +
    3. 2
    4. +
    +
  4. +
+`; + +test.describe('HtmlEditor - lists', () => { + test('ordered list numbering sequence should reset for each list item (T1220554)', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 200, + width: 200, + value: orderedListMarkup, + }); + + await testScreenshot(page, 'htmleditor-ordered-list-appearance.png', { element: '#container' }); + }); + + test('should reset nested ordered list counters when preceded by text (T1320286)', async ({ page }) => { + await createWidget(page, 'dxHtmlEditor', { + height: 200, + width: 200, + value: orderedListWithTextMarkup, + }); + + await testScreenshot(page, 'htmleditor-ordered-list-text-appearance.png', { element: '#container' }); + }); +}); 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/fileManager/common.ts b/e2e/testcafe-devextreme/tests/editors/fileManager/common.ts deleted file mode 100644 index 11c4e065908c..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/fileManager/common.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import { Selector } from 'testcafe'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -fixture.disablePageReloads`FileManager` - .page(url(__dirname, '../../container.html')); - -test('Custom DropDown width for Material and Fluent themes', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const viewModeButton = Selector('.dx-filemanager-toolbar-viewmode-item'); - - await t - .click(viewModeButton); - - await testScreenshot(t, takeScreenshot, 'drop down width.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxFileManager', { - name: 'fileManager', - fileSystemProvider: [], - height: 450, -})); diff --git a/e2e/testcafe-devextreme/tests/editors/fileManager/etalons/drop down width (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/fileManager/etalons/drop down width (fluent-next.blue.light).png deleted file mode 100644 index e6bb18a1f58b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/fileManager/etalons/drop down width (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/fileManager/etalons/drop down width (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/fileManager/etalons/drop down width (fluent.blue.light).png deleted file mode 100644 index a60373215ff5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/fileManager/etalons/drop down width (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-false (fluent-next.blue.light).png deleted file mode 100644 index d314060650d3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-false (fluent.blue.light).png deleted file mode 100644 index 8ca45572db17..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-true (fluent-next.blue.light).png deleted file mode 100644 index 4bbbeedb4468..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-true (fluent.blue.light).png deleted file mode 100644 index 0cf28d73f9df..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-long-label-rtl-true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-false (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-false (fluent-next.blue.light).png deleted file mode 100644 index bbcccbf83ac2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-false (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-false (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-false (fluent.blue.light).png deleted file mode 100644 index 0113541cdb31..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-false (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-true (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-true (fluent-next.blue.light).png deleted file mode 100644 index 5ef3fb47b1af..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-true (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-true (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-true (fluent.blue.light).png deleted file mode 100644 index 8ee356dd125f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/fileUploader/etalons/fileuploader-show-filelist-true (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/fileUploader/index.ts b/e2e/testcafe-devextreme/tests/editors/fileUploader/index.ts deleted file mode 100644 index 8d3379593107..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/fileUploader/index.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import FileUploader from 'devextreme-testcafe-models/fileUploader'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { createWidget } from '../../../helpers/createWidget'; -import url from '../../../helpers/getPageUrl'; - -const TEST_FILE = './images/test-image-1.png'; -const LONG_LABEL_TEXT = 'Drag a file from your computer and drop it here, or click the button to choose one'; - -fixture`FileUploader - file list visibility` - .page(url(__dirname, '../../container.html')); - -[true, false].forEach((showFileList) => { - test(`FileUploader with showFileList: ${showFileList} - after file selected`, async (t) => { - const fileUploader = new FileUploader('#container'); - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await t.setFilesToUpload(fileUploader.input, [TEST_FILE]); - - await testScreenshot(t, takeScreenshot, `fileuploader-show-filelist-${showFileList}.png`, { - element: '#container', - }); - - await t.clearUpload(fileUploader.input); - - await t.expect(compareResults.isValid()).ok(compareResults.errorMessages()); - }).before(async () => createWidget('dxFileUploader', { showFileList })); -}); - -fixture`FileUploader - label` - .page(url(__dirname, '../../container.html')); - -[false, true].forEach((rtlEnabled) => { - test(`FileUploader label should not be cut while there is free space, rtlEnabled: ${rtlEnabled} (T1337565)`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `fileuploader-long-label-rtl-${rtlEnabled}.png`, { - element: '#container', - }); - - await t.expect(compareResults.isValid()).ok(compareResults.errorMessages()); - }).before(async () => createWidget('dxFileUploader', { labelText: LONG_LABEL_TEXT, rtlEnabled })); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/common.ts b/e2e/testcafe-devextreme/tests/editors/htmlEditor/common.ts deleted file mode 100644 index fbe4655f863b..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/htmlEditor/common.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import HtmlEditor from 'devextreme-testcafe-models/htmlEditor'; -import { Selector } from 'testcafe'; -import { createWidget } from '../../../helpers/createWidget'; -import url from '../../../helpers/getPageUrl'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; - -const MENU_ITEM_CLASS = 'dx-menu-item'; -const SUBMENU_CLASS = 'dx-submenu'; - -fixture`HtmlEditor` - .page(url(__dirname, '../../container-extended.html')); - -[false, true].forEach((toolbar) => { - const selector = toolbar ? '#otherContainer' : '#container'; - const clickTarget = toolbar ? '#otherContainer .dx-bold-format' : '#container'; - const baseScreenName = toolbar ? 'htmleditor-with-toolbar' : 'htmleditor-without-toolbar'; - - test(`T1025549 - ${baseScreenName}`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `${baseScreenName}.png`, { element: selector }); - - await t - .click(Selector(clickTarget)); - - await testScreenshot(t, takeScreenshot, `${baseScreenName}-focused.png`, { element: selector }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await setStyleAttribute(Selector('#container'), 'box-sizing: border-box; height: 200px; width: 200px'); - await setStyleAttribute(Selector('#otherContainer'), 'box-sizing: border-box; height: 200px; width: 200px'); - await appendElementTo('#container', 'div', 'editor'); - await appendElementTo('#otherContainer', 'div', 'editorWithToolbar'); - - await createWidget('dxHtmlEditor', { - height: 200, - width: '100%', - value: Array(100).fill('string').join('\n'), - }, '#editor'); - - await createWidget('dxHtmlEditor', { - height: 200, - width: '100%', - value: Array(100).fill('string').join('\n'), - toolbar: { - items: ['bold', 'color'], - }, - }, '#editorWithToolbar'); - }); -}); - -test('AI toolbar item', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const htmlEditor = new HtmlEditor('#container'); - - await testScreenshot(t, takeScreenshot, 'htmleditor-ai-toolbar-item.png', { element: '#container' }); - - await t - .click(htmlEditor.toolbar.getItemByName('ai').element) - .click(Selector(`.${SUBMENU_CLASS}`).find(`.${MENU_ITEM_CLASS}`).nth(5)); - - await testScreenshot(t, takeScreenshot, 'htmleditor-ai-toolbar-item-expanded.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 500, - width: 350, - aiIntegration: {}, - toolbar: { - items: ['ai'], - }, - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/addImageFromDevice.ts b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/addImageFromDevice.ts deleted file mode 100644 index bdf32967abb2..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/addImageFromDevice.ts +++ /dev/null @@ -1,140 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import HtmlEditor from 'devextreme-testcafe-models/htmlEditor'; -import url from '../../../../../helpers/getPageUrl'; -import { createWidget } from '../../../../../helpers/createWidget'; -import { testScreenshot } from '../../../../../helpers/themeUtils'; - -const TEST_IMAGE_PATH_1 = './images/test-image-1.png'; -const TEST_IMAGE_PATH_2 = './images/test-image-2.png'; - -fixture`HtmlEditor - upload image from device` - .page(url(__dirname, '../../../../container-extended.html')); - -test('Image from device should be inserted', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const htmlEditor = new HtmlEditor('#container'); - - await t.click(htmlEditor.toolbar.getItemByName('image').element); - - await t - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .eql(true); - - const { fileUploader } = htmlEditor.dialog.addImageFileForm; - - await t - .setFilesToUpload(fileUploader.input, [TEST_IMAGE_PATH_1]); - - const file = fileUploader.getFile(); - - await t - .expect(file.fileName) - .eql('test-image-1.png') - - .expect(file.fileSize) - .eql('7 KB') - - .expect(file.statusMessage) - .eql('Ready to upload'); - - await t.click(fileUploader.getFile().cancelButton.element); - await t.expect(fileUploader.fileCount).eql(0); - await t - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .eql(true); - - await t - .setFilesToUpload(fileUploader.input, [TEST_IMAGE_PATH_2]); - - await testScreenshot(t, takeScreenshot, 'editor-before-click-add-button-from-device.png'); - - await t - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .eql(false); - - await t.click(htmlEditor.dialog.footerToolbar.addButton.element); - - await testScreenshot(t, takeScreenshot, 'editor-after-add-image-from-device.png', { element: htmlEditor.content }); - - await t.expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 800, - imageUpload: { - tabs: ['file'], - }, - toolbar: { items: ['image'] }, - }); -}); - -test('Image should be validated and inserted from device', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const htmlEditor = new HtmlEditor('#container'); - - await t.click(htmlEditor.toolbar.getItemByName('image').element); - - const { fileUploader } = htmlEditor.dialog.addImageFileForm; - - await t - .setFilesToUpload(fileUploader.input, [TEST_IMAGE_PATH_2]); - - const file = fileUploader.getFile(); - - await t - .expect(file.fileName) - .eql('test-image-2.png') - - .expect(file.fileSize) - .eql('10 KB') - - .expect(file.validationMessage) - .eql('File is too large'); - - await t - .click(fileUploader.getFile().cancelButton.element) - .expect(fileUploader.fileCount) - .eql(0); - - await t - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .eql(true); - - await t - .setFilesToUpload(fileUploader.input, [TEST_IMAGE_PATH_1]); - await t - .expect(file.fileName) - .eql('test-image-1.png') - - .expect(file.fileSize) - .eql('7 KB') - - .expect(file.statusMessage) - .eql('Ready to upload'); - - await testScreenshot(t, takeScreenshot, 'editor-before-click-add-button-and-validation.png'); - - await t - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .eql(false); - - await t.click(htmlEditor.dialog.footerToolbar.addButton.element); - - await testScreenshot(t, takeScreenshot, 'editor-after-click-add-button-and-validation.png', { element: htmlEditor.content }); - - await t.expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 800, - imageUpload: { - tabs: ['file'], - fileUploaderOptions: { - maxFileSize: 8500, - }, - }, - toolbar: { items: ['image'] }, - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/addImageUrl.ts b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/addImageUrl.ts deleted file mode 100644 index d182656550c1..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/addImageUrl.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import HtmlEditor from 'devextreme-testcafe-models/htmlEditor'; -import url from '../../../../../helpers/getPageUrl'; -import { createWidget } from '../../../../../helpers/createWidget'; -import { BASE64_IMAGE_1, BASE64_IMAGE_2 } from './images/base64'; -import { isMaterial, testScreenshot } from '../../../../../helpers/themeUtils'; - -fixture`HtmlEditor - add image url` - .page(url(__dirname, '../../../../container-extended.html')); - -const ADD_IMAGE_POPUP_CONTENT_SELECTOR = '.dx-htmleditor-add-image-popup .dx-overlay-content'; - -test('Image uploader from url appearance', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const htmlEditor = new HtmlEditor('#container'); - - await t - .click(htmlEditor.toolbar.getItemByName('image').element); - - await t - .click(htmlEditor.dialog.addImageUrlForm.lockButton.element); - - await t - .click(htmlEditor.dialog.addImageUrlForm.url.element); - - await testScreenshot(t, takeScreenshot, 'Image uploader from url appearance.png', { element: ADD_IMAGE_POPUP_CONTENT_SELECTOR }); - - await t.expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxHtmlEditor', { - height: 600, - width: 800, - toolbar: { items: ['image'] }, -})); - -test('Image url should be validate before wil be inserted by add button click', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const htmlEditor = new HtmlEditor('#container'); - - await t - .click(htmlEditor.toolbar.getItemByName('image').element) - .click(htmlEditor.dialog.footerToolbar.addButton.element); - - await t - .expect(htmlEditor.dialog.addImageUrlForm.url.isInvalid) - .eql(true); - - await t - .typeText(htmlEditor.dialog.addImageUrlForm.url.element, BASE64_IMAGE_1, { - paste: true, - }) - .click(htmlEditor.dialog.footerToolbar.addButton.element); - - await testScreenshot(t, takeScreenshot, 'add-validated-url-image-by-click.png', { element: htmlEditor.content }); - - await t.expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 800, - imageUpload: { - tabs: ['url'], - }, - toolbar: { items: ['image'] }, - }); -}); - -test('Image url should be validate before wil be inserted by add enter press', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const htmlEditor = new HtmlEditor('#container'); - - await t - .click(htmlEditor.toolbar.getItemByName('image').element); - - await t - .pressKey('enter') - .expect(htmlEditor.dialog.addImageUrlForm.url.isInvalid) - .eql(true); - - await t - .typeText(htmlEditor.dialog.addImageUrlForm.url.element, BASE64_IMAGE_1, { - paste: true, - }) - .pressKey('enter'); - - await testScreenshot(t, takeScreenshot, 'editor-add-validated-url-image-by-enter.png', { element: htmlEditor.content }); - - await t.expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 800, - imageUpload: { - tabs: ['url'], - }, - toolbar: { items: ['image'] }, - }); -}); - -test('Image url should be updated', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const htmlEditor = new HtmlEditor('#container'); - - await t - .click(htmlEditor.toolbar.getItemByName('image').element) - - .expect(htmlEditor.dialog.footerToolbar.addButton.text) - .eql(isMaterial() ? 'ADD' : 'Add'); - - await t - .typeText(htmlEditor.dialog.addImageUrlForm.url.element, BASE64_IMAGE_1, { - paste: true, - }) - .click(htmlEditor.dialog.footerToolbar.addButton.element); - - await testScreenshot(t, takeScreenshot, 'editor-add-url-image-before-updated.png', { element: htmlEditor.content }); - - await t - .click(htmlEditor.toolbar.getItemByName('image').element) - - .expect(htmlEditor.dialog.footerToolbar.addButton.text) - .eql(isMaterial() ? 'UPDATE' : 'Update'); - - await t - .typeText(htmlEditor.dialog.addImageUrlForm.url.element, BASE64_IMAGE_2, { - paste: true, - replace: true, - }) - .click(htmlEditor.dialog.footerToolbar.addButton.element); - - await testScreenshot(t, takeScreenshot, 'editor-add-url-image-after-updated.png', { element: htmlEditor.content }); - - await t.expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 800, - imageUpload: { - tabs: ['url'], - }, - toolbar: { items: ['image'] }, - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/common.ts b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/common.ts deleted file mode 100644 index 05a82d75f5d1..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/common.ts +++ /dev/null @@ -1,180 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import HtmlEditor from 'devextreme-testcafe-models/htmlEditor'; -import url from '../../../../../helpers/getPageUrl'; -import { createWidget } from '../../../../../helpers/createWidget'; -import { BASE64_IMAGE_1 } from './images/base64'; -import { testScreenshot } from '../../../../../helpers/themeUtils'; - -const TEST_IMAGE_PATH_1 = './images/test-image-1.png'; - -fixture`HtmlEditor - common` - .page(url(__dirname, '../../../../container-extended.html')); - -const ADD_IMAGE_POPUP_CONTENT_SELECTOR = '.dx-htmleditor-add-image-popup .dx-overlay-content'; -const LONG_FILE_UPLOADER_LABEL_TEXT = 'Drop an image here or click the button to browse'; - -test('TabPanel in HtmlEditor must have correct borders', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const htmlEditor = new HtmlEditor('#container'); - - await t.click(htmlEditor.toolbar.getItemByName('image').element); - - await testScreenshot(t, takeScreenshot, 'tabpanel-in-htmleditor.png', { - element: ADD_IMAGE_POPUP_CONTENT_SELECTOR, - }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 800, - imageUpload: { - tabs: ['file', 'url'], - }, - toolbar: { items: ['image'] }, - }); -}); - -test('File uploader label container should keep the full dialog width', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const htmlEditor = new HtmlEditor('#container'); - - await t.click(htmlEditor.toolbar.getItemByName('image').element); - - await testScreenshot(t, takeScreenshot, 'htmleditor-add-image-long-file-uploader-label.png', { - element: ADD_IMAGE_POPUP_CONTENT_SELECTOR, - }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 800, - imageUpload: { - tabs: ['file'], - fileUploaderOptions: { - labelText: LONG_FILE_UPLOADER_LABEL_TEXT, - }, - }, - toolbar: { items: ['image'] }, - }); -}); - -test('Add button should be enabled after switch to url form', async (t) => { - const htmlEditor = new HtmlEditor('#container'); - - await t - .click(htmlEditor.toolbar.getItemByName('image').element) - - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .eql(true); - - await t.click(htmlEditor.dialog.tabs.getItem(1).element); - - await t - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .eql(false) - - .typeText(htmlEditor.dialog.addImageUrlForm.url.element, BASE64_IMAGE_1, { - paste: true, - }) - .click(htmlEditor.dialog.footerToolbar.addButton.element); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 800, - imageUpload: { - tabs: ['file', 'url'], - }, - toolbar: { items: ['image'] }, - }); -}); - -test('Add button should be disable after switch to image upload form', async (t) => { - const htmlEditor = new HtmlEditor('#container'); - - await t - .click(htmlEditor.toolbar.getItemByName('image').element) - - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .notOk() - - .click(htmlEditor.dialog.footerToolbar.addButton.element) - .expect(htmlEditor.dialog.addImageUrlForm.url.isInvalid) - .ok(); - - await t.click(htmlEditor.dialog.tabs.getItem(1).element); - - await t - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .ok(); - - const { fileUploader } = htmlEditor.dialog.addImageFileForm; - - await t - .setFilesToUpload(fileUploader.input, [TEST_IMAGE_PATH_1]) - - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .notOk() - - .click(htmlEditor.dialog.footerToolbar.addButton.element); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 800, - imageUpload: { - tabs: ['url', 'file'], - }, - toolbar: { items: ['image'] }, - }); -}); - -test('AddImage form shouldn\'t lead to side effects in other forms', async (t) => { - const htmlEditor = new HtmlEditor('#container'); - - await t - .click(htmlEditor.toolbar.getItemByName('image').element) - - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .ok() - - .expect(htmlEditor.dialog.footerToolbar.cancelButton.isDisabled) - .notOk() - - .click(htmlEditor.dialog.footerToolbar.cancelButton.element); - - await t - .click(htmlEditor.toolbar.getItemByName('link').element) - - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .notOk() - - .expect(htmlEditor.dialog.footerToolbar.cancelButton.isDisabled) - .notOk() - - .click(htmlEditor.dialog.footerToolbar.addButton.element); - - await t - .click(htmlEditor.toolbar.getItemByName('color').element) - - .expect(htmlEditor.dialog.footerToolbar.addButton.isDisabled) - .notOk() - - .expect(htmlEditor.dialog.footerToolbar.cancelButton.isDisabled) - .notOk() - - .click(htmlEditor.dialog.footerToolbar.cancelButton.element); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 800, - imageUpload: { - tabs: ['file', 'url'], - }, - toolbar: { items: ['image', 'link', 'color'] }, - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/Image uploader from url appearance (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/Image uploader from url appearance (fluent-next.blue.light).png deleted file mode 100644 index f1b4a887f1a0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/Image uploader from url appearance (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/Image uploader from url appearance (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/Image uploader from url appearance (fluent.blue.light).png deleted file mode 100644 index 4699b123b1e3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/Image uploader from url appearance (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/add-validated-url-image-by-click (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/add-validated-url-image-by-click (fluent-next.blue.light).png deleted file mode 100644 index 60c5a7c48cff..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/add-validated-url-image-by-click (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/add-validated-url-image-by-click (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/add-validated-url-image-by-click (fluent.blue.light).png deleted file mode 100644 index 60c5a7c48cff..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/add-validated-url-image-by-click (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-after-updated (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-after-updated (fluent-next.blue.light).png deleted file mode 100644 index d9bdaab3015e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-after-updated (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-after-updated (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-after-updated (fluent.blue.light).png deleted file mode 100644 index d9bdaab3015e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-after-updated (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-before-updated (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-before-updated (fluent-next.blue.light).png deleted file mode 100644 index 60c5a7c48cff..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-before-updated (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-before-updated (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-before-updated (fluent.blue.light).png deleted file mode 100644 index 60c5a7c48cff..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-url-image-before-updated (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-validated-url-image-by-enter (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-validated-url-image-by-enter (fluent-next.blue.light).png deleted file mode 100644 index 60c5a7c48cff..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-validated-url-image-by-enter (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-validated-url-image-by-enter (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-validated-url-image-by-enter (fluent.blue.light).png deleted file mode 100644 index 60c5a7c48cff..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-add-validated-url-image-by-enter (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-add-image-from-device (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-add-image-from-device (fluent-next.blue.light).png deleted file mode 100644 index d044f6b2bbaf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-add-image-from-device (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-add-image-from-device (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-add-image-from-device (fluent.blue.light).png deleted file mode 100644 index d044f6b2bbaf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-add-image-from-device (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-click-add-button-and-validation (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-click-add-button-and-validation (fluent-next.blue.light).png deleted file mode 100644 index 417fa43a3c0c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-click-add-button-and-validation (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-click-add-button-and-validation (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-click-add-button-and-validation (fluent.blue.light).png deleted file mode 100644 index 417fa43a3c0c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-after-click-add-button-and-validation (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-and-validation (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-and-validation (fluent-next.blue.light).png deleted file mode 100644 index 3a78ec59041a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-and-validation (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-and-validation (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-and-validation (fluent.blue.light).png deleted file mode 100644 index 267356ce8c33..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-and-validation (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-from-device (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-from-device (fluent-next.blue.light).png deleted file mode 100644 index 5ee8c90a57f0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-from-device (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-from-device (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-from-device (fluent.blue.light).png deleted file mode 100644 index a49d6be70a47..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-from-device (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-add-image-long-file-uploader-label (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-add-image-long-file-uploader-label (fluent-next.blue.light).png deleted file mode 100644 index 03c0797f7a54..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-add-image-long-file-uploader-label (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-add-image-long-file-uploader-label (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-add-image-long-file-uploader-label (fluent.blue.light).png deleted file mode 100644 index c894ea73179e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-add-image-long-file-uploader-label (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar (fluent-next.blue.light).png deleted file mode 100644 index e3d6fef9f9ce..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar (fluent.blue.light).png deleted file mode 100644 index 1d5d4996e53b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar-focused (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar-focused (fluent-next.blue.light).png deleted file mode 100644 index 4605fa42452d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar-focused (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar-focused (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar-focused (fluent.blue.light).png deleted file mode 100644 index 5028e75183a9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-with-toolbar-focused (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar (fluent-next.blue.light).png deleted file mode 100644 index 80e293e21c48..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar (fluent.blue.light).png deleted file mode 100644 index d2690f76f986..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar-focused (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar-focused (fluent-next.blue.light).png deleted file mode 100644 index b3489d61ecf2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar-focused (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar-focused (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar-focused (fluent.blue.light).png deleted file mode 100644 index 70090010b31b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/htmleditor-without-toolbar-focused (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent-next.blue.light).png deleted file mode 100644 index e30ee4418019..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent.blue.light).png deleted file mode 100644 index 67b8bd0983cf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/common.ts b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/common.ts deleted file mode 100644 index b0138f5ec8ae..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/common.ts +++ /dev/null @@ -1,315 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import HtmlEditor from 'devextreme-testcafe-models/htmlEditor'; -import { Selector } from 'testcafe'; -import { createWidget } from '../../../../../helpers/createWidget'; -import url from '../../../../../helpers/getPageUrl'; -import { testScreenshot } from '../../../../../helpers/themeUtils'; -import { insertStylesheetRulesToPage } from '../../../../../helpers/domUtils'; -import { getLongText } from '../../../chat/data'; - -const MENU_ITEM_CLASS = 'dx-menu-item'; -const SUBMENU_CLASS = 'dx-submenu'; -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 longResult = getLongText(false, 10); - -fixture`HtmlEditor: AIDialog` - .page(url(__dirname, '../../../../container-extended.html')); - -export async function openAIDialog( - t: TestController, - command: number, - option?: number, -): Promise { - const htmlEditor = new HtmlEditor('#container'); - await t - .click(htmlEditor.toolbar.getItemByName('ai').element) - .click(Selector(`.${SUBMENU_CLASS} .${MENU_ITEM_CLASS}`).nth(command)); - - if (option !== undefined) { - await t - .click(Selector(`.${SUBMENU_CLASS} .${MENU_ITEM_CLASS}`).nth(command) - .find(`.${SUBMENU_CLASS} .${MENU_ITEM_CLASS}`).nth(0)); - } - - return htmlEditor; -} - -[ - { name: 'with-no-options', command: 0, option: undefined }, - { name: 'with-options', command: 4, option: 0 }, -].forEach(({ name, command, option }) => { - test(`initial state ${name}`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await openAIDialog(t, command, option); - await testScreenshot(t, takeScreenshot, `htmleditor-ai-dialog-initial-state-${name}.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 900, - aiIntegration: {}, - toolbar: { - items: ['ai'], - }, - }); - }); -}); - -test('resize window when initial state', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const htmlEditor = await openAIDialog(t, 0); - - await t.resizeWindow(400, 600); - - const aiDialog = htmlEditor.getAIDialog(); - const menuButton = aiDialog.getMenuButton(); - - await t.click(menuButton.element); - await testScreenshot(t, takeScreenshot, 'htmleditor-ai-dialog-initial-state-resize-window.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - aiIntegration: {}, - toolbar: { - items: ['ai'], - }, - }); -}); - -test('generating state', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await openAIDialog(t, 4, 0); - await testScreenshot(t, takeScreenshot, 'htmleditor-ai-dialog-generating-state.png', { element: '#container' }); - - 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; - opacity: 1 !important; - } - - .${LOADINDICATOR_SEGMENT_CLASS} { - transform: scale(1) !important; - } - `); - - await createWidget('dxHtmlEditor', { - height: 600, - width: 900, - aiIntegration: { - changeStyle() {}, - }, - toolbar: { - items: ['ai'], - }, - }); -}); - -[ - { - name: 'short-result', - result: 'result', - }, - { - name: 'long-result', - result: longResult, - }, -].forEach(({ name, result }) => { - test(`resultReady state with ${name}`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const htmlEditor = await openAIDialog(t, 4, 0); - const aiDialog = htmlEditor.getAIDialog(); - const splitButton = aiDialog.getSplitButton(); - - await t.click(splitButton.element); - - await testScreenshot(t, takeScreenshot, `htmleditor-ai-dialog-result-ready-state-with-${name}.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 900, - aiIntegration: { - result, - changeStyle(_, { onComplete }) { onComplete(this.result); }, - }, - toolbar: { - items: ['ai'], - }, - }); - }); -}); - -test('asking state', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await openAIDialog(t, 7); - await testScreenshot(t, takeScreenshot, 'htmleditor-ai-dialog-asking-state.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 900, - aiIntegration: {}, - toolbar: { - items: ['ai'], - }, - }); -}); - -test('askAI result ready state', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const htmlEditor = await openAIDialog(t, 7); - const aiDialog = htmlEditor.getAIDialog(); - const promptTextArea = aiDialog.getPromptTextArea(); - const generateButton = aiDialog.getGenerateButton(); - - await t.typeText(promptTextArea.getInput(), 'request'); - await t.click(generateButton.element); - - await testScreenshot(t, takeScreenshot, 'htmleditor-ai-dialog-ask-ai-result-ready-state.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 900, - aiIntegration: { - result: longResult, - execute(_, { onComplete }) { onComplete(this.result); }, - }, - toolbar: { - items: ['ai'], - }, - }); -}); - -test('result ready after canceletion', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const htmlEditor = await openAIDialog(t, 0); - const aiDialog = htmlEditor.getAIDialog(); - const cancelButton = aiDialog.getCancelButton(); - - await t.click(cancelButton.element); - - await testScreenshot(t, takeScreenshot, 'htmleditor-ai-dialog-result-ready-after-canceletion.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 900, - aiIntegration: { - summarize() { return () => {}; }, - }, - toolbar: { - items: ['ai'], - }, - }); -}); - -test('error state', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await openAIDialog(t, 0); - await testScreenshot(t, takeScreenshot, 'htmleditor-ai-dialog-error-state.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 600, - width: 900, - aiIntegration: { - summarize(_, { onError }) { onError(); }, - }, - toolbar: { - items: ['ai'], - }, - }); -}); - -[ - { state: 'initial', configuration: {} }, - { - state: 'generating', - configuration: { - summarize() {}, - }, - }, - { - state: 'result-ready', - configuration: { - result: longResult, - summarize(_, { onComplete }) { onComplete(this.result); }, - }, - }, - { - state: 'error', - configuration: { - summarize(_, { onError }) { onError(); }, - }, - }, -].forEach(({ state, configuration }) => { - test.meta({ browserSize: [400, 700] })(`${state} state on small screen`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await openAIDialog(t, 0); - await testScreenshot(t, takeScreenshot, `htmleditor-ai-dialog-${state}-state-on-small-screen.png`, { element: '#container' }); - - 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; - opacity: 1 !important; - } - `); - - await createWidget('dxHtmlEditor', { - height: 700, - aiIntegration: { ...configuration }, - toolbar: { - items: ['ai'], - }, - }); - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-ask-ai-result-ready-state (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-ask-ai-result-ready-state (fluent-next.blue.light).png deleted file mode 100644 index 6ef1b61f0a41..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-ask-ai-result-ready-state (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-ask-ai-result-ready-state (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-ask-ai-result-ready-state (fluent.blue.light).png deleted file mode 100644 index d006a1bc96d3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-ask-ai-result-ready-state (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-asking-state (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-asking-state (fluent-next.blue.light).png deleted file mode 100644 index b7f1dff7f5a0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-asking-state (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-asking-state (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-asking-state (fluent.blue.light).png deleted file mode 100644 index ecc880a06391..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-asking-state (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state (fluent-next.blue.light).png deleted file mode 100644 index 957fc9440b56..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state (fluent.blue.light).png deleted file mode 100644 index c2f0efcc3f4c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state-on-small-screen (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state-on-small-screen (fluent-next.blue.light).png deleted file mode 100644 index 47a4ac0bdddc..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state-on-small-screen (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state-on-small-screen (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state-on-small-screen (fluent.blue.light).png deleted file mode 100644 index da55654e7611..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-error-state-on-small-screen (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state (fluent-next.blue.light).png deleted file mode 100644 index 5cf18d2a77c0..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state (fluent.blue.light).png deleted file mode 100644 index df51aea74163..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state-on-small-screen (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state-on-small-screen (fluent-next.blue.light).png deleted file mode 100644 index 4b4a09e2ae52..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state-on-small-screen (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state-on-small-screen (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state-on-small-screen (fluent.blue.light).png deleted file mode 100644 index 1c18436e2899..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-generating-state-on-small-screen (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-on-small-screen (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-on-small-screen (fluent-next.blue.light).png deleted file mode 100644 index 3ea0b58f2567..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-on-small-screen (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-on-small-screen (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-on-small-screen (fluent.blue.light).png deleted file mode 100644 index 31cc322bebbf..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-on-small-screen (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-resize-window (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-resize-window (fluent-next.blue.light).png deleted file mode 100644 index 1a2ff73db2b5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-resize-window (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-resize-window (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-resize-window (fluent.blue.light).png deleted file mode 100644 index 22e7a9a00f99..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-resize-window (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-no-options (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-no-options (fluent-next.blue.light).png deleted file mode 100644 index 9fb034b1bda4..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-no-options (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-no-options (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-no-options (fluent.blue.light).png deleted file mode 100644 index 77b46a49861a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-no-options (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-options (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-options (fluent-next.blue.light).png deleted file mode 100644 index 2a06688eef18..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-options (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-options (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-options (fluent.blue.light).png deleted file mode 100644 index 1d31c81500f2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-initial-state-with-options (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-after-canceletion (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-after-canceletion (fluent-next.blue.light).png deleted file mode 100644 index 31fc54f5f74f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-after-canceletion (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-after-canceletion (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-after-canceletion (fluent.blue.light).png deleted file mode 100644 index 3b8a04753c12..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-after-canceletion (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-on-small-screen (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-on-small-screen (fluent-next.blue.light).png deleted file mode 100644 index e5bce48d4a29..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-on-small-screen (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-on-small-screen (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-on-small-screen (fluent.blue.light).png deleted file mode 100644 index 23ee36502dad..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-on-small-screen (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-long-result (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-long-result (fluent-next.blue.light).png deleted file mode 100644 index 39fee7b4feb5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-long-result (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-long-result (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-long-result (fluent.blue.light).png deleted file mode 100644 index 95d750aef547..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-long-result (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-short-result (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-short-result (fluent-next.blue.light).png deleted file mode 100644 index 34eb8facb153..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-short-result (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-short-result (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-short-result (fluent.blue.light).png deleted file mode 100644 index 5b36670d575a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/dialogs/aiDialog/etalons/htmleditor-ai-dialog-result-ready-state-with-short-result (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item (fluent-next.blue.light).png deleted file mode 100644 index 69fa4ae30571..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item (fluent.blue.light).png deleted file mode 100644 index 87fa1bd1ea64..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item-expanded (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item-expanded (fluent-next.blue.light).png deleted file mode 100644 index d5bfcd1acc7f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item-expanded (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item-expanded (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item-expanded (fluent.blue.light).png deleted file mode 100644 index 10eca2e9bf05..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ai-toolbar-item-expanded (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-appearance (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-appearance (fluent-next.blue.light).png deleted file mode 100644 index 0eaa3540d30c..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-appearance (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-appearance (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-appearance (fluent.blue.light).png deleted file mode 100644 index 475c2434c936..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-appearance (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-text-appearance (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-text-appearance (fluent-next.blue.light).png deleted file mode 100644 index 833ed731a091..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-text-appearance (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-text-appearance (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-text-appearance (fluent.blue.light).png deleted file mode 100644 index e6107b6a84a8..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-ordered-list-text-appearance (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar (fluent-next.blue.light).png deleted file mode 100644 index e3d6fef9f9ce..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar (fluent.blue.light).png deleted file mode 100644 index 8f828235c988..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar-focused (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar-focused (fluent-next.blue.light).png deleted file mode 100644 index 4605fa42452d..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar-focused (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar-focused (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar-focused (fluent.blue.light).png deleted file mode 100644 index cd9533609421..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-with-toolbar-focused (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar (fluent-next.blue.light).png deleted file mode 100644 index 80e293e21c48..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar (fluent.blue.light).png deleted file mode 100644 index b3a96a287a1f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar-focused (fluent-next.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar-focused (fluent-next.blue.light).png deleted file mode 100644 index b3489d61ecf2..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar-focused (fluent-next.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar-focused (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar-focused (fluent.blue.light).png deleted file mode 100644 index 86c576f1b661..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/htmlEditor/etalons/htmleditor-without-toolbar-focused (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/format.ts b/e2e/testcafe-devextreme/tests/editors/htmlEditor/format.ts deleted file mode 100644 index 5ba4773709db..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/htmlEditor/format.ts +++ /dev/null @@ -1,39 +0,0 @@ -import SelectBox from 'devextreme-testcafe-models/selectBox'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -fixture`HtmlEditor - formats` - .page(url(__dirname, '../../container-extended.html')); - -test('HtmlEditor should keep actual format after "enter" key pressed (T922236)', async (t) => { - const selectBox = new SelectBox('.dx-font-format'); - - await t - .click(selectBox.element); - - const list = await selectBox.getList(); - - await t.click(list.getItem().element); - - await t - .expect(selectBox.value) - .eql('Arial') - .pressKey('k') - .pressKey('enter') - .expect(selectBox.value) - .eql('Arial'); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 400, - width: 200, - toolbar: { - items: [ - 'bold', - { - name: 'font', - acceptedValues: ['Arial', 'Terminal'], - }, - ], - }, - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/keyboard.ts b/e2e/testcafe-devextreme/tests/editors/htmlEditor/keyboard.ts deleted file mode 100644 index 5c5621ab61f3..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/htmlEditor/keyboard.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Selector } from 'testcafe'; -import HtmlEditor from 'devextreme-testcafe-models/htmlEditor'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { addFocusableElementBefore, addFocusableElementAfter } from '../../../helpers/domUtils'; - -fixture`HtmlEditor - focus escape` - .page(url(__dirname, '../../container-extended.html')); - -test('Ctrl+Shift+Down should move focus to the next focusable element outside the editor', async (t) => { - const htmlEditor = new HtmlEditor('#container'); - - await t - .click(htmlEditor.content) - .pressKey('ctrl+shift+down') - .expect(Selector('#focusable-end').focused) - .ok(); -}).before(async () => { - await createWidget('dxHtmlEditor', { value: '

test

' }); - await addFocusableElementBefore('#container'); - await addFocusableElementAfter('#container'); -}); - -test('Ctrl+Shift+Up should move focus to the previous focusable element when there is no toolbar', async (t) => { - const htmlEditor = new HtmlEditor('#container'); - - await t - .click(htmlEditor.content) - .pressKey('ctrl+shift+up') - .expect(Selector('#focusable-start').focused) - .ok(); -}).before(async () => { - await createWidget('dxHtmlEditor', { value: '

test

' }); - await addFocusableElementBefore('#container'); - await addFocusableElementAfter('#container'); -}); - -test('Ctrl+Shift+Up should move focus into the toolbar when it is present', async (t) => { - const htmlEditor = new HtmlEditor('#container'); - - await t - .click(htmlEditor.content) - .pressKey('ctrl+shift+up') - .expect(htmlEditor.toolbar.getItemByName('bold').isFocused) - .ok(); -}).before(async () => { - await createWidget('dxHtmlEditor', { - value: '

test

', - toolbar: { items: ['bold', 'italic'] }, - }); - await addFocusableElementBefore('#container'); - await addFocusableElementAfter('#container'); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/htmlEditor/list.ts b/e2e/testcafe-devextreme/tests/editors/htmlEditor/list.ts deleted file mode 100644 index c1682ea1d083..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/htmlEditor/list.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; - -const orderedListMarkup = ` -
    -
  1. Item 1 -
      -
    1. -
        -
      1. -
      -
    -
  2. -
  3. Item 2 -
      -
    1. -
        -
      1. -
      -
    -
  4. -
-`; - -const orderedListWithTextMarkup = ` -

Text

-
    -
  1. Text -
      -
    1. 1
    2. -
    3. 2
    4. -
    -
  2. -
  3. Text -
      -
    1. 1
    2. -
    3. 2
    4. -
    -
  4. -
-`; - -fixture`HtmlEditor - lists` - .page(url(__dirname, '../../container-extended.html')); - -test('ordered list numbering sequence should reset for each list item (T1220554)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'htmleditor-ordered-list-appearance.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 200, - width: 200, - value: orderedListMarkup, - }); -}); - -test('should reset nested ordered list counters when preceded by text (T1320286)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'htmleditor-ordered-list-text-appearance.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await createWidget('dxHtmlEditor', { - height: 200, - width: 200, - value: orderedListWithTextMarkup, - }); -}); 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}`); - } -}