Skip to content

Commit

Permalink
Merge pull request #95 from RasaHQ/test/add-test-for-large-image-hand…
Browse files Browse the repository at this point in the history
…ling

tests: high resolution images response type use cases
  • Loading branch information
csunjka authored Dec 9, 2024
2 parents 58c708e + ffb5100 commit f88521a
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 0 deletions.
Binary file modified e2e/RasaChatbotWidgetTestCases.xlsx
Binary file not shown.
26 changes: 26 additions & 0 deletions e2e/cypress/fixtures/chatbotWidgetData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { link } from 'fs';
const userInputs = {
textMessage: 'Hello',
imageMessage: 'Image',
highResolutionImageMessage: 'HR_image',
accordionMessage: 'Accordion',
carouselMessage: 'Carousel',
highResolutionImageCarouselMessage: 'Carousel_with_high_resolution',
fileDownloadMessage: 'File',
quickRepliesMessage: 'Markdown',
videoMessage: 'Video',
Expand All @@ -30,6 +32,15 @@ const botResponses = {
},
},
},
HR_image: {
text: 'You are seeing high resolution image.',
attachment: {
type: 'image',
payload: {
src: 'https://store.hrblock.com/shoppingcart/assets/Win_H2.png',
},
},
},
Accordion: {
type: 'accordion',
elements: [
Expand Down Expand Up @@ -69,6 +80,21 @@ const botResponses = {
},
],
},
Carousel_with_high_resolution: {
type: 'carousel',
elements: [
{
image_url: 'https://store.hrblock.com/shoppingcart/assets/Win_H2.png',
text: 'Click here for more details on Premium & Business',
},
{
image_url:
'https://static1.moviewebimages.com/wordpress/wp-content/uploads/2023/04/scott-balua-as-captain-archer-in-enterprise-cbs-televisio.jpg',
text: 'Click here for more details on Jonathan Archer',
link: 'https://memory-alpha.fandom.com/wiki/Jonathan_Archer',
},
],
},
File: {
type: 'file_download',
text: 'Download the Open-Source Rasa Python SDK',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions e2e/cypress/tests/responseTypesSocketConnection.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,76 @@ describe('Response messages types', () => {
title: 'videoMessageResponse',
});
});

it('TC023 - Response message type: High resolution image', () => {
chatbotWidgetPage.widgetLauncher.should('be.visible');

chatbotWidgetPage.widgetLauncher.click();

chatbotWidgetPage.widgetOpened.should('be.visible');

chatbotWidgetPage.widgetHeader.should('be.visible');

chatbotWidgetPage.widgetInputField.should('be.visible');

chatbotWidgetPage.widgetSendButton.should('be.visible');

cy.userSendMessage(userInputs.highResolutionImageMessage);

chatbotWidgetPage.userChatMessage.should('be.visible');

cy.checkUserMessageIsSent(userInputs.highResolutionImageMessage);

chatbotWidgetPage.botChatImageMessage.should('be.visible');

chatbotWidgetPage.botChatImageMessage
.find('img')
.should(
'have.attr',
'src',
'https://store.hrblock.com/shoppingcart/assets/Win_H2.png'
);

cy.wait(1000);

chatbotWidgetPage.widgetOpened.wait(1000).matchImage({
title: 'highResolutionImageMessageResponse',
});
});

it('TC024 - Response message type: Carousel with high resolution image', () => {
chatbotWidgetPage.widgetLauncher.click();

chatbotWidgetPage.widgetOpened.should('be.visible');

chatbotWidgetPage.widgetHeader.should('be.visible');

chatbotWidgetPage.widgetInputField.should('be.visible');

chatbotWidgetPage.widgetSendButton.should('be.visible');

cy.userSendMessage(userInputs.highResolutionImageCarouselMessage);

chatbotWidgetPage.userChatMessage.should('be.visible');

cy.checkUserMessageIsSent(userInputs.highResolutionImageCarouselMessage);

chatbotWidgetPage.botChatCarouselMessage.should('be.visible');

chatbotWidgetPage.botChatCarouselRightIcon.should('be.visible');

chatbotWidgetPage.botChatCarouselRightIcon.click();

chatbotWidgetPage.botChatCarouselLeftIcon.should('be.visible');

chatbotWidgetPage.botChatCarouselLeftIcon.click();

chatbotWidgetPage.botChatCarouselLeftIcon.should('not.exist');

cy.wait(2000);

chatbotWidgetPage.widgetOpened.matchImage({
title: 'carouselWithHighResolutionImageMessageResponse',
});
});
});

0 comments on commit f88521a

Please sign in to comment.