Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
914704e
HtmlEditor: Add screenshot tests for AI toolbar item and AIDialog
May 14, 2025
d33a682
feat(tests): Add takeScr
May 14, 2025
e8bb656
feat(tests): Add new screens && Fix getting element to click
May 14, 2025
de3923b
fix(tests): Fix height
May 14, 2025
860a9ad
refactor(tests): Use getToolbarItemByName
May 14, 2025
0ea6fd0
feat(screens): Update
May 14, 2025
bb0efa9
feat(tests): Add model && Add dirty tests
May 14, 2025
78cd338
refactor && feat(tests && etalons)
May 15, 2025
56aba88
feat(tests): Add new tests
May 15, 2025
2746141
feat(tests): Open split button
May 15, 2025
90eb0f8
fix && refactor(minors)
May 15, 2025
4a6fe57
fix(tests): Update height
May 15, 2025
dec631d
feat(tests): Add tests for askAI
May 15, 2025
315659d
fix(tests): Fix height
May 15, 2025
2a4cd3c
refactor && feat(tests)
May 15, 2025
f99e4ba
feat(tests): Add result ready after canceletion test
May 15, 2025
8f27fdb
fix(tests): Fix height
May 15, 2025
5ae6166
feat(tests): Add initial state on small screen
May 15, 2025
126f14c
feat(tests): Add another states tests
May 15, 2025
1b9ff2d
feat(tests): Add error state
May 15, 2025
1505288
revert(pg)
May 15, 2025
231873c
revert(staff)
May 15, 2025
4a1c974
feat(etalons): Add etalons
May 15, 2025
71f8487
fix(tests): Remove width
May 15, 2025
1c9bad5
feat(etalons): Ad new
May 16, 2025
08c59ba
try(tests): Try to repaint
May 16, 2025
2e33cdf
fix(tests && ai-dialog): Fix width && Clean tests
May 17, 2025
d10841f
feat(tests): Add the last
May 17, 2025
2ddc1c7
feat(tests-ally): Add accessibility tests
May 17, 2025
a9e0677
feat(ai-dialog): Add width separatly for Material && Use outlined sty…
May 17, 2025
32daf4f
refactor(minor)
May 17, 2025
a49ea3e
fix
May 17, 2025
29ea45d
feat(toolbar && menu): Hide before element in Submenu in Generic
May 18, 2025
0bd88f7
feat(etalons): Add new
May 18, 2025
2ac383f
feat(tests): Add test for setting class
May 18, 2025
6e736a3
feat(etalons): Update
May 18, 2025
f1b3065
Init rechecks
May 18, 2025
67fb27d
fix(tests): Move etalon
May 19, 2025
70c4b34
Revert "feat(toolbar && menu): Hide before element in Submenu in Gene…
May 20, 2025
b6fb266
Revert "feat(tests): Add test for setting class"
May 20, 2025
a387b8d
Update HTMLEditor toolbar etalon
May 20, 2025
21848b9
HTMLEditor: Fix AI toolbar item layout
May 20, 2025
75e166a
HTMLEditor: Update AI demo etalon
May 20, 2025
13f183c
HTMLEditor: Remove AI toolbar generic etalons to replace
May 20, 2025
e85141c
HTMLEditor: AI toolbar & dialog - replace etalons
May 20, 2025
802e65e
HTMLEditor: Remove util import from accessibility test
May 20, 2025
161ee4b
HTMLEditor: Update etalons
May 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified apps/demos/testing/etalons/HtmlEditor-AITextEditing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions e2e/testcafe-devextreme/tests/accessibility/common/htmlEditor.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { Properties } from 'devextreme/ui/html_editor.d';
import HtmlEditor from 'devextreme-testcafe-models/htmlEditor';
import { Selector } from 'testcafe';
import url from '../../../helpers/getPageUrl';
import { defaultSelector, testAccessibility, Configuration } from '../../../helpers/accessibility/test';
import { Options } from '../../../helpers/generateOptionMatrix';

const MENU_ITEM_CLASS = 'dx-menu-item';
const SUBMENU_CLASS = 'dx-submenu';

fixture.disablePageReloads`Accessibility`
.page(url(__dirname, '../../container.html'));

Expand Down Expand Up @@ -42,3 +46,38 @@ const configuration: Configuration = {
};

testAccessibility(configuration);

const aiOptions: Options<Properties> = {
value: [markup],
focusStateEnabled: [true],
toolbar: [{ items: ['ai'] }],
aiIntegration: [
({} as any),
{ changeStyle() {} },
{ changeStyle(_, { onComplete }) { onComplete?.('Result'); } },
{ changeStyle(_, { onError }) { onError?.('Error' as any); } },
],
};

const aiCreated = async (t: TestController): Promise<void> => {
const htmlEditor = new HtmlEditor('#container');

await t.click(Selector(defaultSelector));

await t
.click(htmlEditor.toolbar.getItemByName('ai'))
.click(Selector(`.${SUBMENU_CLASS} .${MENU_ITEM_CLASS}`).nth(4));

await t
.click(Selector(`.${SUBMENU_CLASS} .${MENU_ITEM_CLASS}`).nth(4)
.find(`.${SUBMENU_CLASS} .${MENU_ITEM_CLASS}`).nth(0));
};

const aiConfiguration: Configuration = {
component: 'dxHtmlEditor',
a11yCheckConfig,
options: aiOptions,
created: aiCreated,
};

testAccessibility(aiConfiguration);
30 changes: 30 additions & 0 deletions e2e/testcafe-devextreme/tests/htmlEditor/common.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import HtmlEditor from 'devextreme-testcafe-models/htmlEditor';
import { Selector } from 'testcafe';
import { createWidget } from '../../helpers/createWidget';
import url from '../../helpers/getPageUrl';
import { testScreenshot } from '../../helpers/themeUtils';
import { appendElementTo, setStyleAttribute } from '../../helpers/domUtils';

const MENU_ITEM_CLASS = 'dx-menu-item';
const SUBMENU_CLASS = 'dx-submenu';

fixture.disablePageReloads`HtmlEditor`
.page(url(__dirname, '../container.html'));

Expand Down Expand Up @@ -50,3 +54,29 @@ fixture.disablePageReloads`HtmlEditor`
}, '#editorWithToolbar');
});
});

test('AI toolbar item', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const htmlEditor = new HtmlEditor('#container');

await testScreenshot(t, takeScreenshot, 'htmleditor-ai-toolbar-item.png', { element: '#container' });

await t
.click(htmlEditor.toolbar.getItemByName('ai'))
.click(Selector(`.${SUBMENU_CLASS}`).find(`.${MENU_ITEM_CLASS}`).nth(5));

await testScreenshot(t, takeScreenshot, 'htmleditor-ai-toolbar-item-expanded.png', { element: '#container' });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => {
await createWidget('dxHtmlEditor', {
height: 500,
width: 350,
aiIntegration: {},
toolbar: {
items: ['ai'],
},
});
});
Loading
Loading