Skip to content

Commit

Permalink
rewrite using Selector
Browse files Browse the repository at this point in the history
  • Loading branch information
ksercs committed Dec 9, 2024
1 parent 9c52943 commit 3bde3a3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions apps/demos/testing/widgets/chat/Overview.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import { Selector } from 'testcafe';
import { runManualTest } from '../../../utils/visual-tests/matrix-test-helper';
import { testScreenshot } from '../../../utils/visual-tests/helpers/theme-utils';

const CHAT_INPUT_SELECTOR = '.dx-chat .dx-texteditor-input';

fixture('Chat.Overview')
.page('http://localhost:8080/')
.before(async (ctx) => {
Expand All @@ -18,12 +21,13 @@ runManualTest('Chat', 'Overview', ['jQuery', 'React', 'Vue', 'Angular'], (test)

const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

await t.typeText('#user-chat .dx-texteditor-input', 'testing');

const leftChat = Selector(CHAT_INPUT_SELECTOR).nth(0);
const rightChat = Selector(CHAT_INPUT_SELECTOR).nth(1);

await t.typeText(leftChat, 'left');
await testScreenshot(t, takeScreenshot, 'chat_typing_indicator_appears_in_user_chat.png');

await t.typeText('#support-chat .dx-texteditor-input', 'testing');

await t.typeText(rightChat, 'right');
await testScreenshot(t, takeScreenshot, 'chat_typing_indicator_appears_in_support_chat.png');

await t
Expand Down

0 comments on commit 3bde3a3

Please sign in to comment.