Skip to content

Commit

Permalink
test(chat-testcafe): Remove disablePageReload
Browse files Browse the repository at this point in the history
  • Loading branch information
marker dao ® committed Dec 13, 2024
1 parent 096b289 commit df04e32
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 43 deletions.
3 changes: 1 addition & 2 deletions e2e/testcafe-devextreme/tests/chat/alertList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import url from '../../helpers/getPageUrl';
import { createWidget } from '../../helpers/createWidget';
import { getFullThemeName, testScreenshot } from '../../helpers/themeUtils';

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

test.clientScripts([
Expand All @@ -16,7 +16,6 @@ test.clientScripts([
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#container');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Alertlist with one error.png', { element: '#container' });

Expand Down
6 changes: 1 addition & 5 deletions e2e/testcafe-devextreme/tests/chat/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import { createWidget } from '../../helpers/createWidget';
import { testScreenshot } from '../../helpers/themeUtils';
import { appendElementTo } from '../../helpers/domUtils';

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

test('Chat: avatar', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#chat');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Avatar with two word initials.png', { element: '#chat' });

Expand Down Expand Up @@ -48,9 +47,6 @@ test('Chat: avatar', async (t) => {
test('Chat: showAvatar set to false', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#chat');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Avatar with showAvatar set to false.png', { element: '#chat' });

await t
Expand Down
3 changes: 1 addition & 2 deletions e2e/testcafe-devextreme/tests/chat/messageBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import { createWidget } from '../../helpers/createWidget';
import { testScreenshot } from '../../helpers/themeUtils';
import { appendElementTo } from '../../helpers/domUtils';

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

test('Chat: messagebox', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#chat');
await chat.repaint();

const shortText = getShortText();
const longText = getLongText(false, 5);
Expand Down
3 changes: 1 addition & 2 deletions e2e/testcafe-devextreme/tests/chat/messageBubble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import { createWidget } from '../../helpers/createWidget';
import { testScreenshot } from '../../helpers/themeUtils';
import { appendElementTo } from '../../helpers/domUtils';

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

test('Chat: messagebubble', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#chat');
await chat.repaint();

const userFirst = createUser(1, 'First');
const userSecond = createUser(2, 'Second');
Expand Down
15 changes: 1 addition & 14 deletions e2e/testcafe-devextreme/tests/chat/messageGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ import asyncForEach from '../../helpers/asyncForEach';

const AVATAR_SELECTOR = '.dx-avatar';

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

test('Chat: messagegroup, avatar rendering', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#chat');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Avatar has correct position.png', { element: '#chat' });

await setStyleAttribute(Selector(AVATAR_SELECTOR), 'width: 64px; height: 64px');
Expand All @@ -47,9 +44,6 @@ test('Chat: messagegroup, avatar rendering', async (t) => {
test('Chat: messagegroup, information', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#chat');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Information row with long user name.png', { element: '#chat' });

await t
Expand All @@ -75,7 +69,6 @@ test('Chat: messagegroup, bubbles', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#chat');
await chat.repaint();

const userFirst = createUser(1, 'First');
const userSecond = createUser(2, 'Second');
Expand Down Expand Up @@ -133,9 +126,6 @@ test('Messagegroup scenarios in disabled state', async (t) => {
width: 250,
height: 400,
}, chatId);

const chat = new Chat(chatId);
await chat.repaint(); // NOTE: WA to make it stable in Material theme.
});

await testScreenshot(t, takeScreenshot, 'Messagegroup appearance in disabled state.png', { element: '#container' });
Expand Down Expand Up @@ -166,9 +156,6 @@ test('Messagegroup scenarios in RTL mode', async (t) => {
width: 250,
height: 400,
}, chatId);

const chat = new Chat(chatId);
await chat.repaint(); // NOTE: WA to make it stable in Material theme.
});

await testScreenshot(t, takeScreenshot, 'Messagegroup appearance in RTL mode.png', { element: '#container' });
Expand Down
12 changes: 1 addition & 11 deletions e2e/testcafe-devextreme/tests/chat/messageList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import { createWidget } from '../../helpers/createWidget';
import { testScreenshot } from '../../helpers/themeUtils';
import { insertStylesheetRulesToPage } from '../../helpers/domUtils';

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

test('Messagelist empty view scenarios', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#container');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Messagelist empty state.png', { element: '#container' });

Expand Down Expand Up @@ -51,7 +50,6 @@ test('Messagelist appearance with scrollbar', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#container');
await chat.repaint();

await t
.hover(chat.messageList)
Expand Down Expand Up @@ -156,9 +154,7 @@ test('Messagelist should scrolled to the latest messages after being rendered in

test('Messagelist with loadindicator appearance on initial loading', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const chat = new Chat('#container');

await chat.repaint();
await testScreenshot(t, takeScreenshot, 'Messagelist loadindicator position on initial loading.png', { element: '#container' });

await t
Expand Down Expand Up @@ -189,7 +185,6 @@ test('Messagelist with messageTemplate', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#container');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Messagelist with message template.png', { element: '#container' });

Expand Down Expand Up @@ -234,9 +229,6 @@ test('Messagelist with messageTemplate', async (t) => {

test('Messagelist options showDayHeaders, showUserName and showMessageTimestamp set to false work', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const chat = new Chat('#container');

await chat.repaint();

await testScreenshot(
t,
Expand Down Expand Up @@ -281,9 +273,7 @@ test.clientScripts([
{ content: 'window.MockDate = MockDate;' },
])('Messagelist with date headers', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const chat = new Chat('#container');

await chat.repaint();
await testScreenshot(t, takeScreenshot, 'Messagelist with date headers.png', { element: '#container' });

await t
Expand Down
8 changes: 1 addition & 7 deletions e2e/testcafe-devextreme/tests/chat/typingIndicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import { appendElementTo, insertStylesheetRulesToPage } from '../../helpers/domU

const CHAT_TYPINGINDICATOR_CIRCLE_CLASS = 'dx-chat-typingindicator-circle';

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

test('Chat: typing indicator with emptyview', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#container');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Typing indicator with emptyview.png', {
element: '#container',
Expand Down Expand Up @@ -54,9 +52,6 @@ test('Chat: typing indicator with emptyview', async (t) => {
test('Chat: typing indicator with a lot of items', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#chat');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Typing indicator with a lot of items.png', { element: '#chat' });

await t
Expand Down Expand Up @@ -86,7 +81,6 @@ test('Chat: typing indicator', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

const chat = new Chat('#chat');
await chat.repaint();

await testScreenshot(t, takeScreenshot, 'Typing indicator with 1 user.png', { element: '#chat' });

Expand Down

0 comments on commit df04e32

Please sign in to comment.