From 38fc66a87e6dcc660ecade667cc790236b6af920 Mon Sep 17 00:00:00 2001 From: Robert Bo Davis Date: Thu, 7 Sep 2023 14:13:47 -0400 Subject: [PATCH] chore: work on webchat e2e fixes --- e2e-tests/chatScripts.ts | 2 +- e2e-tests/tests/webchat.spec.ts | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/e2e-tests/chatScripts.ts b/e2e-tests/chatScripts.ts index 7b887aa106..3a6ea0389f 100644 --- a/e2e-tests/chatScripts.ts +++ b/e2e-tests/chatScripts.ts @@ -45,7 +45,7 @@ export const commonScripts: Record = { botStatement( 'You are number 1 in line. To keep your chat active, please do not leave/refresh this window or hit the back button.', ), - counselorAutoStatement("Hi, you've reached a counsellor. What would you like to talk about?"), + // counselorAutoStatement("Hi, you've reached a counsellor. What would you like to talk about?"), callerStatement('CALLER TEST CHAT MESSAGE'), counselorStatement('COUNSELLOR TEST CHAT MESSAGE'), ], diff --git a/e2e-tests/tests/webchat.spec.ts b/e2e-tests/tests/webchat.spec.ts index 0dafab3be2..ab16555919 100644 --- a/e2e-tests/tests/webchat.spec.ts +++ b/e2e-tests/tests/webchat.spec.ts @@ -65,6 +65,9 @@ test.describe.serial('Web chat caller', () => { const webchatProgress = chatPage.chat(chatScript); const flexChatProgress: AsyncIterator = flexChat(pluginPage).chat(chatScript); + await statusIndicator(pluginPage).setStatus('AVAILABLE'); + await tasks(pluginPage).acceptNextTask(); + // Currently this loop handles the handing back and forth of control between the caller & counselor sides of the chat. // Each time round the loop it allows the webchat to process statements until it yields control back to this loop // And each time flexChatProgress.next(), the flex chat processes statements until it yields @@ -72,16 +75,7 @@ test.describe.serial('Web chat caller', () => { for await (const expectedCounselorStatement of webchatProgress) { console.log('Statement for flex chat to process', expectedCounselorStatement); if (expectedCounselorStatement) { - switch (expectedCounselorStatement.origin) { - case ChatStatementOrigin.COUNSELOR_AUTO: - await statusIndicator(pluginPage).setStatus('AVAILABLE'); - await tasks(pluginPage).acceptNextTask(); - await flexChatProgress.next(); - break; - default: - await flexChatProgress.next(); - break; - } + await flexChatProgress.next(); } }