diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 27d591e8934a..91e8c80c701a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -11,6 +11,7 @@ /packages/devextreme-scss/scss/widgets/** @DevExpress/devextreme-components /apps/demos/Demos/** @DevExpress/devextreme-components /e2e/testcafe-devextreme/tests/*/** @DevExpress/devextreme-components +/e2e/playwright/tests/editors/** @DevExpress/devextreme-components /packages/devextreme/testing/tests/DevExpress.serverSide*/** @DevExpress/devextreme-components ## ui @@ -19,6 +20,7 @@ /packages/devextreme/js/__internal/pagination/** @DevExpress/devextreme-components /packages/testcafe-models/** @DevExpress/devextreme-components +/e2e/playwright/models/** @DevExpress/devextreme-components /packages/devextreme/testing/tests/DevExpress.ui/** @DevExpress/devextreme-components /packages/devextreme/testing/tests/DevExpress.ui.widgets*/** @DevExpress/devextreme-components /packages/devextreme/testing/tests/DevExpress.knockout/** @DevExpress/devextreme-components diff --git a/e2e/playwright/README.md b/e2e/playwright/README.md index 7ad7a8c7ec73..2ebb5f483855 100644 --- a/e2e/playwright/README.md +++ b/e2e/playwright/README.md @@ -145,3 +145,38 @@ viewport is 1200×800 and the widgets of the previous test are disposed. | `RequestMock` | `mockApi` on top of `page.route` | | `mockdate` | `mockDate` on top of `page.clock` | | machine timezone on the agent | `TIMEZONE` → the browser context | +| `t.typeText` | `locator.pressSequentially` | +| `t.pressKey('ctrl+a')` | `page.keyboard.press('Control+a')` | +| `t.expect(selector.value)` | `expect(locator).toHaveValue` | +| `t.expect(widget.option('x'))` | `expect.poll(() => widget.option('x'))` | +| `.before(...)` of a test | the first lines of the test | +| `meta({ browserSize })` | `test.use({ browserSize })` | +| `meta({ runInTheme })` | `test.use({ theme })` | +| `meta({ themes })` | `{ tag: ['@generic.light'] }` | + +## Porting a TestCafe test + +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. + +**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`. + +**Checks.** TestCafe retried `t.expect(selector.value)`; here only `expect(locator)` and +`expect.poll` retry. `expect(await locator.inputValue()).toBe(x)` reads the value once and fails +whenever the page is a moment late. + +**Waiting.** A step waits for the state it needs, never for time. `helpers/`, `models/` and the +test folders migrated under this rule (see `eslint.config.mjs`) may not use `waitForTimeout`, +`setTimeout`, `force: true`, `toPass`, a `timeout` option or a call that raises a timeout +(`test.setTimeout`, `page.setDefaultTimeout`). When a widget reacts to a change +through an observer and leaves nothing to assert on, `waitForNextFrame` waits for the frame in which +the observer runs. + +**Clicks.** A click is a real one: it lands on the topmost element at that point and fails when +that is not the target. TestCafe delivered a click to a covered element anyway, so a test that +relied on it needs the target made reachable, not the check switched off. + +**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. diff --git a/e2e/playwright/eslint.config.mjs b/e2e/playwright/eslint.config.mjs index 3192f2a51869..e3f6606e7da4 100644 --- a/e2e/playwright/eslint.config.mjs +++ b/e2e/playwright/eslint.config.mjs @@ -67,4 +67,25 @@ export default [ '@stylistic/no-extra-parens': 'off', }, }, + { + files: ['helpers/**/*.ts', 'models/**/*.ts', 'tests/editors/**/*.ts'], + rules: { + 'no-restricted-syntax': ['error', { + selector: "CallExpression[callee.property.name='waitForTimeout'], CallExpression[callee.name='setTimeout'], CallExpression[callee.object.name=/^(window|globalThis)$/][callee.property.name='setTimeout']", + message: 'Wait for the state the next step needs, not for time.', + }, { + selector: "Property[key.name='force'][value.value=true]", + message: 'A forced action skips the checks a user action would pass. Make the target reachable.', + }, { + selector: "CallExpression[callee.property.name='toPass']", + message: 'Use a retrying assertion on the value itself (expect(locator), expect.poll).', + }, { + selector: "CallExpression[callee.object.name!=/^(window|globalThis)$/][callee.property.name=/^(setTimeout|setDefaultTimeout|setDefaultNavigationTimeout)$/], CallExpression[callee.object.name='test'][callee.property.name='slow']", + message: 'Do not raise a timeout. Find what the test is waiting for.', + }, { + selector: "Property[key.name='timeout']", + message: 'Do not raise a timeout. If this is a widget option, disable the rule on this line and say so.', + }], + }, + }, ]; diff --git a/e2e/playwright/helpers/domUtils.ts b/e2e/playwright/helpers/domUtils.ts index a238bfe2c42c..528875d33682 100644 --- a/e2e/playwright/helpers/domUtils.ts +++ b/e2e/playwright/helpers/domUtils.ts @@ -121,3 +121,40 @@ export const removeStylesheetRulesFromPage = async (page: Page): Promise = (stylesheetId) => { document.getElementById(stylesheetId)?.remove(); }, STYLESHEET_RULES_ID, ); + +export const addFocusableElementBefore = async ( + page: Page, + targetSelector: string, + elementId = 'focusable-start', +): Promise => page.evaluate( + ({ selector, id }) => { + document.getElementById(id)?.remove(); + + const target = document.querySelector(selector); + const button = document.createElement('button'); + + button.id = id; + button.textContent = 'Start'; + Object.assign(button.style, { + position: 'fixed', + top: '0', + left: '0', + width: '1px', + height: '1px', + padding: '0', + border: '0', + overflow: 'hidden', + opacity: '0', + }); + target?.parentElement?.insertBefore(button, target); + + 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/autocomplete.ts b/e2e/playwright/models/autocomplete.ts new file mode 100644 index 000000000000..77a23e65b453 --- /dev/null +++ b/e2e/playwright/models/autocomplete.ts @@ -0,0 +1,7 @@ +import type { WidgetName } from './types'; +import TextBox from './textBox'; + +export default class Autocomplete extends TextBox { + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxAutocomplete'; } +} diff --git a/e2e/playwright/models/colorBox.ts b/e2e/playwright/models/colorBox.ts new file mode 100644 index 000000000000..f62bc3285712 --- /dev/null +++ b/e2e/playwright/models/colorBox.ts @@ -0,0 +1,7 @@ +import type { WidgetName } from './types'; +import TextBox from './textBox'; + +export default class ColorBox extends TextBox { + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxColorBox'; } +} diff --git a/e2e/playwright/models/form.ts b/e2e/playwright/models/form.ts new file mode 100644 index 000000000000..7b424b540a48 --- /dev/null +++ b/e2e/playwright/models/form.ts @@ -0,0 +1,13 @@ +import type { WidgetName } from './types'; +import Widget from './internal/widget'; + +export default class Form extends Widget { + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxForm'; } + + public async validate(): Promise { + await this.element.evaluate((element) => { + ($(element) as any).dxForm('instance').validate(); + }); + } +} diff --git a/e2e/playwright/models/radioGroup/button.ts b/e2e/playwright/models/radioGroup/button.ts new file mode 100644 index 000000000000..1e1cf2e4f810 --- /dev/null +++ b/e2e/playwright/models/radioGroup/button.ts @@ -0,0 +1,26 @@ +import type { Locator } from '@playwright/test'; +import { expect } from '@playwright/test'; +import { classMatcher } from '../internal/classMatcher'; + +const CLASS = { + valueContainer: 'dx-radio-value-container', + icon: 'dx-radiobutton-icon', + checked: 'dx-radiobutton-checked', +}; + +export default class RadioButton { + public readonly element: Locator; + + private readonly item: Locator; + + constructor(item: Locator) { + this.item = item; + 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)); + } +} diff --git a/e2e/playwright/models/radioGroup/index.ts b/e2e/playwright/models/radioGroup/index.ts new file mode 100644 index 000000000000..8dd3424aa6f5 --- /dev/null +++ b/e2e/playwright/models/radioGroup/index.ts @@ -0,0 +1,26 @@ +import type { Locator, Page } from '@playwright/test'; +import type { WidgetName } from '../types'; +import Widget from '../internal/widget'; +import RadioGroupItem from './item'; + +const CLASS = { + collection: 'dx-collection', + item: 'dx-item', +}; + +export default class RadioGroup extends Widget { + public readonly items: Locator; + + constructor(page: Page, selector: Locator | string) { + super(page, selector); + + this.items = this.element.locator(`:scope > .${CLASS.collection} > .${CLASS.item}`); + } + + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxRadioGroup'; } + + public getItem(index = 0): RadioGroupItem { + return new RadioGroupItem(this.items.nth(index)); + } +} diff --git a/e2e/playwright/models/radioGroup/item.ts b/e2e/playwright/models/radioGroup/item.ts new file mode 100644 index 000000000000..44c7ee5d0406 --- /dev/null +++ b/e2e/playwright/models/radioGroup/item.ts @@ -0,0 +1,20 @@ +import type { Locator } from '@playwright/test'; +import RadioButton from './button'; + +const CLASS = { + itemContent: 'dx-item-content', +}; + +export default class RadioGroupItem { + public readonly element: Locator; + + public readonly content: Locator; + + public readonly radioButton: RadioButton; + + constructor(element: Locator) { + this.element = element; + this.content = element.locator(`:scope > .${CLASS.itemContent}`); + this.radioButton = new RadioButton(element); + } +} diff --git a/e2e/playwright/models/textArea.ts b/e2e/playwright/models/textArea.ts new file mode 100644 index 000000000000..6b60cc2b9f1c --- /dev/null +++ b/e2e/playwright/models/textArea.ts @@ -0,0 +1,7 @@ +import type { WidgetName } from './types'; +import TextBox from './textBox'; + +export default class TextArea extends TextBox { + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxTextArea'; } +} diff --git a/e2e/playwright/models/textBox.ts b/e2e/playwright/models/textBox.ts new file mode 100644 index 000000000000..c53a59c206ca --- /dev/null +++ b/e2e/playwright/models/textBox.ts @@ -0,0 +1,29 @@ +import type { Locator, Page } from '@playwright/test'; +import type { WidgetName } from './types'; +import Widget from './internal/widget'; + +const CLASS = { + input: 'dx-texteditor-input', + label: 'dx-label', +}; + +export default class TextBox extends Widget { + public readonly input: Locator; + + constructor(page: Page, selector: Locator | string) { + super(page, selector); + + this.input = this.element.locator(`.${CLASS.input}`); + } + + // eslint-disable-next-line class-methods-use-this + public getName(): WidgetName { return 'dxTextBox'; } + + public getLabel(): Locator { + return this.element.locator(`.${CLASS.label}`); + } + + public getLabelSpan(): Locator { + return this.getLabel().locator('span'); + } +} diff --git a/e2e/playwright/tests/editors/autocomplete/common.spec.ts b/e2e/playwright/tests/editors/autocomplete/common.spec.ts new file mode 100644 index 000000000000..f82a6ad3cc45 --- /dev/null +++ b/e2e/playwright/tests/editors/autocomplete/common.spec.ts @@ -0,0 +1,22 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import Autocomplete from '../../../models/autocomplete'; + +test.describe('Autocomplete_placeholder', () => { + test('Placeholder is visible after items option change when value is not chosen (T1099804)', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'autocomplete'); + await setStyleAttribute(page, '#container', 'box-sizing: border-box; width: 300px; height: 100px; padding: 8px;'); + await createWidget(page, 'dxAutocomplete', { + width: '100%', + placeholder: 'Choose a value', + }, '#autocomplete'); + + const autocomplete = new Autocomplete(page, '#autocomplete'); + + await autocomplete.option('items', [1, 2, 3]); + + await testScreenshot(page, 'Autocomplete placeholder if value is not choosen.png', { element: '#container' }); + }); +}); diff --git a/e2e/playwright/tests/editors/autocomplete/etalons/Autocomplete placeholder if value is not choosen (fluent.blue.light).png b/e2e/playwright/tests/editors/autocomplete/etalons/Autocomplete placeholder if value is not choosen (fluent.blue.light).png new file mode 100644 index 000000000000..1eb1f958f633 Binary files /dev/null and b/e2e/playwright/tests/editors/autocomplete/etalons/Autocomplete placeholder if value is not choosen (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/checkBox/common.spec.ts b/e2e/playwright/tests/editors/checkBox/common.spec.ts new file mode 100644 index 000000000000..a12dae2c76d2 --- /dev/null +++ b/e2e/playwright/tests/editors/checkBox/common.spec.ts @@ -0,0 +1,112 @@ +import { randomUUID } from 'node:crypto'; +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { + appendElementTo, + insertStylesheetRulesToPage, + setClassAttribute, + setStyleAttribute, +} from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; + +const valueModes = [false, true, undefined]; + +const CHECKBOX_CLASS = 'dx-checkbox'; +const READONLY_STATE_CLASS = 'dx-state-readonly'; +const DEFAULT_STATE_CLASS = ''; +const ACTIVE_STATE_CLASS = 'dx-state-active'; +const HOVER_STATE_CLASS = 'dx-state-hover'; +const FOCUSED_STATE_CLASS = 'dx-state-focused'; +const DISABLED_STATE_CLASS = 'dx-state-disabled'; +const INVALID_STATE_CLASS = 'dx-invalid'; + +test.describe('CheckBox', () => { + [false, true].forEach((isColumnCountStyle) => { + test(`Render ${!isColumnCountStyle ? 'default' : 'with column-count style on container'}`, async ({ page }) => { + await setStyleAttribute(page, '#container', `padding: 5px; width: 300px; height: 200px; ${isColumnCountStyle ? 'column-count: 2' : ''}`); + + await insertStylesheetRulesToPage(page, `.${CHECKBOX_CLASS} { display: block; }`); + + await appendElementTo(page, '#container', 'div', 'checked'); + await createWidget(page, 'dxCheckBox', { value: true, text: 'checked' }, '#checked'); + + await appendElementTo(page, '#container', 'div', 'unchecked'); + await createWidget(page, 'dxCheckBox', { value: false, text: 'unchecked' }, '#unchecked'); + + await appendElementTo(page, '#container', 'div', 'indeterminate'); + await createWidget(page, 'dxCheckBox', { value: undefined, text: 'indeterminate' }, '#indeterminate'); + + await appendElementTo(page, '#container', 'div', 'checkedRTL'); + await createWidget(page, 'dxCheckBox', { value: true, text: 'checked', rtlEnabled: true }, '#checkedRTL'); + + await appendElementTo(page, '#container', 'div', 'uncheckedRTL'); + await createWidget(page, 'dxCheckBox', { value: false, text: 'unchecked', rtlEnabled: true }, '#uncheckedRTL'); + + await appendElementTo(page, '#container', 'div', 'indeterminateRTL'); + await createWidget(page, 'dxCheckBox', { value: undefined, text: 'indeterminate', rtlEnabled: true }, '#indeterminateRTL'); + + await testScreenshot(page, `Checkbox states${isColumnCountStyle ? ' with column count style' : ''}.png`, { element: '#container' }); + }); + }); + + test('Checkbox appearance', async ({ page }) => { + for (const state of [ + DEFAULT_STATE_CLASS, + READONLY_STATE_CLASS, + DISABLED_STATE_CLASS, + HOVER_STATE_CLASS, + ACTIVE_STATE_CLASS, + FOCUSED_STATE_CLASS, + `${FOCUSED_STATE_CLASS} ${HOVER_STATE_CLASS}`, + INVALID_STATE_CLASS, + `${INVALID_STATE_CLASS} ${FOCUSED_STATE_CLASS}`, + ]) { + await page.evaluate((stateName) => { + $('#container').append($('
').text(`State: ${stateName}`).css('fontSize', '10px')); + }, state); + + for (const iconSize of [undefined, 25]) { + for (const text of [undefined, 'Label text']) { + for (const rtlEnabled of [false, true]) { + for (const value of valueModes) { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + await createWidget(page, 'dxCheckBox', { + text, + value, + rtlEnabled, + iconSize, + }, `#${id}`); + await setClassAttribute(page, `#${id}`, state); + } + } + } + + for (const rtlEnabled of [false, true]) { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + await createWidget(page, 'dxCheckBox', { + text: 'Label text', + width: 50, + rtlEnabled, + }, `#${id}`); + await setClassAttribute(page, `#${id}`, state); + } + } + } + + await insertStylesheetRulesToPage(page, '.dx-checkbox.dx-widget { display: inline-flex; vertical-align: middle; margin-inline: 10px; }'); + + await testScreenshot(page, 'CheckBox appearance.png'); + + for (const scale of [1.15, 0.67]) { + await page.evaluate((scaleValue) => { + $('#container').css('transform', `scale(${scaleValue})`); + }, scale); + + await testScreenshot(page, `CheckBox appearance in scaled container, scale=${scale}.png`); + } + }); +}); diff --git a/e2e/playwright/tests/editors/checkBox/etalons/CheckBox appearance (fluent.blue.light).png b/e2e/playwright/tests/editors/checkBox/etalons/CheckBox appearance (fluent.blue.light).png new file mode 100644 index 000000000000..bf60f1bea04d Binary files /dev/null and b/e2e/playwright/tests/editors/checkBox/etalons/CheckBox appearance (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=0.67 (fluent.blue.light).png b/e2e/playwright/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=0.67 (fluent.blue.light).png new file mode 100644 index 000000000000..c794cd5bc4c4 Binary files /dev/null and b/e2e/playwright/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=0.67 (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=1.15 (fluent.blue.light).png b/e2e/playwright/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=1.15 (fluent.blue.light).png new file mode 100644 index 000000000000..e3400ea47d8f Binary files /dev/null and b/e2e/playwright/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=1.15 (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/checkBox/etalons/Checkbox states (fluent.blue.light).png b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox states (fluent.blue.light).png new file mode 100644 index 000000000000..791dd5f17190 Binary files /dev/null and b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox states (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/checkBox/etalons/Checkbox states with column count style (fluent.blue.light).png b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox states with column count style (fluent.blue.light).png new file mode 100644 index 000000000000..82e9de90d007 Binary files /dev/null and b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox states with column count style (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with bottom position (fluent.blue.light).png b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with bottom position (fluent.blue.light).png new file mode 100644 index 000000000000..6287b8f0790c Binary files /dev/null and b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with bottom position (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with left position (fluent.blue.light).png b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with left position (fluent.blue.light).png new file mode 100644 index 000000000000..4029bb61fc7f Binary files /dev/null and b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with left position (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with right position (fluent.blue.light).png b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with right position (fluent.blue.light).png new file mode 100644 index 000000000000..ca579ceb4f3b Binary files /dev/null and b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with right position (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with top position (fluent.blue.light).png b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with top position (fluent.blue.light).png new file mode 100644 index 000000000000..231a19116a5f Binary files /dev/null and b/e2e/playwright/tests/editors/checkBox/etalons/Checkbox validation message with top position (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/checkBox/validationMessage.spec.ts b/e2e/playwright/tests/editors/checkBox/validationMessage.spec.ts new file mode 100644 index 000000000000..1c266b59ce68 --- /dev/null +++ b/e2e/playwright/tests/editors/checkBox/validationMessage.spec.ts @@ -0,0 +1,57 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; +import CheckBox from '../../../models/checkBox'; + +const validatorOptions = { + validationRules: [{ + type: 'required', + message: 'it is required', + }], +}; + +test.describe('CheckBox_ValidationMessage', () => { + test('ValidationMessage integrated in editor should not raise any errors when it is placed inside of form and has name "style" (T941581)', async ({ page }) => { + await createWidget(page, 'dxCheckBox', { + name: 'style', + }); + await createWidget(page, 'dxValidator', validatorOptions); + + const checkBox = new CheckBox(page, '#container'); + + await checkBox.element.click(); + await checkBox.element.click(); + }); + + test('ValidationMessage integrated in editor should not raise any errors when it is placed inside of form that has inline style with scale (T941581)', async ({ page }) => { + await createWidget(page, 'dxCheckBox', {}); + await createWidget(page, 'dxValidator', validatorOptions); + + const checkBox = new CheckBox(page, '#container'); + + await checkBox.element.click(); + await checkBox.element.click(); + }); + + test.describe(() => { + test.use({ browserSize: [300, 200] }); + + ['top', 'right', 'bottom', 'left'].forEach((position) => { + test(`CheckBox ValidationMessage position is correct (${position})`, async ({ page }) => { + await createWidget(page, 'dxCheckBox', { + text: 'Click me!', + elementAttr: { style: 'margin: 50px 0 0 100px;' }, + validationMessagePosition: position, + }); + await createWidget(page, 'dxValidator', validatorOptions); + + const checkBox = new CheckBox(page, '#container'); + + await checkBox.element.click(); + await checkBox.element.click(); + + await testScreenshot(page, `Checkbox validation message with ${position} position.png`); + }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/colorbox/colorbox.spec.ts b/e2e/playwright/tests/editors/colorbox/colorbox.spec.ts new file mode 100644 index 000000000000..4622602e5313 --- /dev/null +++ b/e2e/playwright/tests/editors/colorbox/colorbox.spec.ts @@ -0,0 +1,38 @@ +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import ColorBox from '../../../models/colorBox'; + +test.describe('Colorbox', () => { + test('Colorbox should display full placeholder', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'colorBox'); + await setStyleAttribute(page, '#container', 'box-sizing: border-box; width: 300px; height: 100px; padding: 8px;'); + await createWidget(page, 'dxColorBox', { + width: '100%', + placeholder: 'I am a very long placeholder', + }, '#colorBox'); + + await testScreenshot(page, 'Colorbox with placeholder.png', { element: '#container' }); + }); + + ['#00ffff', 'rgb(0,255,255)', 'rgba(0,255,255,1)', 'aqua'].forEach((inputText) => { + ['Enter', 'Tab'].forEach((key) => { + test(`input value=${inputText} should be formatted to rgba after apply on ${key.toLowerCase()} key press`, async ({ page }) => { + await createWidget(page, 'dxColorBox', { + editAlphaChannel: true, + }, '#container'); + + const colorBox = new ColorBox(page, '#container'); + const expectedValue = 'rgba(0, 255, 255, 1)'; + + await colorBox.input.click(); + await colorBox.input.pressSequentially(inputText); + await page.keyboard.press(key); + + await expect.poll(() => colorBox.option('text')).toBe(expectedValue); + await expect.poll(() => colorBox.option('value')).toBe(expectedValue); + }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/colorbox/etalons/Colorbox with placeholder (fluent.blue.light).png b/e2e/playwright/tests/editors/colorbox/etalons/Colorbox with placeholder (fluent.blue.light).png new file mode 100644 index 000000000000..7bf66fc2e8a4 Binary files /dev/null and b/e2e/playwright/tests/editors/colorbox/etalons/Colorbox with placeholder (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/loadIndicator/common.spec.ts b/e2e/playwright/tests/editors/loadIndicator/common.spec.ts new file mode 100644 index 000000000000..f9fccbb61d53 --- /dev/null +++ b/e2e/playwright/tests/editors/loadIndicator/common.spec.ts @@ -0,0 +1,43 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { insertStylesheetRulesToPage } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; + +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'; + +test.describe('LoadIndicator', () => { + ['circle', 'sparkle'].forEach((animationType) => { + test(`LoadIndicator: start stage of the ${animationType} animation`, async ({ page }) => { + await insertStylesheetRulesToPage(page, ` + .${LOADINDICATOR_SEGMENT_CLASS}, + .${LOADINDICATOR_CONTENT_CLASS}, + .${LOADINDICATOR_ICON_CLASS}, + .${LOADINDICATOR_SEGMENT_INNER_CLASS} { + animation: none !important; + opacity: 1 !important; + } + `); + + if (animationType === 'sparkle') { + await insertStylesheetRulesToPage(page, ` + .${LOADINDICATOR_SEGMENT_CLASS} { + transform: scale(1) !important; + } + `); + } + + await createWidget(page, 'dxLoadIndicator', { + width: 128, + height: 128, + animationType, + }); + + await testScreenshot(page, `LoadIndicator with ${animationType} animation.png`, { + element: '#container', + }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/loadIndicator/etalons/LoadIndicator with circle animation (fluent.blue.light).png b/e2e/playwright/tests/editors/loadIndicator/etalons/LoadIndicator with circle animation (fluent.blue.light).png new file mode 100644 index 000000000000..46df57893b5c Binary files /dev/null and b/e2e/playwright/tests/editors/loadIndicator/etalons/LoadIndicator with circle animation (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/loadIndicator/etalons/LoadIndicator with sparkle animation (fluent.blue.light).png b/e2e/playwright/tests/editors/loadIndicator/etalons/LoadIndicator with sparkle animation (fluent.blue.light).png new file mode 100644 index 000000000000..068122116c8a Binary files /dev/null and b/e2e/playwright/tests/editors/loadIndicator/etalons/LoadIndicator with sparkle animation (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/numberBox/etalons/NumberBox label (fluent.blue.light).png b/e2e/playwright/tests/editors/numberBox/etalons/NumberBox label (fluent.blue.light).png new file mode 100644 index 000000000000..c19df9169aed Binary files /dev/null and b/e2e/playwright/tests/editors/numberBox/etalons/NumberBox label (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/numberBox/etalons/NumberBox render with buttons container (fluent.blue.light).png b/e2e/playwright/tests/editors/numberBox/etalons/NumberBox render with buttons container (fluent.blue.light).png new file mode 100644 index 000000000000..202f40158a19 Binary files /dev/null and b/e2e/playwright/tests/editors/numberBox/etalons/NumberBox render with buttons container (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/numberBox/label.spec.ts b/e2e/playwright/tests/editors/numberBox/label.spec.ts new file mode 100644 index 000000000000..0b4067a38387 --- /dev/null +++ b/e2e/playwright/tests/editors/numberBox/label.spec.ts @@ -0,0 +1,83 @@ +import { randomUUID } from 'node:crypto'; +import type { Page } from '@playwright/test'; +import type { EditorStyle, TextEditorButton } from 'devextreme/common'; +import type { NumberBoxPredefinedButton, Properties } from 'devextreme/ui/number_box'; +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, insertStylesheetRulesToPage } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import { isMaterial } from '../../../helpers/themeUtils'; + +const NUMBERBOX_CLASS = 'dx-numberbox'; + +const stylingModes: EditorStyle[] = ['outlined', 'underlined', 'filled']; +const buttonsList: (TextEditorButton | NumberBoxPredefinedButton)[][] = [ + ['clear'], + [{ name: 'custom', location: 'after', options: { icon: 'home' } }, 'clear', 'spins'], + ['clear', { name: 'custom', location: 'after', options: { icon: 'home' } }, 'spins'], + ['clear', 'spins', { name: 'custom', location: 'after', options: { icon: 'home' } }], + [{ name: 'custom', location: 'before', options: { icon: 'home' } }, 'clear', 'spins'], +]; + +const createNumberBox = async (page: Page, options?: Properties): Promise => { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + await createWidget(page, 'dxNumberBox', { + value: Math.PI, + showClearButton: true, + showSpinButtons: true, + ...options, + }, `#${id}`); + + return id; +}; + +test.describe('NumberBox_Label', () => { + test.describe(() => { + test.use({ browserSize: [350, 450] }); + + test('Label for dxNumberBox', async ({ page, theme }) => { + await insertStylesheetRulesToPage(page, '#container { display: flex; flex-direction: column; width: 300px; height: 400px; gap: 8px; }'); + + if (isMaterial(theme)) { + await insertStylesheetRulesToPage(page, '#container .dx-widget, #container .dx-widget input { font-family: sans-serif; }'); + } + + for (const stylingMode of stylingModes) { + const options = { + width: '100%', + label: 'label text', + stylingMode, + }; + + await createNumberBox(page, { + ...options, + // @ts-expect-error string instead of number + value: 'text', + }); + await createNumberBox(page, { + ...options, + value: 123, + }); + } + + await testScreenshot(page, 'NumberBox label.png'); + }); + }); + + test('NumberBox with buttons container', async ({ page }) => { + await insertStylesheetRulesToPage(page, `#container { display: flex; flex-wrap: wrap; } .${NUMBERBOX_CLASS} { width: 220px; margin: 2px; }`); + + for (const stylingMode of stylingModes) { + for (const buttons of buttonsList) { + await createNumberBox(page, { stylingMode, buttons }); + } + + await createNumberBox(page, { stylingMode, rtlEnabled: true }); + await createNumberBox(page, { stylingMode, isValid: false }); + } + + await testScreenshot(page, 'NumberBox render with buttons container.png'); + }); +}); diff --git a/e2e/playwright/tests/editors/radioGroup/common.spec.ts b/e2e/playwright/tests/editors/radioGroup/common.spec.ts new file mode 100644 index 000000000000..556bf9c4eb63 --- /dev/null +++ b/e2e/playwright/tests/editors/radioGroup/common.spec.ts @@ -0,0 +1,94 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import RadioGroup from '../../../models/radioGroup'; + +const RADIO_GROUP_CLASS = 'dx-radiogroup'; + +test.describe('Radio Group', () => { + test('Radio buttons placed into the template should not be selected after clicking the parent radio button (T816449)', async ({ page }) => { + await createWidget(page, 'dxRadioGroup', () => ({ + items: [{}, {}, {}], + itemTemplate: () => ($('
') as any).dxRadioGroup({ + dataSource: [{}, {}, {}], + layout: 'horizontal', + }), + })); + + const parentGroup = new RadioGroup(page, '#container'); + const getChildGroup = (itemIndex: number): RadioGroup => new RadioGroup( + page, + parentGroup.getItem(itemIndex).content.locator(`:scope > .${RADIO_GROUP_CLASS}`), + ); + const firstChildGroup = getChildGroup(0); + const secondChildGroup = getChildGroup(1); + const thirdChildGroup = getChildGroup(2); + + const checkGroup = async ( + group: RadioGroup, + firstChecked = false, + secondChecked = false, + thirdChecked = false, + ): Promise => { + await group.getItem().radioButton.expectChecked(firstChecked); + await group.getItem(1).radioButton.expectChecked(secondChecked); + await group.getItem(2).radioButton.expectChecked(thirdChecked); + }; + + await checkGroup(parentGroup); + await checkGroup(firstChildGroup); + await checkGroup(secondChildGroup); + await checkGroup(thirdChildGroup); + + await parentGroup.getItem().radioButton.element.click(); + await checkGroup(parentGroup, true); + await checkGroup(firstChildGroup); + await checkGroup(secondChildGroup); + await checkGroup(thirdChildGroup); + + await parentGroup.getItem(1).radioButton.element.click(); + await checkGroup(parentGroup, false, true); + await checkGroup(firstChildGroup); + await checkGroup(secondChildGroup); + await checkGroup(thirdChildGroup); + + await parentGroup.getItem(2).radioButton.element.click(); + await checkGroup(parentGroup, false, false, true); + await checkGroup(firstChildGroup); + await checkGroup(secondChildGroup); + await checkGroup(thirdChildGroup); + + await firstChildGroup.getItem().radioButton.element.click(); + await checkGroup(parentGroup, false, false, true); + await checkGroup(firstChildGroup, true); + await checkGroup(secondChildGroup); + await checkGroup(thirdChildGroup); + + await secondChildGroup.getItem(1).radioButton.element.click(); + await checkGroup(parentGroup, false, false, true); + await checkGroup(firstChildGroup, true); + await checkGroup(secondChildGroup, false, true); + await checkGroup(thirdChildGroup); + + await thirdChildGroup.getItem(2).radioButton.element.click(); + await checkGroup(parentGroup, false, false, true); + await checkGroup(firstChildGroup, true); + await checkGroup(secondChildGroup, false, true); + await checkGroup(thirdChildGroup, false, false, true); + }); + + test('Dot of Radio button placed in scaled container should have valid centering(T1165339)', async ({ page }) => { + await setStyleAttribute(page, '#container', 'width: 600px; height: 100px;'); + + await appendElementTo(page, '#container', 'div', 'radioGroup'); + await setStyleAttribute(page, '#radioGroup', 'transform: scale(0.7);'); + + await createWidget(page, 'dxRadioGroup', { + items: ['One', 'Two', 'Three'], + value: 'Two', + }, '#radioGroup'); + + await testScreenshot(page, 'RadioGroup in scaled container.png', { element: '#container' }); + }); +}); diff --git a/e2e/playwright/tests/editors/radioGroup/etalons/RadioGroup horizontal validation (fluent.blue.light).png b/e2e/playwright/tests/editors/radioGroup/etalons/RadioGroup horizontal validation (fluent.blue.light).png new file mode 100644 index 000000000000..bfe61df25033 Binary files /dev/null and b/e2e/playwright/tests/editors/radioGroup/etalons/RadioGroup horizontal validation (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/radioGroup/etalons/RadioGroup in scaled container (fluent.blue.light).png b/e2e/playwright/tests/editors/radioGroup/etalons/RadioGroup in scaled container (fluent.blue.light).png new file mode 100644 index 000000000000..7272234fad3a Binary files /dev/null and b/e2e/playwright/tests/editors/radioGroup/etalons/RadioGroup in scaled container (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/radioGroup/validationMessage.spec.ts b/e2e/playwright/tests/editors/radioGroup/validationMessage.spec.ts new file mode 100644 index 000000000000..e6c582caa57b --- /dev/null +++ b/e2e/playwright/tests/editors/radioGroup/validationMessage.spec.ts @@ -0,0 +1,47 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; +import Form from '../../../models/form'; +import RadioGroup from '../../../models/radioGroup'; + +const RADIO_GROUP_CLASS = 'dx-radiogroup'; + +test.describe('Radio Group Validation Message', () => { + test('message position is right (T1020449)', async ({ page }) => { + await createWidget(page, 'dxForm', { + width: 300, + height: 400, + items: [{ + itemType: 'simple', + dataField: 'PropertyNameId', + editorOptions: { + dataSource: ['HR Manager', 'IT Manager'], + layout: 'horizontal', + }, + editorType: 'dxRadioGroup', + validationRules: [{ + type: 'required', + message: 'The PropertyNameId field is required.', + }], + }, { + itemType: 'button', + horizontalAlignment: 'left', + buttonOptions: { + text: 'Register', + type: 'success', + useSubmitBehavior: true, + }, + }], + }); + + const form = new Form(page, '#container'); + + await form.validate(); + + const radioGroup = new RadioGroup(page, `.${RADIO_GROUP_CLASS}`); + + await radioGroup.focus(); + + await testScreenshot(page, 'RadioGroup horizontal validation.png', { element: '#container' }); + }); +}); diff --git a/e2e/playwright/tests/editors/slider/etalons/slider-appearance (fluent.blue.light).png b/e2e/playwright/tests/editors/slider/etalons/slider-appearance (fluent.blue.light).png new file mode 100644 index 000000000000..6313d76f02d5 Binary files /dev/null and b/e2e/playwright/tests/editors/slider/etalons/slider-appearance (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/slider/slider.spec.ts b/e2e/playwright/tests/editors/slider/slider.spec.ts new file mode 100644 index 000000000000..a5c0d7edcd75 --- /dev/null +++ b/e2e/playwright/tests/editors/slider/slider.spec.ts @@ -0,0 +1,17 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { testScreenshot } from '../../../helpers/screenshots'; + +test.describe('Slider', () => { + test('Slider appearance', async ({ page }) => { + await createWidget(page, 'dxSlider', { + tooltip: { + enabled: true, + showMode: 'always', + position: 'bottom', + }, + }); + + await testScreenshot(page, 'slider-appearance.png', { element: '#container' }); + }); +}); diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, height=5em & maxHeight=7em (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, height=5em & maxHeight=7em (fluent.blue.light).png new file mode 100644 index 000000000000..11eb4820fd66 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, height=5em & maxHeight=7em (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, height=7em & maxHeight=5em (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, height=7em & maxHeight=5em (fluent.blue.light).png new file mode 100644 index 000000000000..8f9727b94e13 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, height=7em & maxHeight=5em (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight is not defined (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight is not defined (fluent.blue.light).png new file mode 100644 index 000000000000..9d3da2eaf044 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight is not defined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em (fluent.blue.light).png new file mode 100644 index 000000000000..e8137b2d8d99 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em, font-size=12px (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em, font-size=12px (fluent.blue.light).png new file mode 100644 index 000000000000..e8137b2d8d99 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em, font-size=12px (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight=80px (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight=80px (fluent.blue.light).png new file mode 100644 index 000000000000..700e6ecf46d4 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea appearance, maxHeight=80px (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea label after scroll (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea label after scroll (fluent.blue.light).png new file mode 100644 index 000000000000..c92c4d86b30e Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea label after scroll (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png new file mode 100644 index 000000000000..5ec3ad9ee73a Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png new file mode 100644 index 000000000000..ca763a73623a Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png new file mode 100644 index 000000000000..47e69a87caac Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png new file mode 100644 index 000000000000..36a29db80753 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png new file mode 100644 index 000000000000..d0f04bb42b30 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png new file mode 100644 index 000000000000..55fd78d6f2d7 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=filled (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=filled (fluent.blue.light).png new file mode 100644 index 000000000000..46aeb619d8d2 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=filled (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png new file mode 100644 index 000000000000..2a4daf6720b6 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png new file mode 100644 index 000000000000..7eebdf2b04a2 Binary files /dev/null and b/e2e/playwright/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textArea/index.spec.ts b/e2e/playwright/tests/editors/textArea/index.spec.ts new file mode 100644 index 000000000000..ae3b5d11c6f6 --- /dev/null +++ b/e2e/playwright/tests/editors/textArea/index.spec.ts @@ -0,0 +1,160 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo, setAttribute } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; + +const text = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.'; + +test.describe('TextArea_Height', () => { + test('TextArea should have correct height when height is 7em & maxHeight is 5em', async ({ page }) => { + await setAttribute(page, '#container', 'style', 'width: 300px; height: 400px;'); + + const config = { + maxHeight: '5em', + height: '7em', + width: '100%', + value: text, + }; + + await appendElementTo(page, '#container', 'div', 'textArea1'); + await appendElementTo(page, '#container', 'div', 'textArea2'); + + await createWidget(page, 'dxTextArea', { + ...config, + autoResizeEnabled: true, + }, '#textArea1'); + + await createWidget(page, 'dxTextArea', { + ...config, + autoResizeEnabled: false, + }, '#textArea2'); + + await testScreenshot(page, 'TextArea appearance, height=7em & maxHeight=5em.png', { element: '#container' }); + }); + + test('TextArea should have correct height when height is 5em & maxHeight is 7em', async ({ page }) => { + await setAttribute(page, '#container', 'style', 'width: 300px; height: 400px;'); + + const config = { + maxHeight: '7em', + height: '5em', + width: '100%', + value: text, + }; + + await appendElementTo(page, '#container', 'div', 'textArea1'); + await appendElementTo(page, '#container', 'div', 'textArea2'); + + await createWidget(page, 'dxTextArea', { + ...config, + autoResizeEnabled: true, + }, '#textArea1'); + + await createWidget(page, 'dxTextArea', { + ...config, + autoResizeEnabled: false, + }, '#textArea2'); + + await testScreenshot(page, 'TextArea appearance, height=5em & maxHeight=7em.png', { element: '#container' }); + }); + + test('TextArea should have correct height when maxHeight is 5em', async ({ page }) => { + await setAttribute(page, '#container', 'style', 'width: 300px; height: 400px;'); + + const config = { + maxHeight: '5em', + width: '100%', + value: text, + }; + + await appendElementTo(page, '#container', 'div', 'textArea1'); + await appendElementTo(page, '#container', 'div', 'textArea2'); + + await createWidget(page, 'dxTextArea', { + ...config, + autoResizeEnabled: true, + }, '#textArea1'); + + await createWidget(page, 'dxTextArea', { + ...config, + autoResizeEnabled: false, + }, '#textArea2'); + + await testScreenshot(page, 'TextArea appearance, maxHeight=5em.png', { element: '#container' }); + }); + + test('TextArea with font-size style has correct height when maxHeight option is 5em', async ({ page }) => { + await setAttribute(page, '#container', 'style', 'width: 300px; height: 400px; font-size: 12px;'); + + const config = { + maxHeight: '5em', + width: '100%', + value: text, + }; + + await appendElementTo(page, '#container', 'div', 'textArea1'); + await appendElementTo(page, '#container', 'div', 'textArea2'); + + await createWidget(page, 'dxTextArea', { + ...config, + autoResizeEnabled: true, + }, '#textArea1'); + + await createWidget(page, 'dxTextArea', { + ...config, + autoResizeEnabled: false, + }, '#textArea2'); + + await testScreenshot(page, 'TextArea appearance, maxHeight=5em, font-size=12px.png', { element: '#container' }); + }); + + test('TextArea has correct height when maxHeight is not defined', async ({ page }) => { + await setAttribute(page, '#container', 'style', 'width: 300px;'); + + const config = { + width: '100%', + value: text, + autoResizeEnabled: true, + }; + + await appendElementTo(page, '#container', 'div', 'textArea1'); + await appendElementTo(page, '#container', 'div', 'textArea2'); + + await createWidget(page, 'dxTextArea', { + ...config, + }, '#textArea1'); + + await createWidget(page, 'dxTextArea', { + ...config, + value: text + text, + }, '#textArea2'); + + await testScreenshot(page, 'TextArea appearance, maxHeight is not defined.png', { element: '#container' }); + }); + + test('Height of TextArea input should have the correct height when the maxHeight option is set to 80px (T1221869)', async ({ page }) => { + await setAttribute(page, '#container', 'style', 'width: 300px; height: 400px;'); + + const config = { + value: text, + width: '100%', + maxHeight: 80, + autoResizeEnabled: true, + }; + + await appendElementTo(page, '#container', 'div', 'textArea1'); + await appendElementTo(page, '#container', 'div', 'textArea2'); + + await createWidget(page, 'dxTextArea', { + ...config, + autoResizeEnabled: true, + }, '#textArea1'); + + await createWidget(page, 'dxTextArea', { + ...config, + autoResizeEnabled: false, + }, '#textArea2'); + + await testScreenshot(page, 'TextArea appearance, maxHeight=80px.png', { element: '#container' }); + }); +}); diff --git a/e2e/playwright/tests/editors/textArea/label.spec.ts b/e2e/playwright/tests/editors/textArea/label.spec.ts new file mode 100644 index 000000000000..795c46a0c6bf --- /dev/null +++ b/e2e/playwright/tests/editors/textArea/label.spec.ts @@ -0,0 +1,58 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo } from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import TextArea from '../../../models/textArea'; + +const labelModes = ['floating', 'static', 'outside']; +const stylingModes = ['outlined', 'underlined', 'filled']; + +test.describe('Label', () => { + test('Label scroll input dxTextArea', async ({ page }) => { + await createWidget(page, 'dxTextArea', { + height: 50, + width: 200, + text: `this content is ${'very '.repeat(10)}long`, + label: 'label text', + }); + + const textArea = new TextArea(page, '#container'); + + await textArea.input.evaluate((element) => { element.scrollTo(0, 20); }); + + await testScreenshot(page, 'TextArea label after scroll.png', { element: '#container' }); + }); + + test.describe(() => { + test.use({ browserSize: [300, 400] }); + + stylingModes.forEach((stylingMode) => { + labelModes.forEach((labelMode) => { + test(`Label for dxTextArea labelMode=${labelMode} stylingMode=${stylingMode}`, async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'textArea1'); + await appendElementTo(page, '#container', 'div', 'textArea2'); + + await createWidget(page, 'dxTextArea', { + width: 100, + label: 'label', + text: '', + labelMode, + stylingMode, + }, '#textArea1'); + + await createWidget(page, 'dxTextArea', { + label: `this label is ${'very '.repeat(10)}long`, + text: `this content is ${'very '.repeat(10)}long`, + items: ['item1', 'item2'], + labelMode, + stylingMode, + }, '#textArea2'); + + await page.locator('#textArea2').click(); + + await testScreenshot(page, `TextArea with label-labelMode=${labelMode}-stylingMode=${stylingMode}.png`); + }); + }); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/textBox/etalons/Textbox render (fluent.blue.light).png b/e2e/playwright/tests/editors/textBox/etalons/Textbox render (fluent.blue.light).png new file mode 100644 index 000000000000..d8e41399c008 Binary files /dev/null and b/e2e/playwright/tests/editors/textBox/etalons/Textbox render (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textBox/etalons/Textbox render with limited width (fluent.blue.light).png b/e2e/playwright/tests/editors/textBox/etalons/Textbox render with limited width (fluent.blue.light).png new file mode 100644 index 000000000000..8ac9a145f332 Binary files /dev/null and b/e2e/playwright/tests/editors/textBox/etalons/Textbox render with limited width (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textBox/etalons/Textbox states (fluent.blue.light).png b/e2e/playwright/tests/editors/textBox/etalons/Textbox states (fluent.blue.light).png new file mode 100644 index 000000000000..4781353116b3 Binary files /dev/null and b/e2e/playwright/tests/editors/textBox/etalons/Textbox states (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textBox/etalons/Textbox validation message (fluent.blue.light).png b/e2e/playwright/tests/editors/textBox/etalons/Textbox validation message (fluent.blue.light).png new file mode 100644 index 000000000000..f89a38c5016b Binary files /dev/null and b/e2e/playwright/tests/editors/textBox/etalons/Textbox validation message (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textBox/etalons/Textbox with buttons container (fluent.blue.light).png b/e2e/playwright/tests/editors/textBox/etalons/Textbox with buttons container (fluent.blue.light).png new file mode 100644 index 000000000000..4d39ad19d3be Binary files /dev/null and b/e2e/playwright/tests/editors/textBox/etalons/Textbox with buttons container (fluent.blue.light).png differ diff --git a/e2e/playwright/tests/editors/textBox/label.spec.ts b/e2e/playwright/tests/editors/textBox/label.spec.ts new file mode 100644 index 000000000000..92b4560f3796 --- /dev/null +++ b/e2e/playwright/tests/editors/textBox/label.spec.ts @@ -0,0 +1,205 @@ +import { randomUUID } from 'node:crypto'; +import type { Page } from '@playwright/test'; +import type { EditorStyle, LabelMode, TextEditorButton } from 'devextreme/common'; +import type { Properties } from 'devextreme/ui/text_box'; +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { + appendElementTo, insertStylesheetRulesToPage, removeStylesheetRulesFromPage, + setClassAttribute, setStyleAttribute, +} from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; +import { getThemeName, isMaterial } from '../../../helpers/themeUtils'; +import TextBox from '../../../models/textBox'; + +const visibleLabelModes: LabelMode[] = ['floating', 'static', 'outside']; +const stylingModes: EditorStyle[] = ['outlined', 'underlined', 'filled']; +const buttonsList: (string | TextEditorButton)[][] = [ + ['clear'], + ['clear', { name: 'custom', location: 'after', options: { icon: 'home' } }], + [{ name: 'custom', location: 'after', options: { icon: 'home' } }, 'clear'], + ['clear', { name: 'custom', location: 'before', options: { icon: 'home' } }], +]; + +const TEXTBOX_CLASS = 'dx-textbox'; +const HOVER_STATE_CLASS = 'dx-state-hover'; +const FOCUSED_STATE_CLASS = 'dx-state-focused'; +const READONLY_STATE_CLASS = 'dx-state-readonly'; +const INVALID_STATE_CLASS = 'dx-invalid'; + +const createTextBox = async (page: Page, options?: Properties, state?: string): Promise => { + const id = `dx${randomUUID()}`; + + await appendElementTo(page, '#container', 'div', id); + await createWidget(page, 'dxTextBox', { + labelMode: 'floating', + stylingMode: 'outlined', + text: 'Text', + label: 'Label Text', + ...options, + }, `#${id}`); + + if (state) { + await setClassAttribute(page, `#${id}`, state); + } + + return id; +}; + +test.describe('TextBox_Label', () => { + [ + { + labelMode: 'static', + expectedWidths: { + generic: 82, material: 68, fluent: 74, + }, + }, + { + labelMode: 'floating', + expectedWidths: { + generic: 82, material: 68, fluent: 74, + }, + }, + { + labelMode: 'outside', + expectedWidths: { + generic: 'none', material: 'none', fluent: 'none', + }, + }, + ].forEach(({ labelMode, expectedWidths }) => { + test(`Label max-width should be changed after container width was changed, labelMode is ${labelMode}`, async ({ page, theme }) => { + const initialWidth = 100; + const deltaWidth = 300; + + await createWidget(page, 'dxTextBox', { + width: initialWidth, + label: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', + labelMode, + }); + + const textBox = new TextBox(page, '#container'); + const expectedWidth: number | 'none' = expectedWidths[getThemeName(theme)]; + + await expect(textBox.getLabel()) + .toHaveCSS('max-width', expectedWidth === 'none' ? 'none' : `${expectedWidth}px`); + + await setStyleAttribute(page, '#container', `width: ${initialWidth + deltaWidth}px;`); + + await expect(textBox.getLabel()) + .toHaveCSS('max-width', expectedWidth === 'none' ? 'none' : `${expectedWidth + deltaWidth}px`); + }); + }); + + test('Textbox render', async ({ page }) => { + for (const stylingMode of stylingModes) { + for (const labelMode of visibleLabelModes) { + for (const placeholder of ['Placeholder', '']) { + await createTextBox(page, { + text: undefined, + placeholder, + stylingMode, + labelMode, + }); + } + + await createTextBox(page, { text: 'Text value' }); + await createTextBox(page, { rtlEnabled: true }); + } + + for (const placeholder of ['Placeholder', '']) { + await createTextBox(page, { + text: undefined, + placeholder, + stylingMode, + label: undefined, + }); + } + + await createTextBox(page, { label: undefined, text: 'Text value' }); + await createTextBox(page, { label: undefined, rtlEnabled: true }); + } + + await insertStylesheetRulesToPage(page, `.${TEXTBOX_CLASS} { display: inline-block; vertical-align: middle; width: 60px; margin: 5px; }`); + + await testScreenshot(page, 'Textbox render with limited width.png', { element: '#container' }); + + await removeStylesheetRulesFromPage(page); + + await insertStylesheetRulesToPage(page, `.${TEXTBOX_CLASS} { display: inline-block; vertical-align: middle; width: 260px; margin: 5px; }`); + + await testScreenshot(page, 'Textbox render.png'); + }); + + test('Textbox states', async ({ page }) => { + const states = [ + HOVER_STATE_CLASS, + FOCUSED_STATE_CLASS, + READONLY_STATE_CLASS, + INVALID_STATE_CLASS, + `${INVALID_STATE_CLASS} ${FOCUSED_STATE_CLASS}`, + ]; + + for (const state of states) { + for (const placeholder of ['Placeholder', '']) { + await createTextBox(page, { + text: undefined, + placeholder, + }, state); + } + + await createTextBox(page, { text: 'Text value' }, state); + await createTextBox(page, { rtlEnabled: true }, state); + } + + await insertStylesheetRulesToPage(page, `.${TEXTBOX_CLASS} { display: inline-block; vertical-align: middle; width: 260px; margin: 5px; }`); + + await testScreenshot(page, 'Textbox states.png', { element: '#container' }); + }); + + test('Textbox with buttons container', async ({ page, theme }) => { + if (isMaterial(theme)) { + await insertStylesheetRulesToPage(page, '#container .dx-widget { font-family: sans-serif }'); + } + + for (const stylingMode of stylingModes) { + for (const buttons of buttonsList) { + await createTextBox(page, { stylingMode, buttons, showClearButton: true }); + await createTextBox(page, { + stylingMode, buttons, showClearButton: true, isValid: false, + }); + } + } + + await insertStylesheetRulesToPage(page, '#container { display: flex; flex-wrap: wrap; gap: 4px; }'); + + await testScreenshot(page, 'Textbox with buttons container.png'); + }); + + stylingModes.forEach((stylingMode) => { + const options = { + value: 'text', + label: 'Label text', + labelMode: 'outside', + stylingMode, + width: 500, + }; + + test(`TextBox should not be hovered after hover of outside label, stylingMode=${stylingMode}`, async ({ page }) => { + await createWidget(page, 'dxTextBox', options); + + const textBox = new TextBox(page, '#container'); + + await textBox.getLabelSpan().hover(); + await textBox.expectHovered(false); + }); + + test(`TextBox should be focused after click on outside label, stylingMode=${stylingMode}`, async ({ page }) => { + await createWidget(page, 'dxTextBox', options); + + const textBox = new TextBox(page, '#container'); + + await textBox.getLabelSpan().click(); + await textBox.expectFocused(); + }); + }); +}); diff --git a/e2e/playwright/tests/editors/textBox/mask.spec.ts b/e2e/playwright/tests/editors/textBox/mask.spec.ts new file mode 100644 index 000000000000..dd19f6e78c6f --- /dev/null +++ b/e2e/playwright/tests/editors/textBox/mask.spec.ts @@ -0,0 +1,21 @@ +import { expect, test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { appendElementTo } from '../../../helpers/domUtils'; +import TextBox from '../../../models/textBox'; + +test.describe('TextBox_mask', () => { + test('"!" character should not be accepted if mask restricts it (T1156419)', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'textBox'); + await createWidget(page, 'dxTextBox', { + mask: '9', + }, '#textBox'); + + const { input } = new TextBox(page, '#textBox'); + + await input.click(); + await input.evaluate((element: HTMLInputElement) => { element.setSelectionRange(0, 0); }); + await input.pressSequentially('!'); + + await expect(input).toHaveValue('_'); + }); +}); diff --git a/e2e/playwright/tests/editors/textBox/validationMessage.spec.ts b/e2e/playwright/tests/editors/textBox/validationMessage.spec.ts new file mode 100644 index 000000000000..7f315e10beea --- /dev/null +++ b/e2e/playwright/tests/editors/textBox/validationMessage.spec.ts @@ -0,0 +1,40 @@ +import { test } from '../../../fixtures'; +import { createWidget } from '../../../helpers/createWidget'; +import { + addFocusableElementBefore, appendElementTo, removeAttribute, setAttribute, waitForNextFrame, +} from '../../../helpers/domUtils'; +import { testScreenshot } from '../../../helpers/screenshots'; + +const TEXTEDITOR_INPUT_CLASS = 'dx-texteditor-input'; + +test.describe('ValidationMessage', () => { + test.use({ browserSize: [300, 200] }); + + test('Validation Message position should be correct after change visibility of parent container (T1095900)', async ({ page }) => { + await appendElementTo(page, '#container', 'div', 'textbox'); + await createWidget(page, 'dxTextBox', { + value: 'a', + validationMessageMode: 'always', + }, '#textbox'); + await createWidget(page, 'dxValidator', { + validationRules: [ + { + type: 'required', + }, + ], + }, '#textbox'); + + await addFocusableElementBefore(page, '#container'); + + await page.locator(`.${TEXTEDITOR_INPUT_CLASS}`).click(); + await page.keyboard.press('Backspace'); + await page.keyboard.press('Enter'); + await page.locator('#focusable-start').click(); + + await setAttribute(page, '#container', 'hidden', 'true'); + await waitForNextFrame(page); + await removeAttribute(page, '#container', 'hidden'); + + await testScreenshot(page, 'Textbox validation message.png'); + }); +}); diff --git a/e2e/testcafe-devextreme/tests/editors/autocomplete/common.ts b/e2e/testcafe-devextreme/tests/editors/autocomplete/common.ts deleted file mode 100644 index e4e798b402cc..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/autocomplete/common.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import Autocomplete from 'devextreme-testcafe-models/autocomplete'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; - -fixture.disablePageReloads`Autocomplete_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 autocomplete = new Autocomplete('#autocomplete'); - - await autocomplete.option('items', [1, 2, 3]); - - await testScreenshot(t, takeScreenshot, 'Autocomplete placeholder if value is not choosen.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'autocomplete'); - await setStyleAttribute(Selector('#container'), 'box-sizing: border-box; width: 300px; height: 100px; padding: 8px;'); - - return createWidget('dxAutocomplete', { - width: '100%', - placeholder: 'Choose a value', - }, '#autocomplete'); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/autocomplete/etalons/Autocomplete placeholder if value is not choosen (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/autocomplete/etalons/Autocomplete placeholder if value is not choosen (fluent.blue.light).png deleted file mode 100644 index f68224c803c6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/autocomplete/etalons/Autocomplete placeholder if value is not choosen (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/common.ts b/e2e/testcafe-devextreme/tests/editors/checkBox/common.ts deleted file mode 100644 index 1283f1d7faf3..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/checkBox/common.ts +++ /dev/null @@ -1,135 +0,0 @@ -/* eslint-disable no-restricted-syntax */ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import { ClientFunction, Selector } from 'testcafe'; -import Guid from 'devextreme/core/guid'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { - appendElementTo, - insertStylesheetRulesToPage, - setClassAttribute, - setStyleAttribute, -} from '../../../helpers/domUtils'; -import { testScreenshot } from '../../../helpers/themeUtils'; - -const valueModes = [false, true, undefined]; - -const CHECKBOX_CLASS = 'dx-checkbox'; -const READONLY_STATE_CLASS = 'dx-state-readonly'; -const DEFAULT_STATE_CLASS = ''; -const ACTIVE_STATE_CLASS = 'dx-state-active'; -const HOVER_STATE_CLASS = 'dx-state-hover'; -const FOCUSED_STATE_CLASS = 'dx-state-focused'; -const DISABLED_STATE_CLASS = 'dx-state-disabled'; -const INVALID_STATE_CLASS = 'dx-invalid'; - -fixture.disablePageReloads`CheckBox` - .page(url(__dirname, '../../container.html')); - -[false, true].forEach((isColumnCountStyle) => { - test(`Render ${!isColumnCountStyle ? 'default' : 'with column-count style on container'}`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `Checkbox states${isColumnCountStyle ? ' with column count style' : ''}.png`, { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await setStyleAttribute(Selector('#container'), `padding: 5px; width: 300px; height: 200px; ${isColumnCountStyle ? 'column-count: 2' : ''}`); - - await insertStylesheetRulesToPage(`.${CHECKBOX_CLASS} { display: block; }`); - - await appendElementTo('#container', 'div', 'checked'); - await createWidget('dxCheckBox', { value: true, text: 'checked' }, '#checked'); - - await appendElementTo('#container', 'div', 'unchecked'); - await createWidget('dxCheckBox', { value: false, text: 'unchecked' }, '#unchecked'); - - await appendElementTo('#container', 'div', 'indeterminate'); - await createWidget('dxCheckBox', { value: undefined, text: 'indeterminate' }, '#indeterminate'); - - // rtl - await appendElementTo('#container', 'div', 'checkedRTL'); - await createWidget('dxCheckBox', { value: true, text: 'checked', rtlEnabled: true }, '#checkedRTL'); - - await appendElementTo('#container', 'div', 'uncheckedRTL'); - await createWidget('dxCheckBox', { value: false, text: 'unchecked', rtlEnabled: true }, '#uncheckedRTL'); - - await appendElementTo('#container', 'div', 'indeterminateRTL'); - await createWidget('dxCheckBox', { value: undefined, text: 'indeterminate', rtlEnabled: true }, '#indeterminateRTL'); - }); -}); - -test('Checkbox appearance', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await insertStylesheetRulesToPage('.dx-checkbox.dx-widget { display: inline-flex; vertical-align: middle; margin-inline: 10px; }'); - - await testScreenshot(t, takeScreenshot, 'CheckBox appearance.png'); - - for (const scale of [1.15, 0.67]) { - await ClientFunction(() => { - $('#container').css('transform', `scale(${scale})`); - }, { - dependencies: { scale }, - })(); - - await testScreenshot(t, takeScreenshot, `CheckBox appearance in scaled container, scale=${scale}.png`); - } - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - for (const state of [ - DEFAULT_STATE_CLASS, - READONLY_STATE_CLASS, - DISABLED_STATE_CLASS, - HOVER_STATE_CLASS, - ACTIVE_STATE_CLASS, - FOCUSED_STATE_CLASS, - `${FOCUSED_STATE_CLASS} ${HOVER_STATE_CLASS}`, - INVALID_STATE_CLASS, - `${INVALID_STATE_CLASS} ${FOCUSED_STATE_CLASS}`, - ] as string[]) { - await ClientFunction(() => { - $('#container').append($('
').text(`State: ${state}`).css('fontSize', '10px')); - }, { - dependencies: { - state, - }, - })(); - - for (const iconSize of [undefined, 25]) { - for (const text of [undefined, 'Label text']) { - for (const rtlEnabled of [false, true]) { - for (const value of valueModes) { - const id = `dx${new Guid()}`; - await appendElementTo('#container', 'div', id, {}); - - await createWidget('dxCheckBox', { - text, - value, - rtlEnabled, - iconSize, - }, `#${id}`); - await setClassAttribute(Selector(`#${id}`), state); - } - } - } - - for (const rtlEnabled of [false, true]) { - const id = `dx${new Guid()}`; - await appendElementTo('#container', 'div', id, {}); - - await createWidget('dxCheckBox', { - text: 'Label text', - width: 50, - rtlEnabled, - }, `#${id}`); - await setClassAttribute(Selector(`#${id}`), state); - } - } - } -}); diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/CheckBox appearance (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/CheckBox appearance (fluent.blue.light).png deleted file mode 100644 index 5fe6e3397474..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/CheckBox appearance (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=0.67 (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=0.67 (fluent.blue.light).png deleted file mode 100644 index 9a95cf9df2b5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=0.67 (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=1.15 (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=1.15 (fluent.blue.light).png deleted file mode 100644 index 31f93b6792e7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/CheckBox appearance in scaled container, scale=1.15 (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox states (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox states (fluent.blue.light).png deleted file mode 100644 index 65cde239836a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox states (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox states with column count style (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox states with column count style (fluent.blue.light).png deleted file mode 100644 index 58f6fc0125f9..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox states with column count style (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with bottom position (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with bottom position (fluent.blue.light).png deleted file mode 100644 index a0e36aef50e6..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with bottom position (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with left position (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with left position (fluent.blue.light).png deleted file mode 100644 index 281abac112e4..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with left position (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with right position (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with right position (fluent.blue.light).png deleted file mode 100644 index b225a7525917..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with right position (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with top position (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with top position (fluent.blue.light).png deleted file mode 100644 index 1620c85a5632..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/checkBox/etalons/Checkbox validation message with top position (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/checkBox/validationMessage.ts b/e2e/testcafe-devextreme/tests/editors/checkBox/validationMessage.ts deleted file mode 100644 index 41f113262770..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/checkBox/validationMessage.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import CheckBox from 'devextreme-testcafe-models/checkBox'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; - -fixture.disablePageReloads`CheckBox_ValidationMessage` - .page(url(__dirname, '../../container.html')); - -test('ValidationMessage integrated in editor should not raise any errors when it is placed inside of form and has name "style" (T941581)', async (t) => { - const checkBox = new CheckBox('#container'); - await t - .click(checkBox.element) - .click(checkBox.element) - .expect(true).ok(); -}).before(async () => { - await createWidget('dxCheckBox', { - name: 'style', - }); - - return createWidget('dxValidator', { - validationRules: [{ - type: 'required', - message: 'it is required', - }], - }); -}); - -test('ValidationMessage integrated in editor should not raise any errors when it is placed inside of form that has inline style with scale (T941581)', async (t) => { - const checkBox1 = new CheckBox('#container'); - await t - .click(checkBox1.element) - .click(checkBox1.element) - .expect(true).ok(); -}).before(async () => { - await createWidget('dxCheckBox', {}); - - return createWidget('dxValidator', { - validationRules: [{ - type: 'required', - message: 'it is required', - }], - }); -}); - -const positions = ['top', 'right', 'bottom', 'left']; -positions.forEach((position) => { - test.meta({ browserSize: [300, 200] })(`CheckBox ValidationMessage position is correct (${position})`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const checkBox1 = new CheckBox('#container'); - await t - .click(checkBox1.element) - .click(checkBox1.element) - .expect(true).ok(); - - await testScreenshot(t, takeScreenshot, `Checkbox validation message with ${position} position.png`); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await createWidget('dxCheckBox', { - text: 'Click me!', - elementAttr: { style: 'margin: 50px 0 0 100px;' }, - validationMessagePosition: position, - }); - - return createWidget('dxValidator', { - validationRules: [{ - type: 'required', - message: 'it is required', - }], - }); - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/colorbox/colorbox.ts b/e2e/testcafe-devextreme/tests/editors/colorbox/colorbox.ts deleted file mode 100644 index 491b712239e7..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/colorbox/colorbox.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import ColorBox from 'devextreme-testcafe-models/colorbox'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; - -fixture.disablePageReloads`Colorbox` - .page(url(__dirname, '../../container.html')); - -test('Colorbox should display full placeholder', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'Colorbox with placeholder.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'colorBox'); - await setStyleAttribute(Selector('#container'), 'box-sizing: border-box; width: 300px; height: 100px; padding: 8px;'); - - return createWidget('dxColorBox', { - width: '100%', - placeholder: 'I am a very long placeholder', - }, '#colorBox'); -}); - -['#00ffff', 'rgb(0,255,255)', 'rgba(0,255,255,1)', 'aqua'].forEach((inputText) => { - ['enter', 'tab'].forEach((key) => { - test(`input value=${inputText} should be formatted to rgba after apply on ${key} key press`, async (t) => { - const colorBox = new ColorBox('#container'); - const expectedValue = 'rgba(0, 255, 255, 1)'; - - await t - .click(colorBox.input); - - await t - .typeText(colorBox.input, inputText) - .pressKey(key) - .expect(colorBox.option('text')) - .eql(expectedValue) - .expect(colorBox.option('value')) - .eql(expectedValue); - }).before(async () => createWidget('dxColorBox', { - editAlphaChannel: true, - }, '#container')); - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/colorbox/etalons/Colorbox with placeholder (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/colorbox/etalons/Colorbox with placeholder (fluent.blue.light).png deleted file mode 100644 index 8d548cba2372..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/colorbox/etalons/Colorbox with placeholder (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/loadIndIcator/common.ts b/e2e/testcafe-devextreme/tests/editors/loadIndIcator/common.ts deleted file mode 100644 index b5b68a8a7f88..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/loadIndIcator/common.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import { insertStylesheetRulesToPage } from '../../../helpers/domUtils'; - -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'; - -fixture.disablePageReloads`LoadIndicator` - .page(url(__dirname, '../../container.html')); - -['circle', 'sparkle'].forEach((animationType) => { - test(`LoadIndicator: start stage of the ${animationType} animation`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, `LoadIndicator with ${animationType} animation.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; - } - `); - - if (animationType === 'sparkle') { - await insertStylesheetRulesToPage(` - .${LOADINDICATOR_SEGMENT_CLASS} { - transform: scale(1) !important; - } - `); - } - - return createWidget('dxLoadIndicator', { - width: 128, - height: 128, - animationType, - }); - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/loadIndIcator/etalons/LoadIndicator with circle animation (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/loadIndIcator/etalons/LoadIndicator with circle animation (fluent.blue.light).png deleted file mode 100644 index 16bf82307bc1..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/loadIndIcator/etalons/LoadIndicator with circle animation (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/loadIndIcator/etalons/LoadIndicator with sparkle animation (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/loadIndIcator/etalons/LoadIndicator with sparkle animation (fluent.blue.light).png deleted file mode 100644 index 0e25cde7cb6f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/loadIndIcator/etalons/LoadIndicator with sparkle animation (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/numberBox/etalons/NumberBox label (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/numberBox/etalons/NumberBox label (fluent.blue.light).png deleted file mode 100644 index d484079da7b8..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/numberBox/etalons/NumberBox label (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/numberBox/etalons/NumberBox render with buttons container (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/numberBox/etalons/NumberBox render with buttons container (fluent.blue.light).png deleted file mode 100644 index af5e76f9bf46..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/numberBox/etalons/NumberBox render with buttons container (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/numberBox/label.ts b/e2e/testcafe-devextreme/tests/editors/numberBox/label.ts deleted file mode 100644 index 5230d167d700..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/numberBox/label.ts +++ /dev/null @@ -1,93 +0,0 @@ -import type { Properties, NumberBoxPredefinedButton } from 'devextreme/ui/number_box.d'; -import type { EditorStyle, TextEditorButton } from 'devextreme/common'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import Guid from 'devextreme/core/guid'; -import { isMaterial, testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { - appendElementTo, insertStylesheetRulesToPage, -} from '../../../helpers/domUtils'; - -const NUMBERBOX_CLASS = 'dx-numberbox'; - -const stylingModes: EditorStyle[] = ['outlined', 'underlined', 'filled']; -const buttonsList: (TextEditorButton | NumberBoxPredefinedButton)[][] = [ - ['clear'], - [{ name: 'custom', location: 'after', options: { icon: 'home' } }, 'clear', 'spins'], - ['clear', { name: 'custom', location: 'after', options: { icon: 'home' } }, 'spins'], - ['clear', 'spins', { name: 'custom', location: 'after', options: { icon: 'home' } }], - [{ name: 'custom', location: 'before', options: { icon: 'home' } }, 'clear', 'spins'], -]; - -fixture.disablePageReloads`NumberBox_Label` - .page(url(__dirname, '../../container.html')); - -const createNumberBox = async (options?: Properties): Promise => { - const id = `${`dx${new Guid()}`}`; - - await appendElementTo('#container', 'div', id, {}); - await createWidget('dxNumberBox', { - value: Math.PI, - showClearButton: true, - showSpinButtons: true, - ...options, - }, `#${id}`); - - return id; -}; -test.meta({ browserSize: [350, 450] })('Label for dxNumberBox', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'NumberBox label.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await insertStylesheetRulesToPage('#container { display: flex; flex-direction: column; width: 300px; height: 400px; gap: 8px; }'); - if (isMaterial()) { - await insertStylesheetRulesToPage('#container .dx-widget, #container .dx-widget input { font-family: sans-serif; }'); - } - - // eslint-disable-next-line no-restricted-syntax - for (const stylingMode of stylingModes) { - const options = { - width: '100%', - label: 'label text', - stylingMode, - }; - await createNumberBox({ - ...options, - // @ts-expect-error string instead of number - value: 'text', - }); - await createNumberBox({ - ...options, - value: 123, - }); - } -}); - -test('NumberBox with buttons container', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'NumberBox render with buttons container.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await insertStylesheetRulesToPage(`#container { display: flex; flex-wrap: wrap; } .${NUMBERBOX_CLASS} { width: 220px; margin: 2px; }`); - - // eslint-disable-next-line no-restricted-syntax - for (const stylingMode of stylingModes) { - // eslint-disable-next-line no-restricted-syntax - for (const buttons of buttonsList) { - await createNumberBox({ stylingMode, buttons }); - } - - await createNumberBox({ stylingMode, rtlEnabled: true }); - await createNumberBox({ stylingMode, isValid: false }); - } -}); diff --git a/e2e/testcafe-devextreme/tests/editors/radioGroup/common.ts b/e2e/testcafe-devextreme/tests/editors/radioGroup/common.ts deleted file mode 100644 index 39e204744107..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/radioGroup/common.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import { Selector } from 'testcafe'; -import RadioGroup from 'devextreme-testcafe-models/radioGroup'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils'; - -fixture.disablePageReloads`Radio Group` - .page(url(__dirname, '../../container.html')); - -test('Radio buttons placed into the template should not be selected after clicking the parent radio button (T816449)', async (t) => { - const parentGroup = new RadioGroup('#container'); - const firstChildGroup = new RadioGroup(parentGroup.getItem().content.child().nth(0)); - const secondChildGroup = new RadioGroup(parentGroup.getItem(1).content.child()); - const thirdChildGroup = new RadioGroup(parentGroup.getItem(2).content.child()); - - const checkGroup = async ( - group: RadioGroup, - firstChecked = false, - secondChecked = false, - thirdChecked = false, - ): Promise => { - await t - .expect(group.getItem().radioButton.isChecked).eql(firstChecked) - .expect(group.getItem(1).radioButton.isChecked).eql(secondChecked) - .expect(group.getItem(2).radioButton.isChecked) - .eql(thirdChecked); - }; - - await checkGroup(parentGroup); - await checkGroup(firstChildGroup); - await checkGroup(secondChildGroup); - await checkGroup(thirdChildGroup); - - await t.click(parentGroup.getItem().radioButton.element); - await checkGroup(parentGroup, true); - await checkGroup(firstChildGroup); - await checkGroup(secondChildGroup); - await checkGroup(thirdChildGroup); - - await t.click(parentGroup.getItem(1).radioButton.element); - await checkGroup(parentGroup, false, true); - await checkGroup(firstChildGroup); - await checkGroup(secondChildGroup); - await checkGroup(thirdChildGroup); - - await t.click(parentGroup.getItem(2).radioButton.element); - await checkGroup(parentGroup, false, false, true); - await checkGroup(firstChildGroup); - await checkGroup(secondChildGroup); - await checkGroup(thirdChildGroup); - - await t.click(firstChildGroup.getItem().radioButton.element); - await checkGroup(parentGroup, false, false, true); - await checkGroup(firstChildGroup, true); - await checkGroup(secondChildGroup); - await checkGroup(thirdChildGroup); - - await t.click(secondChildGroup.getItem(1).radioButton.element); - await checkGroup(parentGroup, false, false, true); - await checkGroup(firstChildGroup, true); - await checkGroup(secondChildGroup, false, true); - await checkGroup(thirdChildGroup); - - await t.click(thirdChildGroup.getItem(2).radioButton.element); - await checkGroup(parentGroup, false, false, true); - await checkGroup(firstChildGroup, true); - await checkGroup(secondChildGroup, false, true); - await checkGroup(thirdChildGroup, false, false, true); -}).before(async () => createWidget('dxRadioGroup', { - items: [{}, {}, {}], - itemTemplate: () => ($('
') as any).dxRadioGroup({ - dataSource: [{}, {}, {}], - layout: 'horizontal', - }), -})); - -test('Dot of Radio button placed in scaled container should have valid centering(T1165339)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'RadioGroup in scaled container.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await setStyleAttribute(Selector('#container'), 'width: 600px; height: 100px;'); - - await appendElementTo('#container', 'div', 'radioGroup'); - await setStyleAttribute(Selector('#radioGroup'), 'transform: scale(0.7);'); - - await createWidget('dxRadioGroup', { - items: ['One', 'Two', 'Three'], - value: 'Two', - }, '#radioGroup'); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/radioGroup/etalons/RadioGroup horizontal validation (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/radioGroup/etalons/RadioGroup horizontal validation (fluent.blue.light).png deleted file mode 100644 index 68d151862078..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/radioGroup/etalons/RadioGroup horizontal validation (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/radioGroup/etalons/RadioGroup in scaled container (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/radioGroup/etalons/RadioGroup in scaled container (fluent.blue.light).png deleted file mode 100644 index c501a38e620b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/radioGroup/etalons/RadioGroup in scaled container (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/radioGroup/validationMessage.ts b/e2e/testcafe-devextreme/tests/editors/radioGroup/validationMessage.ts deleted file mode 100644 index faff85f69d9c..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/radioGroup/validationMessage.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import Form from 'devextreme-testcafe-models/form/form'; -import RadioGroup from 'devextreme-testcafe-models/radioGroup'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -const RADIO_GROUP_CLASS = 'dx-radiogroup'; - -fixture.disablePageReloads`Radio Group Validation Message` - .page(url(__dirname, '../../container.html')); - -test('message position is right (T1020449)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - const form = new Form('#container'); - - await form.validate(); - - const radioGroup = new RadioGroup(`.${RADIO_GROUP_CLASS}`); - - await radioGroup.focus(); - - await testScreenshot(t, takeScreenshot, 'RadioGroup horizontal validation.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxForm', { - width: 300, - height: 400, - items: [{ - itemType: 'simple', - dataField: 'PropertyNameId', - editorOptions: { - dataSource: ['HR Manager', 'IT Manager'], - layout: 'horizontal', - }, - editorType: 'dxRadioGroup', - validationRules: [{ - type: 'required', - message: 'The PropertyNameId field is required.', - }], - }, { - itemType: 'button', - horizontalAlignment: 'left', - buttonOptions: { - text: 'Register', - type: 'success', - useSubmitBehavior: true, - }, - }], -})); diff --git a/e2e/testcafe-devextreme/tests/editors/slider/etalons/slider-appearance (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/slider/etalons/slider-appearance (fluent.blue.light).png deleted file mode 100644 index a06e4d3c9dec..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/slider/etalons/slider-appearance (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/slider/slider.ts b/e2e/testcafe-devextreme/tests/editors/slider/slider.ts deleted file mode 100644 index a086131e8411..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/slider/slider.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { testScreenshot } from '../../../helpers/themeUtils'; - -fixture.disablePageReloads`Slider` - .page(url(__dirname, '../../container.html')); - -test('Slider appearance', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'slider-appearance.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxSlider', { - tooltip: { - enabled: true, - showMode: 'always', - position: 'bottom', - }, -})); diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, height=5em & maxHeight=7em (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, height=5em & maxHeight=7em (fluent.blue.light).png deleted file mode 100644 index 06794b179d6b..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, height=5em & maxHeight=7em (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, height=7em & maxHeight=5em (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, height=7em & maxHeight=5em (fluent.blue.light).png deleted file mode 100644 index 7d4d3d215cbd..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, height=7em & maxHeight=5em (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight is not defined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight is not defined (fluent.blue.light).png deleted file mode 100644 index 325c769aef7a..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight is not defined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em (fluent.blue.light).png deleted file mode 100644 index 45de70dae974..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em, font-size=12px (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em, font-size=12px (fluent.blue.light).png deleted file mode 100644 index 45de70dae974..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight=5em, font-size=12px (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight=80px (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight=80px (fluent.blue.light).png deleted file mode 100644 index f286bc3ae4c5..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea appearance, maxHeight=80px (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea label after scroll (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea label after scroll (fluent.blue.light).png deleted file mode 100644 index 2c9727d6a840..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea label after scroll (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png deleted file mode 100644 index 4c89a3531206..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=filled (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png deleted file mode 100644 index a875dcfc7982..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=outlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png deleted file mode 100644 index f05a9bf6fa6e..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=floating-stylingMode=underlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png deleted file mode 100644 index a0f41dc538df..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=filled (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png deleted file mode 100644 index 5a88f42c7976..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=outlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png deleted file mode 100644 index 2f7970c39390..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=outside-stylingMode=underlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=filled (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=filled (fluent.blue.light).png deleted file mode 100644 index d3bff20ad6a3..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=filled (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png deleted file mode 100644 index f76b08635d2f..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=outlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png deleted file mode 100644 index 439aefd5c7b4..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textArea/etalons/TextArea with label-labelMode=static-stylingMode=underlined (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/index.ts b/e2e/testcafe-devextreme/tests/editors/textArea/index.ts deleted file mode 100644 index 02c5cb350ca8..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/textArea/index.ts +++ /dev/null @@ -1,200 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { - appendElementTo, setAttribute, -} from '../../../helpers/domUtils'; - -fixture.disablePageReloads`TextArea_Height` - .page(url(__dirname, '../../container.html')); - -const text = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.'; - -test('TextArea should have correct height when height is 7em & maxHeight is 5em', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'TextArea appearance, height=7em & maxHeight=5em.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await setAttribute('#container', 'style', 'width: 300px; height: 400px;'); - - const config = { - maxHeight: '5em', - height: '7em', - width: '100%', - value: text, - }; - - await appendElementTo('#container', 'div', 'textArea1'); - await appendElementTo('#container', 'div', 'textArea2'); - - await createWidget('dxTextArea', { - ...config, - autoResizeEnabled: true, - }, '#textArea1'); - - await createWidget('dxTextArea', { - ...config, - autoResizeEnabled: false, - }, '#textArea2'); -}); - -test('TextArea should have correct height when height is 5em & maxHeight is 7em', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'TextArea appearance, height=5em & maxHeight=7em.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await setAttribute('#container', 'style', 'width: 300px; height: 400px;'); - - const config = { - maxHeight: '7em', - height: '5em', - width: '100%', - value: text, - }; - - await appendElementTo('#container', 'div', 'textArea1'); - await appendElementTo('#container', 'div', 'textArea2'); - - await createWidget('dxTextArea', { - ...config, - autoResizeEnabled: true, - }, '#textArea1'); - - await createWidget('dxTextArea', { - ...config, - autoResizeEnabled: false, - }, '#textArea2'); -}); - -test('TextArea should have correct height when maxHeight is 5em', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'TextArea appearance, maxHeight=5em.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await setAttribute('#container', 'style', 'width: 300px; height: 400px;'); - - const config = { - maxHeight: '5em', - width: '100%', - value: text, - }; - - await appendElementTo('#container', 'div', 'textArea1'); - await appendElementTo('#container', 'div', 'textArea2'); - - await createWidget('dxTextArea', { - ...config, - autoResizeEnabled: true, - }, '#textArea1'); - - await createWidget('dxTextArea', { - ...config, - autoResizeEnabled: false, - }, '#textArea2'); -}); - -test('TextArea with font-size style has correct height when maxHeight option is 5em', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'TextArea appearance, maxHeight=5em, font-size=12px.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await setAttribute('#container', 'style', 'width: 300px; height: 400px; font-size: 12px;'); - - const config = { - maxHeight: '5em', - width: '100%', - value: text, - }; - - await appendElementTo('#container', 'div', 'textArea1'); - await appendElementTo('#container', 'div', 'textArea2'); - - await createWidget('dxTextArea', { - ...config, - autoResizeEnabled: true, - }, '#textArea1'); - - await createWidget('dxTextArea', { - ...config, - autoResizeEnabled: false, - }, '#textArea2'); -}); - -test('TextArea has correct height when maxHeight is not defined', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'TextArea appearance, maxHeight is not defined.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await setAttribute('#container', 'style', 'width: 300px;'); - - const config = { - width: '100%', - value: text, - autoResizeEnabled: true, - }; - - await appendElementTo('#container', 'div', 'textArea1'); - await appendElementTo('#container', 'div', 'textArea2'); - - await createWidget('dxTextArea', { - ...config, - }, '#textArea1'); - - await createWidget('dxTextArea', { - ...config, - value: text + text, - }, '#textArea2'); -}); - -test('Height of TextArea input should have the correct height when the maxHeight option is set to 80px (T1221869)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await testScreenshot(t, takeScreenshot, 'TextArea appearance, maxHeight=80px.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await setAttribute('#container', 'style', 'width: 300px; height: 400px;'); - - const config = { - value: text, - width: '100%', - maxHeight: 80, - autoResizeEnabled: true, - }; - - await appendElementTo('#container', 'div', 'textArea1'); - await appendElementTo('#container', 'div', 'textArea2'); - - await createWidget('dxTextArea', { - ...config, - autoResizeEnabled: true, - }, '#textArea1'); - - await createWidget('dxTextArea', { - ...config, - autoResizeEnabled: false, - }, '#textArea2'); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/textArea/label.ts b/e2e/testcafe-devextreme/tests/editors/textArea/label.ts deleted file mode 100644 index 7306e22d941f..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/textArea/label.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import TextArea from 'devextreme-testcafe-models/textArea'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { appendElementTo } from '../../../helpers/domUtils'; - -fixture.disablePageReloads`Label` - .page(url(__dirname, '../../container.html')); - -const labelModes = ['floating', 'static', 'outside']; -const stylingModes = ['outlined', 'underlined', 'filled']; - -test('Label scroll input dxTextArea', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - const textArea = new TextArea('#container'); - - await t.scroll(textArea.getInput(), 0, 20); - - await testScreenshot(t, takeScreenshot, 'TextArea label after scroll.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => createWidget('dxTextArea', { - height: 50, - width: 200, - text: `this content is ${'very '.repeat(10)}long`, - label: 'label text', -})); - -stylingModes.forEach((stylingMode) => { - labelModes.forEach((labelMode) => { - test.meta({ browserSize: [300, 400] })(`Label for dxTextArea labelMode=${labelMode} stylingMode=${stylingMode}`, async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await t.click('#textArea2'); - - await testScreenshot(t, takeScreenshot, `TextArea with label-labelMode=${labelMode}-stylingMode=${stylingMode}.png`); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); - }).before(async () => { - await appendElementTo('#container', 'div', 'textArea1', { }); - await appendElementTo('#container', 'div', 'textArea2', { }); - - await createWidget('dxTextArea', { - width: 100, - label: 'label', - text: '', - labelMode, - stylingMode, - }, '#textArea1'); - - return createWidget('dxTextArea', { - label: `this label is ${'very '.repeat(10)}long`, - text: `this content is ${'very '.repeat(10)}long`, - items: ['item1', 'item2'], - labelMode, - stylingMode, - }, '#textArea2'); - }); - }); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox render (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox render (fluent.blue.light).png deleted file mode 100644 index fa60ec32d8ab..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox render (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox render with limited width (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox render with limited width (fluent.blue.light).png deleted file mode 100644 index 140600a8e7e7..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox render with limited width (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox states (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox states (fluent.blue.light).png deleted file mode 100644 index 7661058adc60..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox states (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox validation message (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox validation message (fluent.blue.light).png deleted file mode 100644 index 230469e2cf13..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox validation message (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox with buttons container (fluent.blue.light).png b/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox with buttons container (fluent.blue.light).png deleted file mode 100644 index 12b997285eff..000000000000 Binary files a/e2e/testcafe-devextreme/tests/editors/textBox/etalons/Textbox with buttons container (fluent.blue.light).png and /dev/null differ diff --git a/e2e/testcafe-devextreme/tests/editors/textBox/label.ts b/e2e/testcafe-devextreme/tests/editors/textBox/label.ts deleted file mode 100644 index d7d5a18d95a4..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/textBox/label.ts +++ /dev/null @@ -1,221 +0,0 @@ -import type { Properties } from 'devextreme/ui/text_box.d'; -import type { LabelMode, EditorStyle, TextEditorButton } from 'devextreme/common'; -import { Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import TextBox from 'devextreme-testcafe-models/textBox'; -import Guid from 'devextreme/core/guid'; -import { - removeStylesheetRulesFromPage, insertStylesheetRulesToPage, setStyleAttribute, - appendElementTo, setClassAttribute, -} from '../../../helpers/domUtils'; -import { isMaterial, testScreenshot, getThemeName } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; - -fixture.disablePageReloads`TextBox_Label` - .page(url(__dirname, '../../container.html')); - -const visibleLabelModes: LabelMode[] = ['floating', 'static', 'outside']; -const stylingModes: EditorStyle[] = ['outlined', 'underlined', 'filled']; -const buttonsList: (string | TextEditorButton)[][] = [ - ['clear'], - ['clear', { name: 'custom', location: 'after', options: { icon: 'home' } }], - [{ name: 'custom', location: 'after', options: { icon: 'home' } }, 'clear'], - ['clear', { name: 'custom', location: 'before', options: { icon: 'home' } }], -]; - -const TEXTBOX_CLASS = 'dx-textbox'; -const HOVER_STATE_CLASS = 'dx-state-hover'; -const FOCUSED_STATE_CLASS = 'dx-state-focused'; -const READONLY_STATE_CLASS = 'dx-state-readonly'; -const INVALID_STATE_CLASS = 'dx-invalid'; - -const createTextBox = async (options?: Properties, state?: string): Promise => { - const id = `${`dx${new Guid()}`}`; - - await appendElementTo('#container', 'div', id, {}); - await createWidget('dxTextBox', { - labelMode: 'floating', - stylingMode: 'outlined', - text: 'Text', - label: 'Label Text', - ...options, - }, `#${id}`); - - if (state) { - await setClassAttribute(Selector(`#${id}`), state); - } - - return id; -}; - -[ - { labelMode: 'static', expectedWidths: { generic: 82, material: 68, fluent: 74 } }, - { labelMode: 'floating', expectedWidths: { generic: 82, material: 68, fluent: 74 } }, - { labelMode: 'outside', expectedWidths: { generic: 'none', material: 'none', fluent: 'none' } }, -].forEach(({ labelMode, expectedWidths }) => { - test(`Label max-width should be changed after container width was changed, labelMode is ${labelMode}`, async (t) => { - const textBox = new TextBox('#container'); - - const expectedWidth = expectedWidths[getThemeName()]; - - await t - .expect(textBox.getLabel().getStyleProperty('max-width')) - .eql(expectedWidth === 'none' ? 'none' : `${expectedWidth}px`); - - await setStyleAttribute(Selector(`#${await textBox.element.getAttribute('id')}`), `width: ${t.ctx.initialWidth + t.ctx.deltaWidth}px;`); - - await t - .expect(textBox.getLabel().getStyleProperty('max-width')) - .eql(expectedWidth === 'none' ? 'none' : `${expectedWidth + t.ctx.deltaWidth}px`); - }).before(async (t) => { - t.ctx.initialWidth = 100; - t.ctx.deltaWidth = 300; - - return createWidget('dxTextBox', { - width: t.ctx.initialWidth, - label: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', - labelMode, - }); - }); -}); - -test('Textbox render', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await insertStylesheetRulesToPage(`.${TEXTBOX_CLASS} { display: inline-block; vertical-align: middle; width: 60px; margin: 5px; }`); - - await testScreenshot(t, takeScreenshot, 'Textbox render with limited width.png', { element: '#container' }); - - await removeStylesheetRulesFromPage(); - - await insertStylesheetRulesToPage(`.${TEXTBOX_CLASS} { display: inline-block; vertical-align: middle; width: 260px; margin: 5px; }`); - - await testScreenshot(t, takeScreenshot, 'Textbox render.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - // eslint-disable-next-line no-restricted-syntax - for (const stylingMode of stylingModes) { - // eslint-disable-next-line no-restricted-syntax - for (const labelMode of visibleLabelModes) { - // eslint-disable-next-line no-restricted-syntax - for (const placeholder of ['Placeholder', '']) { - await createTextBox({ - text: undefined, - placeholder, - stylingMode, - labelMode, - }); - } - - await createTextBox({ text: 'Text value' }); - await createTextBox({ rtlEnabled: true }); - } - // eslint-disable-next-line no-restricted-syntax - for (const placeholder of ['Placeholder', '']) { - await createTextBox({ - text: undefined, - placeholder, - stylingMode, - label: undefined, - }); - } - await createTextBox({ label: undefined, text: 'Text value' }); - await createTextBox({ label: undefined, rtlEnabled: true }); - } -}); - -test('Textbox states', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await insertStylesheetRulesToPage(`.${TEXTBOX_CLASS} { display: inline-block; vertical-align: middle; width: 260px; margin: 5px; }`); - - await testScreenshot(t, takeScreenshot, 'Textbox states.png', { element: '#container' }); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - const states = [ - HOVER_STATE_CLASS, - FOCUSED_STATE_CLASS, - READONLY_STATE_CLASS, - INVALID_STATE_CLASS, - `${INVALID_STATE_CLASS} ${FOCUSED_STATE_CLASS}`, - ]; - // eslint-disable-next-line no-restricted-syntax - for (const state of states) { - // eslint-disable-next-line no-restricted-syntax - for (const placeholder of ['Placeholder', '']) { - await createTextBox({ - text: undefined, - placeholder, - }, state); - } - - await createTextBox({ text: 'Text value' }, state); - await createTextBox({ rtlEnabled: true }, state); - } -}); - -test('Textbox with buttons container', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await insertStylesheetRulesToPage('#container { display: flex; flex-wrap: wrap; gap: 4px; }'); - - await testScreenshot(t, takeScreenshot, 'Textbox with buttons container.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - if (isMaterial()) { - await insertStylesheetRulesToPage('#container .dx-widget { font-family: sans-serif }'); - } - - // eslint-disable-next-line no-restricted-syntax - for (const stylingMode of stylingModes) { - // eslint-disable-next-line no-restricted-syntax - for (const buttons of buttonsList) { - await createTextBox({ stylingMode, buttons, showClearButton: true }); - await createTextBox({ - stylingMode, buttons, showClearButton: true, isValid: false, - }); - } - } -}); - -stylingModes.forEach((stylingMode) => { - test(`TextBox should not be hovered after hover of outside label, stylingMode=${stylingMode}`, async (t) => { - const textBox = new TextBox('#container'); - - await t - .hover(textBox.getLabelSpan()) - .expect(textBox.isHovered) - .notOk(); - }).before(async () => createWidget('dxTextBox', { - value: 'text', - label: 'Label text', - labelMode: 'outside', - stylingMode, - width: 500, - })); - - test(`TextBox should be focused after click on outside label, stylingMode=${stylingMode}`, async (t) => { - const textBox = new TextBox('#container'); - - await t - .click(textBox.getLabelSpan()) - .expect(textBox.isFocused) - .ok(); - }).before(async () => createWidget('dxTextBox', { - value: 'text', - label: 'Label text', - labelMode: 'outside', - stylingMode, - width: 500, - })); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/textBox/mask.ts b/e2e/testcafe-devextreme/tests/editors/textBox/mask.ts deleted file mode 100644 index 39754ec9c6ec..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/textBox/mask.ts +++ /dev/null @@ -1,22 +0,0 @@ -import TextBox from 'devextreme-testcafe-models/textBox'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { appendElementTo } from '../../../helpers/domUtils'; - -fixture.disablePageReloads`TextBox_mask` - .page(url(__dirname, '../../container.html')); - -test('"!" character should not be accepted if mask restricts it (T1156419)', async (t) => { - const textBox = new TextBox('#textBox'); - const { input } = textBox; - - await t - .typeText(input, '!', { caretPos: 0 }) - .expect(input.value).eql('_'); -}).before(async () => { - await appendElementTo('#container', 'div', 'textBox', { }); - - return createWidget('dxTextBox', { - mask: '9', - }, '#textBox'); -}); diff --git a/e2e/testcafe-devextreme/tests/editors/textBox/validationMessage.ts b/e2e/testcafe-devextreme/tests/editors/textBox/validationMessage.ts deleted file mode 100644 index 5941b5176b1d..000000000000 --- a/e2e/testcafe-devextreme/tests/editors/textBox/validationMessage.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Selector } from 'testcafe'; -import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; -import { testScreenshot } from '../../../helpers/themeUtils'; -import url from '../../../helpers/getPageUrl'; -import { createWidget } from '../../../helpers/createWidget'; -import { - appendElementTo, setAttribute, removeAttribute, addFocusableElementBefore, -} from '../../../helpers/domUtils'; - -const TEXTEDITOR_INPUT_CLASS = 'dx-texteditor-input'; - -fixture.disablePageReloads`ValidationMessage` - .page(url(__dirname, '../../container.html')); - -test.meta({ browserSize: [300, 200] })('Validation Message position should be correct after change visibility of parent container (T1095900)', async (t) => { - const { takeScreenshot, compareResults } = createScreenshotsComparer(t); - - await addFocusableElementBefore('#container'); - - await t - .click(Selector(`.${TEXTEDITOR_INPUT_CLASS}`)) - .pressKey('backspace') - .pressKey('enter') - .click(Selector('#focusable-start')); - - await setAttribute('#container', 'hidden', 'true'); - await removeAttribute('#container', 'hidden'); - - await testScreenshot(t, takeScreenshot, 'Textbox validation message.png'); - - await t - .expect(compareResults.isValid()) - .ok(compareResults.errorMessages()); -}).before(async () => { - await appendElementTo('#container', 'div', 'textbox', {}); - - await createWidget('dxTextBox', { - value: 'a', - validationMessageMode: 'always', - }, '#textbox'); - - return createWidget('dxValidator', { - validationRules: [ - { - type: 'required', - }, - ], - }, '#textbox'); -}); diff --git a/packages/testcafe-models/autocomplete.ts b/packages/testcafe-models/autocomplete.ts deleted file mode 100644 index 605f3010378b..000000000000 --- a/packages/testcafe-models/autocomplete.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WidgetName } from './types'; -import DropDownList from './internal/dropDownList'; - -export default class Autocomplete extends DropDownList { - // eslint-disable-next-line class-methods-use-this - getName(): WidgetName { return 'dxAutocomplete'; } -} diff --git a/packages/testcafe-models/colorbox.ts b/packages/testcafe-models/colorbox.ts deleted file mode 100644 index ba5d9d240e44..000000000000 --- a/packages/testcafe-models/colorbox.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { WidgetName } from './types'; -import Widget from './internal/widget'; -import Popup from './popup'; - -const CLASS = { - input: 'dx-texteditor-input', - popup: 'dx-popup', -}; - -export default class ColorBox extends Widget { - input: Selector; - - constructor(id: string | Selector) { - super(id); - - this.input = this.element.find(`.${CLASS.input}`); - } - - getPopup(): Popup { - return new Popup(this.element.find(`.${CLASS.popup}`)); - } - - // eslint-disable-next-line class-methods-use-this - getName(): WidgetName { return 'dxColorBox'; } -} diff --git a/packages/testcafe-models/radioGroup/button.ts b/packages/testcafe-models/radioGroup/button.ts deleted file mode 100644 index ddc5189edc61..000000000000 --- a/packages/testcafe-models/radioGroup/button.ts +++ /dev/null @@ -1,19 +0,0 @@ -const CLASS = { - focused: 'dx-state-focused', - icon: 'dx-radiobutton-icon', - radioButtonChecked: 'dx-radiobutton-checked', -}; - -export default class RadioButton { - element: Selector; - - isChecked: Promise; - - isFocused: Promise; - - constructor(item: Selector) { - this.element = item.find(`.${CLASS.icon}`); - this.isChecked = item.hasClass(CLASS.radioButtonChecked); - this.isFocused = item.hasClass(CLASS.focused); - } -} diff --git a/packages/testcafe-models/radioGroup/index.ts b/packages/testcafe-models/radioGroup/index.ts deleted file mode 100644 index 02a4e5dec6c6..000000000000 --- a/packages/testcafe-models/radioGroup/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { WidgetName } from '../types'; -import Widget from '../internal/widget'; -import RadioGroupItem from './item'; - -const CLASS = { - collection: 'dx-collection', - item: 'dx-item', -}; - -export default class RadioGroup extends Widget { - items: Selector; - - constructor(id: string | Selector) { - super(id); - - this.items = this.element.child(`.${CLASS.collection}`).child(`.${CLASS.item}`); - } - - // eslint-disable-next-line class-methods-use-this - getName(): WidgetName { return 'dxRadioGroup'; } - - getItem(index = 0): RadioGroupItem { - return new RadioGroupItem(this.items.nth(index)); - } -} diff --git a/packages/testcafe-models/radioGroup/item.ts b/packages/testcafe-models/radioGroup/item.ts deleted file mode 100644 index e8533ae65521..000000000000 --- a/packages/testcafe-models/radioGroup/item.ts +++ /dev/null @@ -1,22 +0,0 @@ -import RadioButton from './button'; - -const CLASS = { - itemContent: 'dx-item-content', -}; - -export default class RadioGroupItem { - content: Selector; - - element: Selector; - - radioButton: RadioButton; - - text: Promise; - - constructor(element: Selector) { - this.content = element.find(`.${CLASS.itemContent}`); - this.element = element; - this.radioButton = new RadioButton(element); - this.text = element.textContent; - } -}