-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Remove & Test old closeChat templates (#26631)
Co-authored-by: Guilherme Gazzo <[email protected]> Co-authored-by: Guilherme Gazzo <[email protected]>
- Loading branch information
1 parent
12481d5
commit 3ae6fbb
Showing
8 changed files
with
70 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 0 additions & 72 deletions
72
apps/meteor/app/livechat/client/views/app/dialog/closeRoom.html
This file was deleted.
Oops, something went wrong.
192 changes: 0 additions & 192 deletions
192
apps/meteor/app/livechat/client/views/app/dialog/closeRoom.js
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
apps/meteor/app/livechat/client/views/app/livechatRoomTagSelector.html
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
apps/meteor/app/livechat/client/views/app/livechatRoomTagSelector.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { faker } from '@faker-js/faker'; | ||
import type { Browser, Page } from '@playwright/test'; | ||
|
||
import { test, expect } from './utils/test'; | ||
import { OmnichannelLiveChat, HomeChannel } from './page-objects'; | ||
|
||
const createAuxContext = async (browser: Browser, storageState: string): Promise<{ page: Page; poHomeChannel: HomeChannel }> => { | ||
const page = await browser.newPage({ storageState }); | ||
const poHomeChannel = new HomeChannel(page); | ||
await page.goto('/'); | ||
await page.locator('.main-content').waitFor(); | ||
|
||
return { page, poHomeChannel }; | ||
}; | ||
|
||
test.describe('Omnichannel close chat', () => { | ||
let poLiveChat: OmnichannelLiveChat; | ||
let newUser: { email: string; name: string }; | ||
|
||
let agent: { page: Page; poHomeChannel: HomeChannel }; | ||
|
||
test.beforeAll(async ({ api, browser }) => { | ||
newUser = { | ||
name: faker.name.firstName(), | ||
email: faker.internet.email(), | ||
}; | ||
|
||
// Set user user 1 as manager and agent | ||
await api.post('/livechat/users/agent', { username: 'user1' }); | ||
await api.post('/livechat/users/manager', { username: 'user1' }); | ||
agent = await createAuxContext(browser, 'user1-session.json'); | ||
}); | ||
test.beforeEach(async ({ page }) => { | ||
poLiveChat = new OmnichannelLiveChat(page); | ||
}); | ||
|
||
test.afterAll(async ({ api }) => { | ||
await api.delete('/livechat/users/agent/user1'); | ||
await api.delete('/livechat/users/manager/user1'); | ||
}); | ||
|
||
test('Receiving a message from visitor', async ({ page }) => { | ||
await test.step('Expect send a message as a visitor', async () => { | ||
await page.goto('/livechat'); | ||
await poLiveChat.btnOpenLiveChat('R').click(); | ||
await poLiveChat.sendMessage(newUser, false); | ||
await poLiveChat.onlineAgentMessage.type('this_a_test_message_from_visitor'); | ||
await poLiveChat.btnSendMessageToOnlineAgent.click(); | ||
}); | ||
|
||
await test.step('Expect to have 1 omnichannel assigned to agent 1', async () => { | ||
await agent.poHomeChannel.sidenav.openChat(newUser.name); | ||
}); | ||
|
||
await test.step('Expect to be able to close an omnichannel to conversation', async () => { | ||
await agent.poHomeChannel.content.btnCloseChat.click(); | ||
await agent.poHomeChannel.content.inputModalClosingComment.type('any_comment'); | ||
await agent.poHomeChannel.content.btnModalConfirm.click(); | ||
await expect(agent.poHomeChannel.toastSuccess).toBeVisible(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.