Skip to content

Commit 9156415

Browse files
committed
checking cause its passing locally
1 parent e3bcd54 commit 9156415

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

apps/meteor/tests/e2e/omnichannel/omnichannel-contact-center-chats-filters.spec.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Users } from '../fixtures/userStates';
44
import { OmnichannelChats } from '../page-objects/omnichannel-contact-center-chats';
55
import { setSettingValueById } from '../utils';
66
import { createAgent, makeAgentAvailable } from '../utils/omnichannel/agents';
7-
import { createConversation } from '../utils/omnichannel/rooms';
7+
import { createConversation, waitForInquiryToBeTaken } from '../utils/omnichannel/rooms';
88
import { test, expect } from '../utils/test';
99

1010
test.use({ storageState: Users.user1.state });
@@ -20,7 +20,15 @@ test.describe('OC - Contact Center - Chats', () => {
2020
const visitorB = `visitorB_${uuid}`;
2121

2222
test.beforeAll(async ({ api }) => {
23-
expect((await setSettingValueById(api, 'Livechat_Routing_Method', 'Auto_Selection')).status()).toBe(200);
23+
const responses = await Promise.all([
24+
setSettingValueById(api, 'Livechat_Routing_Method', 'Auto_Selection'),
25+
setSettingValueById(api, 'Livechat_waiting_queue', true),
26+
setSettingValueById(api, 'Omnichannel_queue_delay_timeout', 1),
27+
]);
28+
responses.forEach(async (res) => {
29+
console.log(res.status(), await res.json());
30+
expect(res.status()).toBe(200);
31+
});
2432
});
2533

2634
test.beforeAll(async ({ api }) => {
@@ -34,6 +42,11 @@ test.describe('OC - Contact Center - Chats', () => {
3442
createConversation(api, { agentId: `user1`, visitorName: visitorA }),
3543
createConversation(api, { agentId: `user1`, visitorName: visitorB }),
3644
]);
45+
46+
await waitForInquiryToBeTaken(
47+
api,
48+
conversations.map((c) => c.data.room._id),
49+
);
3750
});
3851

3952
test.beforeEach(async ({ page }) => {
@@ -47,8 +60,13 @@ test.describe('OC - Contact Center - Chats', () => {
4760
});
4861

4962
test.afterAll(async ({ api }) => {
50-
await Promise.all([...conversations.map((conversation) => conversation.delete()), agent.delete()]);
51-
expect((await setSettingValueById(api, 'Livechat_Routing_Method', 'Auto_Selection')).status()).toBe(200);
63+
await Promise.all([
64+
...conversations.map((conversation) => conversation.delete()),
65+
agent.delete(),
66+
setSettingValueById(api, 'Livechat_Routing_Method', 'Auto_Selection'),
67+
setSettingValueById(api, 'Livechat_waiting_queue', false),
68+
setSettingValueById(api, 'Omnichannel_queue_delay_timeout', 5),
69+
]);
5270
});
5371

5472
test(`OC - Contact Center - Chats - Filter from and to same date`, async ({ page }) => {

0 commit comments

Comments
 (0)