From b84a2a709e31a6386791eb791c50bcb8694e18a7 Mon Sep 17 00:00:00 2001 From: Fabio Colajanni Date: Tue, 9 Jul 2024 11:00:27 +0200 Subject: [PATCH] removing fixture for conversation continued test --- cypress/e2e/prevConvesations.cy.ts | 22 ++++++++------------ cypress/fixtures/prevConversations.json | 27 ------------------------- 2 files changed, 8 insertions(+), 41 deletions(-) delete mode 100644 cypress/fixtures/prevConversations.json diff --git a/cypress/e2e/prevConvesations.cy.ts b/cypress/e2e/prevConvesations.cy.ts index d6dfc94e..85dac04e 100644 --- a/cypress/e2e/prevConvesations.cy.ts +++ b/cypress/e2e/prevConvesations.cy.ts @@ -54,7 +54,7 @@ describe("Previous Conversations", () => { }); }); - it("is possible to continue a previous conversation", () => { + it("should be possible to continue a previous conversation", () => { cy.session("default2", () => { const localOptions = { userId: `user-1`, @@ -62,24 +62,18 @@ describe("Previous Conversations", () => { channel: `channel-1`, }; - const key = [ - "channel-1", - "user-1", - "session-1", - "5e51fcdc2c10fe4c5267c8a798a7134086f60b62998062af620ed73b096e25bd", - ]; - cy.window().then(window => { window.localStorage.clear(); - cy.fixture("prevConversations.json").then(jsonData => { - window.localStorage.setItem(JSON.stringify(key), JSON.stringify(jsonData)); - }); }); cy.visitWebchat(); - cy.initWebchat(localOptions).openWebchat(); + cy.initWebchat(localOptions).openWebchat().startConversation(); + cy.sendMessage("hello"); + cy.contains('You said "hello".').should("be.visible"); + + // list contains 1 item + cy.get("button.webchat-header-back-button").should("exist").click(); cy.get("button").contains("Previous conversations").click(); - cy.get(".webchat-prev-conversations-content").should("exist"); cy.get(".webchat-prev-conversations-item").should("have.length", 1); // go to the first conversation @@ -90,7 +84,7 @@ describe("Previous Conversations", () => { }); }); - it("is not possible to continue expired previous conversation", () => { + it("should not be possible to continue expired previous conversation", () => { cy.session("default3", () => { const localOptions = { userId: `user-1`, diff --git a/cypress/fixtures/prevConversations.json b/cypress/fixtures/prevConversations.json deleted file mode 100644 index c75e3c4b..00000000 --- a/cypress/fixtures/prevConversations.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "messages": [ - { - "text": "hello", - "source": "user", - "timestamp": 1720453536114 - }, - { - "text": "You said \"hello\".", - "data": {}, - "traceId": "endpoint-realtimeClient-fake-id", - "disableSensitiveLogging": false, - "source": "bot", - "timestamp": 1720453537060 - } - ], - "rating": { - "hasGivenRating": false, - "showRatingScreen": false, - "requestRatingScreenTitle": "", - "customRatingTitle": "", - "customRatingCommentText": "", - "requestRatingSubmitButtonText": "", - "requestRatingEventBannerText": "", - "requestRatingChatStatusBadgeText": "" - } -} \ No newline at end of file