Skip to content

Commit 108f7f5

Browse files
authored
test: Reorg modal page objects (RocketChat#37871)
1 parent a8a84ab commit 108f7f5

46 files changed

Lines changed: 332 additions & 288 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/meteor/client/views/omnichannel/modals/ForwardChatModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ const ForwardChatModal = ({ onForward, onCancel, room, ...props }: ForwardChatMo
8181

8282
return (
8383
<Modal
84+
aria-label={t('Forward_chat')}
8485
wrapperFunction={(props) => <Box is='form' onSubmit={handleSubmit(onSubmit)} {...props} />}
8586
{...props}
86-
data-qa-id='forward-chat-modal'
8787
>
8888
<ModalHeader>
8989
<ModalIcon name='baloon-arrow-top-right' />

apps/meteor/tests/e2e/apps/apps-modal.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Page } from '@playwright/test';
33
import { IS_EE } from '../config/constants';
44
import { Users } from '../fixtures/userStates';
55
import { HomeChannel } from '../page-objects';
6-
import { AppsModal } from '../page-objects/fragments/apps-modal';
6+
import { AppsModal } from '../page-objects/fragments/modals';
77
import { expect, test } from '../utils/test';
88

99
test.use({ storageState: Users.user1.state });

apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { BASE_URL } from '../config/constants';
55
import { Users } from '../fixtures/userStates';
66
import { EncryptedRoomPage } from '../page-objects/encrypted-room';
77
import { Navbar } from '../page-objects/fragments';
8-
import { FileUploadModal } from '../page-objects/fragments/file-upload-modal';
8+
import { FileUploadModal } from '../page-objects/fragments/modals';
99
import { LoginPage } from '../page-objects/login';
1010
import { createTargetGroupAndReturnFullRoom, deleteChannel, deleteRoom } from '../utils';
1111
import { preserveSettings } from '../utils/preserveSettings';

apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ import { Users, storeState, restoreState } from '../fixtures/userStates';
55
import { AccountSecurity, HomeChannel } from '../page-objects';
66
import { setupE2EEPassword } from './setupE2EEPassword';
77
import { Navbar } from '../page-objects/fragments';
8-
import {
9-
E2EEKeyDecodeFailureBanner,
10-
EnterE2EEPasswordBanner,
11-
EnterE2EEPasswordModal,
12-
ResetE2EEPasswordModal,
13-
} from '../page-objects/fragments/e2ee';
8+
import { E2EEKeyDecodeFailureBanner, EnterE2EEPasswordBanner } from '../page-objects/fragments/e2ee';
9+
import { EnterE2EEPasswordModal, ResetE2EEPasswordModal } from '../page-objects/fragments/modals';
1410
import { LoginPage } from '../page-objects/login';
1511
import { preserveSettings } from '../utils/preserveSettings';
1612
import { test, expect } from '../utils/test';

apps/meteor/tests/e2e/e2e-encryption/setupE2EEPassword.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Page } from '@playwright/test';
22

3-
import { SaveE2EEPasswordBanner, SaveE2EEPasswordModal } from '../page-objects/fragments/e2ee';
3+
import { SaveE2EEPasswordBanner } from '../page-objects/fragments/e2ee';
4+
import { SaveE2EEPasswordModal } from '../page-objects/fragments/modals';
45

56
/**
67
* Click the banner to open the dialog to save the generated password

apps/meteor/tests/e2e/feature-preview.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { faker } from '@faker-js/faker';
22

33
import { Users } from './fixtures/userStates';
44
import { AdminInfo, HomeChannel } from './page-objects';
5-
import { CreateNewChannelModal } from './page-objects/create-new-modal';
5+
import { CreateNewChannelModal } from './page-objects/fragments/modals';
66
import {
77
createTargetChannel,
88
createTargetTeam,

apps/meteor/tests/e2e/federation/page-objects/channel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type { Locator, Page } from '@playwright/test';
33
import { FederationHomeContent } from './fragments/home-content';
44
import { FederationHomeFlextab } from './fragments/home-flextab';
55
import { FederationSidenav } from './fragments/home-sidenav';
6-
import { CreateNewChannelModal, CreateNewDMModal } from '../../page-objects/create-new-modal';
76
import { Navbar, RoomToolbar, ToastMessages } from '../../page-objects/fragments';
7+
import { CreateNewChannelModal, CreateNewDMModal } from '../../page-objects/fragments/modals';
88

99
export class FederationChannel {
1010
private readonly page: Page;

apps/meteor/tests/e2e/federation/tests/ce-version/ce.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { faker } from '@faker-js/faker';
22

3-
import { CreateNewChannelModal } from '../../../page-objects/create-new-modal';
3+
import { CreateNewChannelModal } from '../../../page-objects/fragments/modals';
44
import * as constants from '../../config/constants';
55
import { FederationChannel } from '../../page-objects/channel';
66
import { doLogin } from '../../utils/auth';

apps/meteor/tests/e2e/omnichannel/omnichannel-chat-transfers.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ test.describe('OC - Chat transfers [Monitor role]', () => {
141141
});
142142

143143
await test.step('expect agent and department fields to be visible and enabled', async () => {
144-
await expect(poOmnichannel.content.forwardChatModal.inputFowardUser).toBeEnabled();
145-
await expect(poOmnichannel.content.forwardChatModal.inputFowardDepartment).toBeEnabled();
144+
await expect(poOmnichannel.content.forwardChatModal.inputForwardUser).toBeEnabled();
145+
await expect(poOmnichannel.content.forwardChatModal.inputForwardDepartment).toBeEnabled();
146146
await expect(poOmnichannel.content.forwardChatModal.btnForward).toBeDisabled();
147147
});
148148

@@ -183,8 +183,8 @@ test.describe('OC - Chat transfers [Monitor role]', () => {
183183
});
184184

185185
await test.step('expect agent and department fields to be visible and enabled', async () => {
186-
await expect(poOmnichannel.content.forwardChatModal.inputFowardUser).toBeEnabled();
187-
await expect(poOmnichannel.content.forwardChatModal.inputFowardDepartment).toBeEnabled();
186+
await expect(poOmnichannel.content.forwardChatModal.inputForwardUser).toBeEnabled();
187+
await expect(poOmnichannel.content.forwardChatModal.inputForwardDepartment).toBeEnabled();
188188
await expect(poOmnichannel.content.forwardChatModal.btnForward).toBeDisabled();
189189
});
190190

@@ -227,8 +227,8 @@ test.describe('OC - Chat transfers [Monitor role]', () => {
227227
});
228228

229229
await test.step('expect agent and department fields to be visible and enabled', async () => {
230-
await expect(poOmnichannel.content.forwardChatModal.inputFowardUser).toBeEnabled();
231-
await expect(poOmnichannel.content.forwardChatModal.inputFowardDepartment).toBeEnabled();
230+
await expect(poOmnichannel.content.forwardChatModal.inputForwardUser).toBeEnabled();
231+
await expect(poOmnichannel.content.forwardChatModal.inputForwardDepartment).toBeEnabled();
232232
await expect(poOmnichannel.content.forwardChatModal.btnForward).toBeDisabled();
233233
});
234234

@@ -363,8 +363,8 @@ test.describe('OC - Chat transfers [Manager role]', () => {
363363
});
364364

365365
await test.step('expect agent and department fields to be visible and enabled', async () => {
366-
await expect(poOmnichannel.content.forwardChatModal.inputFowardUser).toBeEnabled();
367-
await expect(poOmnichannel.content.forwardChatModal.inputFowardDepartment).toBeEnabled();
366+
await expect(poOmnichannel.content.forwardChatModal.inputForwardUser).toBeEnabled();
367+
await expect(poOmnichannel.content.forwardChatModal.inputForwardDepartment).toBeEnabled();
368368
await expect(poOmnichannel.content.forwardChatModal.btnForward).toBeDisabled();
369369
});
370370

@@ -405,8 +405,8 @@ test.describe('OC - Chat transfers [Manager role]', () => {
405405
});
406406

407407
await test.step('expect agent and department fields to be visible and enabled', async () => {
408-
await expect(poOmnichannel.content.forwardChatModal.inputFowardUser).toBeEnabled();
409-
await expect(poOmnichannel.content.forwardChatModal.inputFowardDepartment).toBeEnabled();
408+
await expect(poOmnichannel.content.forwardChatModal.inputForwardUser).toBeEnabled();
409+
await expect(poOmnichannel.content.forwardChatModal.inputForwardDepartment).toBeEnabled();
410410
await expect(poOmnichannel.content.forwardChatModal.btnForward).toBeDisabled();
411411
});
412412

@@ -449,8 +449,8 @@ test.describe('OC - Chat transfers [Manager role]', () => {
449449
});
450450

451451
await test.step('expect agent and department fields to be visible and enabled', async () => {
452-
await expect(poOmnichannel.content.forwardChatModal.inputFowardUser).toBeEnabled();
453-
await expect(poOmnichannel.content.forwardChatModal.inputFowardDepartment).toBeEnabled();
452+
await expect(poOmnichannel.content.forwardChatModal.inputForwardUser).toBeEnabled();
453+
await expect(poOmnichannel.content.forwardChatModal.inputForwardDepartment).toBeEnabled();
454454
await expect(poOmnichannel.content.forwardChatModal.btnForward).toBeDisabled();
455455
});
456456

apps/meteor/tests/e2e/omnichannel/omnichannel-contact-conflict-review.spec.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,11 @@ test.describe.serial('OC - Contact Review', () => {
7575
await customField.delete();
7676
});
7777

78-
test('OC - Contact Review - Update custom field conflicting', async ({ page }) => {
78+
test('OC - Contact Review - Update custom field conflicting', async () => {
7979
await poHomeChannel.sidebar.getSidebarItemByName(visitor.name).click();
8080
await poHomeChannel.roomToolbar.openContactInfo();
81+
await poHomeChannel.contacts.contactInfo.solveConflict(customFieldName, 'custom-field-value-2');
8182

82-
await poHomeChannel.content.contactReviewModal.btnSeeConflicts.click();
83-
84-
await poHomeChannel.content.contactReviewModal.getFieldByName(customFieldName).click();
85-
await poHomeChannel.content.contactReviewModal.findOption('custom-field-value-2').click();
86-
const responseListener = page.waitForResponse('**/api/v1/omnichannel/contacts.conflicts');
87-
await poHomeChannel.content.contactReviewModal.btnSave.click();
88-
const response = await responseListener;
89-
await expect(response.status()).toBe(200);
90-
91-
await expect(poHomeChannel.content.contactReviewModal.btnSeeConflicts).not.toBeVisible();
83+
await expect(poHomeChannel.contacts.contactInfo.btnSeeConflicts).not.toBeVisible();
9284
});
9385
});

0 commit comments

Comments
 (0)