@coveo/quantic 3.44.1 → 3.44.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/classes/OrganizationEndpointsTest.cls +71 -15
- package/force-app/main/default/classes/RecommendationsControllerTest.cls +1 -1
- package/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js +148 -125
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +16 -16
- package/package.json +33 -31
- package/force-app/main/default/lwc/quanticAriaLive/__tests__/quanticAriaLive.test.js +0 -106
- package/force-app/main/default/lwc/quanticBreadcrumbManager/__tests__/quanticBreadcrumbManager.test.js +0 -752
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/data.ts +0 -130
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +0 -87
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/pageObject.ts +0 -282
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +0 -208
- package/force-app/main/default/lwc/quanticCarousel/__tests__/quanticCarousel.test.js +0 -262
- package/force-app/main/default/lwc/quanticCaseClassification/__tests__/quanticCaseClassification.test.js +0 -819
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/data.ts +0 -23
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/fixture.ts +0 -51
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/pageObject.ts +0 -152
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/quanticCaseClassification.e2e.ts +0 -269
- package/force-app/main/default/lwc/quanticCategoryFacet/__tests__/quanticCategoryFacet.test.js +0 -1183
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +0 -91
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +0 -79
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/pageObject.ts +0 -55
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +0 -219
- package/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js +0 -581
- package/force-app/main/default/lwc/quanticColoredResultBadge/__tests__/quanticColoredResultBadge.test.js +0 -212
- package/force-app/main/default/lwc/quanticDateFacet/__tests__/quanticDateFacet.test.js +0 -688
- package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +0 -44
- package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +0 -72
- package/force-app/main/default/lwc/quanticDateFacet/e2e/pageObject.ts +0 -27
- package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +0 -167
- package/force-app/main/default/lwc/quanticDidYouMean/__tests__/quanticDidYouMean.test.js +0 -348
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/data.ts +0 -48
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/fixture.ts +0 -84
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/pageObject.ts +0 -173
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/quanticDidYouMean.e2e.ts +0 -219
- package/force-app/main/default/lwc/quanticDocumentSuggestion/__tests__/quanticDocumentSuggestion.test.js +0 -404
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/fixture.ts +0 -38
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/pageObject.ts +0 -52
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/quanticDocumentSuggestion.e2e.ts +0 -102
- package/force-app/main/default/lwc/quanticFacet/__tests__/quanticFacet.test.js +0 -1105
- package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +0 -62
- package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +0 -78
- package/force-app/main/default/lwc/quanticFacet/e2e/pageObject.ts +0 -67
- package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +0 -242
- package/force-app/main/default/lwc/quanticFacetCaption/__tests__/quanticFacetCaption.test.js +0 -28
- package/force-app/main/default/lwc/quanticFacetManager/__tests__/quanticFacetManager.test.js +0 -178
- package/force-app/main/default/lwc/quanticFacetManager/e2e/data.ts +0 -59
- package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +0 -75
- package/force-app/main/default/lwc/quanticFacetManager/e2e/pageObject.ts +0 -23
- package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +0 -82
- package/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js +0 -403
- package/force-app/main/default/lwc/quanticFeedbackModal/__tests__/quanticFeedbackModal.test.js +0 -448
- package/force-app/main/default/lwc/quanticFeedbackModalQna/__tests__/quanticFeedbackModalQna.test.js +0 -298
- package/force-app/main/default/lwc/quanticFoldedResultList/__tests__/quanticFoldedResultList.test.js +0 -323
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/fixture.ts +0 -74
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/pageObject.ts +0 -81
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/quanticFoldedResultList.e2e.ts +0 -69
- package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +0 -1575
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/agentData.ts +0 -279
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/data.ts +0 -56
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture-agent.ts +0 -77
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture.ts +0 -194
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +0 -599
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswer.e2e.ts +0 -333
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswerAgent.e2e.ts +0 -298
- package/force-app/main/default/lwc/quanticGeneratedAnswerBody/__tests__/quanticGeneratedAnswerBody.test.js +0 -418
- package/force-app/main/default/lwc/quanticGeneratedAnswerContent/__tests__/quanticGeneratedAnswerContent.test.js +0 -447
- package/force-app/main/default/lwc/quanticGeneratedAnswerCopyToClipboard/__tests__/quanticGeneratedAnswerCopyToClipboard.test.js +0 -129
- package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/__tests__/quanticGeneratedAnswerFollowUpInput.test.js +0 -466
- package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/quanticGeneratedAnswerStreamOfThought.test.js +0 -402
- package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/stepsUtils.test.js +0 -118
- package/force-app/main/default/lwc/quanticGeneratedAnswerThread/__tests__/quanticGeneratedAnswerThread.test.js +0 -285
- package/force-app/main/default/lwc/quanticHeading/__tests__/quanticHeading.test.js +0 -71
- package/force-app/main/default/lwc/quanticHeadlessLoader/__tests__/quanticHeadlessLoader.test.js +0 -651
- package/force-app/main/default/lwc/quanticInsightInterface/__tests__/quanticInsightInterface.test.js +0 -194
- package/force-app/main/default/lwc/quanticInsightSummary/__tests__/quanticInsightSummary.test.js +0 -230
- package/force-app/main/default/lwc/quanticModal/__tests__/quanticModal.test.js +0 -205
- package/force-app/main/default/lwc/quanticNotifications/__tests__/quanticNotifications.test.js +0 -309
- package/force-app/main/default/lwc/quanticNotifications/e2e/fixture.ts +0 -62
- package/force-app/main/default/lwc/quanticNotifications/e2e/pageObject.ts +0 -55
- package/force-app/main/default/lwc/quanticNotifications/e2e/quanticNotifications.e2e.ts +0 -47
- package/force-app/main/default/lwc/quanticNumericFacet/__tests__/quanticNumericFacet.test.js +0 -953
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +0 -48
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +0 -75
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/pageObject.ts +0 -59
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +0 -186
- package/force-app/main/default/lwc/quanticPager/__tests__/quanticPager.test.js +0 -430
- package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +0 -65
- package/force-app/main/default/lwc/quanticPager/e2e/pageObject.ts +0 -69
- package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +0 -106
- package/force-app/main/default/lwc/quanticPlaceholder/__tests__/quanticPlaceholder.test.js +0 -47
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/defaultTestCase.json +0 -13
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/youtubeTestCase.json +0 -14
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js +0 -82
- package/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js +0 -273
- package/force-app/main/default/lwc/quanticRecentQueriesList/__tests__/quanticRecentQueriesList.test.js +0 -448
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/fixture.ts +0 -43
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/pageObject.ts +0 -55
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/quanticRecentQueriesList.e2e.ts +0 -93
- package/force-app/main/default/lwc/quanticRecentResultsList/__tests__/quanticRecentResultsList.test.js +0 -516
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/fixture.ts +0 -43
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/pageObject.ts +0 -61
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/quanticRecentResultsList.e2e.ts +0 -48
- package/force-app/main/default/lwc/quanticRecommendationList/__tests__/quanticRecommendationList.test.js +0 -491
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/fixture.ts +0 -36
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/pageObject.ts +0 -52
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/quanticRecommendationList.e2e.ts +0 -53
- package/force-app/main/default/lwc/quanticRefineModalContent/__tests__/quanticRefineModalContent.test.js +0 -747
- package/force-app/main/default/lwc/quanticRefineToggle/__tests__/quanticRefineToggle.test.js +0 -544
- package/force-app/main/default/lwc/quanticResultAction/__tests__/quanticResultAction.test.js +0 -262
- package/force-app/main/default/lwc/quanticResultActionBar/__tests__/quanticResultActionBar.test.js +0 -141
- package/force-app/main/default/lwc/quanticResultChildren/__tests__/quanticResultChildren.test.js +0 -340
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/__tests__/quanticResultCopyToClipboard.test.js +0 -300
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/fixture.ts +0 -49
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/pageObject.ts +0 -49
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/quanticResultCopyToClipboard.e2e.ts +0 -40
- package/force-app/main/default/lwc/quanticResultDate/__tests__/quanticResultDate.test.js +0 -144
- package/force-app/main/default/lwc/quanticResultField/__tests__/quanticResultField.test.js +0 -120
- package/force-app/main/default/lwc/quanticResultHighlightedTextField/__tests__/quanticResultHighlightedTextField.test.js +0 -209
- package/force-app/main/default/lwc/quanticResultLink/__tests__/quanticResultLink.test.js +0 -302
- package/force-app/main/default/lwc/quanticResultList/__tests__/quanticResultList.test.js +0 -342
- package/force-app/main/default/lwc/quanticResultList/e2e/fixture.ts +0 -70
- package/force-app/main/default/lwc/quanticResultList/e2e/pageObject.ts +0 -81
- package/force-app/main/default/lwc/quanticResultList/e2e/quanticResultList.e2e.ts +0 -69
- package/force-app/main/default/lwc/quanticResultMultiValueText/__tests__/quanticResultMultiValueText.test.js +0 -235
- package/force-app/main/default/lwc/quanticResultNumber/__tests__/quanticResultNumber.test.js +0 -144
- package/force-app/main/default/lwc/quanticResultPrintableUri/__tests__/quanticResultPrintableUri.test.js +0 -324
- package/force-app/main/default/lwc/quanticResultQuickview/__tests__/quanticResultQuickview.test.js +0 -308
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/fixture.ts +0 -85
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/pageObject.ts +0 -38
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/quanticResultQuickView.e2e.ts +0 -66
- package/force-app/main/default/lwc/quanticResultTemplate/__tests__/quanticResultTemplate.test.js +0 -90
- package/force-app/main/default/lwc/quanticResultText/__tests__/quanticResultText.test.js +0 -155
- package/force-app/main/default/lwc/quanticResultsPerPage/__tests__/quanticResultsPerPage.test.js +0 -464
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/fixture.ts +0 -78
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/pageObject.ts +0 -85
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/quanticResultsPerPage.e2e.ts +0 -97
- package/force-app/main/default/lwc/quanticSearchBox/__tests__/quanticSearchBox.test.js +0 -487
- package/force-app/main/default/lwc/quanticSearchBox/e2e/fixture.ts +0 -86
- package/force-app/main/default/lwc/quanticSearchBox/e2e/pageObject.ts +0 -45
- package/force-app/main/default/lwc/quanticSearchBox/e2e/quanticSearchBox.e2e.ts +0 -159
- package/force-app/main/default/lwc/quanticSearchBoxInput/__tests__/quanticSearchBoxInput.test.js +0 -743
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/__tests__/quanticSearchBoxSuggestionsList.test.js +0 -571
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/fixture.ts +0 -113
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/pageObject.ts +0 -113
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/quanticSearchBoxSuggestionsList.e2e.ts +0 -282
- package/force-app/main/default/lwc/quanticSmartSnippet/__tests__/quanticSmartSnippet.test.js +0 -341
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/data.ts +0 -21
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/fixture.ts +0 -93
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/pageObject.ts +0 -196
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts +0 -168
- package/force-app/main/default/lwc/quanticSmartSnippetAnswer/__tests__/quanticSmartSnippetAnswer.test.js +0 -126
- package/force-app/main/default/lwc/quanticSmartSnippetSource/__tests__/quanticSmartSnippetSource.test.js +0 -290
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/__tests__/quanticSmartSnippetSuggestions.test.js +0 -329
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/data.ts +0 -31
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/fixture.ts +0 -95
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/pageObject.ts +0 -160
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/quanticSmartSnippetSuggestions.e2e.ts +0 -127
- package/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js +0 -416
- package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +0 -62
- package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +0 -100
- package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +0 -86
- package/force-app/main/default/lwc/quanticSourceCitations/__tests__/quanticSourceCitations.test.js +0 -156
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js +0 -387
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/fixture.ts +0 -54
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/pageObject.ts +0 -54
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/quanticStandaloneSearchBox.e2e.ts +0 -72
- package/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js +0 -222
- package/force-app/main/default/lwc/quanticSummary/__tests__/quanticSummary.test.js +0 -244
- package/force-app/main/default/lwc/quanticTab/__tests__/quanticTab.test.js +0 -333
- package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +0 -60
- package/force-app/main/default/lwc/quanticTab/e2e/pageObject.ts +0 -68
- package/force-app/main/default/lwc/quanticTab/e2e/quanticTab.e2e.ts +0 -72
- package/force-app/main/default/lwc/quanticTabBar/__tests__/quanticTabBar.test.js +0 -331
- package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +0 -65
- package/force-app/main/default/lwc/quanticTabBar/e2e/pageObject.ts +0 -80
- package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +0 -172
- package/force-app/main/default/lwc/quanticThreadItem/__tests__/quanticThreadItem.test.js +0 -314
- package/force-app/main/default/lwc/quanticTimeframeFacet/__tests__/quanticTimeframeFacet.test.js +0 -1059
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/data.ts +0 -66
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +0 -74
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/pageObject.ts +0 -43
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +0 -184
- package/force-app/main/default/lwc/quanticTooltip/__tests__/quanticTooltip.test.js +0 -107
- package/force-app/main/default/lwc/quanticUserAction/__tests__/quanticUserAction.test.js +0 -427
- package/force-app/main/default/lwc/quanticUserActionsSession/__tests__/quanticUserActionsSession.test.js +0 -269
- package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/data/userActionsState.json +0 -89
- package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/quanticUserActionsTimeline.test.js +0 -511
- package/force-app/main/default/lwc/quanticUserActionsToggle/__tests__/quanticUserActionsToggle.test.js +0 -229
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/data.ts +0 -32
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/fixture.ts +0 -32
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/pageObject.ts +0 -71
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/quanticUserActionsToggle.e2e.ts +0 -39
- package/force-app/main/default/lwc/quanticUtils/__tests__/accessibilityUtils.test.js +0 -214
- package/force-app/main/default/lwc/quanticUtils/__tests__/citationAnchoringUtils.test.js +0 -84
- package/force-app/main/default/lwc/quanticUtils/__tests__/facetDependenciesUtils.test.js +0 -92
- package/force-app/main/default/lwc/quanticUtils/__tests__/facetStoreUtils.test.js +0 -86
- package/force-app/main/default/lwc/quanticUtils/__tests__/markdownUtils.test.js +0 -109
- package/force-app/main/default/lwc/quanticUtils/__tests__/quanticUtils.test.js +0 -233
- package/force-app/main/default/lwc/quanticUtils/__tests__/timeAndDateUtils.test.js +0 -22
- package/force-app/main/default/lwc/quanticViewedByCustomerBadge/__tests__/quanticViewedByCustomerBadge.test.js +0 -131
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import {testSearch, testInsight, expect} from './fixture';
|
|
2
|
-
import {useCaseTestCases} from '../../../../../../playwright/utils/useCase';
|
|
3
|
-
import genQaData from './data';
|
|
4
|
-
import {analyticsModeTest} from '../../../../../../playwright/utils/analyticsMode';
|
|
5
|
-
|
|
6
|
-
const fixtures = {
|
|
7
|
-
search: testSearch,
|
|
8
|
-
insight: testInsight,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const exampleAnswerConfigurationId = 'fc581be0-6e61-4039-ab26-a3f2f52f308f';
|
|
12
|
-
|
|
13
|
-
useCaseTestCases.forEach((useCase) => {
|
|
14
|
-
let test = fixtures[useCase.value];
|
|
15
|
-
|
|
16
|
-
test.describe(`quantic generated answer ${useCase.label}`, () => {
|
|
17
|
-
analyticsModeTest.forEach((analytics) => {
|
|
18
|
-
test.describe(analytics.label, () => {
|
|
19
|
-
test.use({
|
|
20
|
-
analyticsMode: analytics.mode,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const configurations = [
|
|
24
|
-
{
|
|
25
|
-
name: 'with answerConfigurationId',
|
|
26
|
-
options: {
|
|
27
|
-
answerConfigurationId: exampleAnswerConfigurationId,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'without answerConfigurationId',
|
|
32
|
-
options: {},
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
for (const config of configurations) {
|
|
37
|
-
test.describe(config.name, () => {
|
|
38
|
-
test.use({analyticsMode: analytics.mode, options: config.options});
|
|
39
|
-
|
|
40
|
-
test.describe('when the answer has been generated', () => {
|
|
41
|
-
test('should send a stream end analytics event', async ({
|
|
42
|
-
generatedAnswer,
|
|
43
|
-
}) => {
|
|
44
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
if (config.options.answerConfigurationId) {
|
|
48
|
-
test('should send searchboxSubmit as the action cause in the analytics payload of the generate request', async ({
|
|
49
|
-
generatedAnswer,
|
|
50
|
-
}) => {
|
|
51
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
52
|
-
const generateRequest =
|
|
53
|
-
await generatedAnswer.generateRequestPromise;
|
|
54
|
-
const generateRequestBody = generateRequest.postDataJSON();
|
|
55
|
-
expect(generateRequestBody.analytics.actionCause).toBe(
|
|
56
|
-
'searchboxSubmit'
|
|
57
|
-
);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test.describe('when providing positive feedback', () => {
|
|
63
|
-
test('should send positive feedback analytics containing all details', async ({
|
|
64
|
-
generatedAnswer,
|
|
65
|
-
}) => {
|
|
66
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
67
|
-
const likeAnalyticRequestPromise =
|
|
68
|
-
generatedAnswer.waitForLikeGeneratedAnswerAnalytics();
|
|
69
|
-
await generatedAnswer.clickLikeButton();
|
|
70
|
-
await likeAnalyticRequestPromise;
|
|
71
|
-
|
|
72
|
-
const exampleDocumentUrl = 'https://www.coveo.com/';
|
|
73
|
-
const exampleDetails = 'example details...';
|
|
74
|
-
await generatedAnswer.fillFeedbackForm({
|
|
75
|
-
correctTopic: 'Yes',
|
|
76
|
-
hallucinationFree: 'Yes',
|
|
77
|
-
documented: 'Not sure',
|
|
78
|
-
readable: 'Yes',
|
|
79
|
-
});
|
|
80
|
-
await generatedAnswer.typeInFeedbackDocumentUrlInput(
|
|
81
|
-
exampleDocumentUrl
|
|
82
|
-
);
|
|
83
|
-
await generatedAnswer.typeInFeedbackDetailsInput(
|
|
84
|
-
exampleDetails
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const feedbackRequestPromise =
|
|
88
|
-
generatedAnswer.waitForFeedbackSubmitRequest({
|
|
89
|
-
correctTopic: 'yes',
|
|
90
|
-
hallucinationFree: 'yes',
|
|
91
|
-
documented: 'unknown',
|
|
92
|
-
readable: 'yes',
|
|
93
|
-
documentUrl: exampleDocumentUrl,
|
|
94
|
-
details: exampleDetails,
|
|
95
|
-
helpful: true,
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
await generatedAnswer.clickSubmitFeedbackButton();
|
|
99
|
-
await feedbackRequestPromise;
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
test('should keep sending RGA analytics events after submitting feedback', async ({
|
|
103
|
-
generatedAnswer,
|
|
104
|
-
}) => {
|
|
105
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
106
|
-
const likeAnalyticRequestPromise =
|
|
107
|
-
generatedAnswer.waitForLikeGeneratedAnswerAnalytics();
|
|
108
|
-
await generatedAnswer.clickLikeButton();
|
|
109
|
-
await likeAnalyticRequestPromise;
|
|
110
|
-
|
|
111
|
-
const exampleDocumentUrl = 'https://www.coveo.com/';
|
|
112
|
-
const exampleDetails = 'example details...';
|
|
113
|
-
await generatedAnswer.fillFeedbackForm({
|
|
114
|
-
correctTopic: 'Yes',
|
|
115
|
-
hallucinationFree: 'Yes',
|
|
116
|
-
documented: 'Not sure',
|
|
117
|
-
readable: 'Yes',
|
|
118
|
-
});
|
|
119
|
-
await generatedAnswer.typeInFeedbackDocumentUrlInput(
|
|
120
|
-
exampleDocumentUrl
|
|
121
|
-
);
|
|
122
|
-
await generatedAnswer.typeInFeedbackDetailsInput(
|
|
123
|
-
exampleDetails
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
const feedbackRequestPromise =
|
|
127
|
-
generatedAnswer.waitForFeedbackSubmitRequest({
|
|
128
|
-
correctTopic: 'yes',
|
|
129
|
-
hallucinationFree: 'yes',
|
|
130
|
-
documented: 'unknown',
|
|
131
|
-
readable: 'yes',
|
|
132
|
-
documentUrl: exampleDocumentUrl,
|
|
133
|
-
details: exampleDetails,
|
|
134
|
-
helpful: true,
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
await generatedAnswer.clickSubmitFeedbackButton();
|
|
138
|
-
await feedbackRequestPromise;
|
|
139
|
-
|
|
140
|
-
await generatedAnswer.clickCompleteFeedbackButton();
|
|
141
|
-
|
|
142
|
-
// Click the copy to clipboard button and ensure the analytic is sent.
|
|
143
|
-
const copyToClipboardAnalyticRequestPromise =
|
|
144
|
-
generatedAnswer.waitForCopyToClipboardAnalytics();
|
|
145
|
-
await generatedAnswer.clickCopyToClipboardButton();
|
|
146
|
-
await copyToClipboardAnalyticRequestPromise;
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
test.describe('when providing negative feedback', () => {
|
|
151
|
-
test('should send negative feedback analytics containing all details', async ({
|
|
152
|
-
generatedAnswer,
|
|
153
|
-
}) => {
|
|
154
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
155
|
-
const dislikeAnalyticRequestPromise =
|
|
156
|
-
generatedAnswer.waitForDislikeGeneratedAnswerAnalytics();
|
|
157
|
-
await generatedAnswer.clickDislikeButton();
|
|
158
|
-
await dislikeAnalyticRequestPromise;
|
|
159
|
-
|
|
160
|
-
const exampleDocumentUrl = 'https://www.coveo.com/';
|
|
161
|
-
const exampleDetails = 'example details...';
|
|
162
|
-
await generatedAnswer.fillFeedbackForm({
|
|
163
|
-
correctTopic: 'No',
|
|
164
|
-
hallucinationFree: 'Not sure',
|
|
165
|
-
documented: 'No',
|
|
166
|
-
readable: 'No',
|
|
167
|
-
});
|
|
168
|
-
await generatedAnswer.typeInFeedbackDocumentUrlInput(
|
|
169
|
-
exampleDocumentUrl
|
|
170
|
-
);
|
|
171
|
-
await generatedAnswer.typeInFeedbackDetailsInput(
|
|
172
|
-
exampleDetails
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
const feedbackRequestPromise =
|
|
176
|
-
generatedAnswer.waitForFeedbackSubmitRequest({
|
|
177
|
-
correctTopic: 'no',
|
|
178
|
-
hallucinationFree: 'unknown',
|
|
179
|
-
documented: 'no',
|
|
180
|
-
readable: 'no',
|
|
181
|
-
documentUrl: exampleDocumentUrl,
|
|
182
|
-
details: exampleDetails,
|
|
183
|
-
helpful: false,
|
|
184
|
-
});
|
|
185
|
-
await generatedAnswer.clickSubmitFeedbackButton();
|
|
186
|
-
await feedbackRequestPromise;
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
test.describe('when copying the generated answer to clipboard', () => {
|
|
191
|
-
test('should send a copy to clipboard analytics event', async ({
|
|
192
|
-
generatedAnswer,
|
|
193
|
-
}) => {
|
|
194
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
195
|
-
const analyticRequestPromise =
|
|
196
|
-
generatedAnswer.waitForCopyToClipboardAnalytics();
|
|
197
|
-
await generatedAnswer.clickCopyToClipboardButton();
|
|
198
|
-
await analyticRequestPromise;
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
test.describe('when the property withToggle is set to true', () => {
|
|
203
|
-
test.use({
|
|
204
|
-
options: {
|
|
205
|
-
...config.options,
|
|
206
|
-
withToggle: true,
|
|
207
|
-
},
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
test('should allow toggling the generated OFF and ON and log analytics', async ({
|
|
211
|
-
generatedAnswer,
|
|
212
|
-
}) => {
|
|
213
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
214
|
-
const hideAnswerAnalyticRequestPromise =
|
|
215
|
-
generatedAnswer.waitForHideAnswersAnalytics();
|
|
216
|
-
await generatedAnswer.clickToggleButton();
|
|
217
|
-
await hideAnswerAnalyticRequestPromise;
|
|
218
|
-
|
|
219
|
-
const showAnswerAnalyticRequestPromise =
|
|
220
|
-
generatedAnswer.waitForShowAnswersAnalytics();
|
|
221
|
-
await generatedAnswer.clickToggleButton();
|
|
222
|
-
await showAnswerAnalyticRequestPromise;
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
test.describe('when interacting with citations', () => {
|
|
227
|
-
test.describe('when hovering over a citation', () => {
|
|
228
|
-
test('should log citation hover analytics', async ({
|
|
229
|
-
generatedAnswer,
|
|
230
|
-
}) => {
|
|
231
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
232
|
-
const citationIndex = 0;
|
|
233
|
-
const {id, permanentid} = genQaData.citations[citationIndex];
|
|
234
|
-
const citationHoverAnalyticRequestPromise =
|
|
235
|
-
generatedAnswer.waitForSourceHoverAnalytics({
|
|
236
|
-
citationId: id,
|
|
237
|
-
permanentId: permanentid,
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
await generatedAnswer.hoverOverCitation(citationIndex);
|
|
241
|
-
await citationHoverAnalyticRequestPromise;
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
test.describe('when clicking on a citation', () => {
|
|
246
|
-
test('should log citation click analytics', async ({
|
|
247
|
-
generatedAnswer,
|
|
248
|
-
}) => {
|
|
249
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
250
|
-
const citationIndex = 0;
|
|
251
|
-
const {id, title, source, uri, clickUri, permanentid} =
|
|
252
|
-
genQaData.citations[citationIndex];
|
|
253
|
-
const citationClickAnalyticRequestPromise =
|
|
254
|
-
generatedAnswer.waitForCitationClickAnalytics({
|
|
255
|
-
documentTitle: title,
|
|
256
|
-
sourceName: source,
|
|
257
|
-
documentPosition: citationIndex + 1,
|
|
258
|
-
documentUri: uri,
|
|
259
|
-
documentUrl: clickUri,
|
|
260
|
-
citationId: id,
|
|
261
|
-
contentIDKey: 'permanentid',
|
|
262
|
-
contentIDValue: permanentid,
|
|
263
|
-
});
|
|
264
|
-
await generatedAnswer.clickOnCitation(citationIndex);
|
|
265
|
-
await citationClickAnalyticRequestPromise;
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
test.describe('when the answer is generated in a single shot and the answer exceeds the maximum height', () => {
|
|
271
|
-
test.use({
|
|
272
|
-
options: {
|
|
273
|
-
...config.options,
|
|
274
|
-
collapsible: true,
|
|
275
|
-
},
|
|
276
|
-
});
|
|
277
|
-
test('should display the answer as collapsed', async ({
|
|
278
|
-
generatedAnswer,
|
|
279
|
-
}) => {
|
|
280
|
-
const expectedShowMoreLabel = 'Show more';
|
|
281
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
282
|
-
|
|
283
|
-
const showMoreButton = generatedAnswer.showMoreButton;
|
|
284
|
-
expect(showMoreButton).not.toBeNull();
|
|
285
|
-
|
|
286
|
-
const showMoreButtonLabel = await showMoreButton.textContent();
|
|
287
|
-
expect(showMoreButtonLabel).not.toBeNull();
|
|
288
|
-
expect(showMoreButtonLabel).toEqual(expectedShowMoreLabel);
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
if (config.options.answerConfigurationId) {
|
|
293
|
-
test.describe('when selecting a timeframe facet after the answer is generated', () => {
|
|
294
|
-
test.use({
|
|
295
|
-
options: {
|
|
296
|
-
...config.options,
|
|
297
|
-
},
|
|
298
|
-
withFacets: true,
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
test('should trigger a new generate call to the answer API', async ({
|
|
302
|
-
generatedAnswer,
|
|
303
|
-
baseFacet,
|
|
304
|
-
}) => {
|
|
305
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
306
|
-
|
|
307
|
-
const generateRequestPromise =
|
|
308
|
-
generatedAnswer.waitForHeadAnswerRequest();
|
|
309
|
-
|
|
310
|
-
const streamEndAnalyticRequestPromise =
|
|
311
|
-
generatedAnswer.waitForStreamEndAnalytics();
|
|
312
|
-
|
|
313
|
-
const searchResponsePromise =
|
|
314
|
-
baseFacet.waitForSearchResponse();
|
|
315
|
-
|
|
316
|
-
await generatedAnswer.clickFirstTimeframeFacetLink();
|
|
317
|
-
|
|
318
|
-
const generateRequest = await generateRequestPromise;
|
|
319
|
-
const generateRequestBody = generateRequest.postDataJSON();
|
|
320
|
-
expect(generateRequestBody.analytics.actionCause).toBe(
|
|
321
|
-
'facetSelect'
|
|
322
|
-
);
|
|
323
|
-
await streamEndAnalyticRequestPromise;
|
|
324
|
-
await searchResponsePromise;
|
|
325
|
-
});
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
});
|
|
332
|
-
});
|
|
333
|
-
});
|
package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswerAgent.e2e.ts
DELETED
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import {testAgent, expect} from './fixture-agent';
|
|
2
|
-
import agentData, {turnLimitErrorStream, genericErrorStream} from './agentData';
|
|
3
|
-
import {
|
|
4
|
-
analyticsModeTest,
|
|
5
|
-
AnalyticsModeEnum,
|
|
6
|
-
} from '../../../../../../playwright/utils/analyticsMode';
|
|
7
|
-
|
|
8
|
-
const exampleAgentId = '5fd0b5ea-d368-488e-bdeb-f6221ec0fb98';
|
|
9
|
-
|
|
10
|
-
analyticsModeTest.forEach((analytics) => {
|
|
11
|
-
testAgent.describe(`quantic generated answer - agent - ${analytics.label}`, () => {
|
|
12
|
-
testAgent.use({
|
|
13
|
-
analyticsMode: analytics.mode,
|
|
14
|
-
options: {agentId: exampleAgentId},
|
|
15
|
-
permissions: ['clipboard-read', 'clipboard-write'],
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
if (analytics.mode !== AnalyticsModeEnum.legacy) {
|
|
19
|
-
testAgent.fixme(true, 'Agent next analytics mode not yet implemented');
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
testAgent(
|
|
24
|
-
'should handle multiple answer generation, feedback, clipboard, citation, and follow-up interactions',
|
|
25
|
-
async ({generatedAnswer, page}) => {
|
|
26
|
-
await testAgent.step(
|
|
27
|
-
'should send a stream end analytics event when the first answer is generated',
|
|
28
|
-
async () => {
|
|
29
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
await testAgent.step(
|
|
34
|
-
'should send like analytics event when liking the first answer',
|
|
35
|
-
async () => {
|
|
36
|
-
const likeAnalyticRequestPromise =
|
|
37
|
-
generatedAnswer.waitForLikeGeneratedAnswerAnalytics();
|
|
38
|
-
await generatedAnswer.clickLikeButton();
|
|
39
|
-
await likeAnalyticRequestPromise;
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
await testAgent.step(
|
|
44
|
-
'should send dislike analytics event when disliking the first answer',
|
|
45
|
-
async () => {
|
|
46
|
-
const dislikeAnalyticRequestPromise =
|
|
47
|
-
generatedAnswer.waitForDislikeGeneratedAnswerAnalytics();
|
|
48
|
-
await generatedAnswer.clickDislikeButton();
|
|
49
|
-
await dislikeAnalyticRequestPromise;
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
await testAgent.step(
|
|
54
|
-
'should send a copy to clipboard analytics event and update the clipboard with the first answer content',
|
|
55
|
-
async () => {
|
|
56
|
-
const analyticRequestPromise =
|
|
57
|
-
generatedAnswer.waitForCopyToClipboardAnalytics();
|
|
58
|
-
await generatedAnswer.clickCopyToClipboardButton();
|
|
59
|
-
await analyticRequestPromise;
|
|
60
|
-
|
|
61
|
-
const clipboardContent = await page.evaluate(() =>
|
|
62
|
-
navigator.clipboard.readText()
|
|
63
|
-
);
|
|
64
|
-
expect(clipboardContent).toContain('Testing in Coveo');
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
await testAgent.step(
|
|
69
|
-
'should log citation hover analytics when hovering over a citation from the first answer',
|
|
70
|
-
async () => {
|
|
71
|
-
const citationIndex = 0;
|
|
72
|
-
const {id, permanentid} = agentData.citations[citationIndex];
|
|
73
|
-
const citationHoverAnalyticRequestPromise =
|
|
74
|
-
generatedAnswer.waitForSourceHoverAnalytics({
|
|
75
|
-
citationId: id,
|
|
76
|
-
permanentId: permanentid,
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
await generatedAnswer.hoverOverCitation(citationIndex);
|
|
80
|
-
await citationHoverAnalyticRequestPromise;
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
await testAgent.step(
|
|
85
|
-
'should log citation click analytics when clicking on a citation from the first answer',
|
|
86
|
-
async () => {
|
|
87
|
-
const citationIndex = 0;
|
|
88
|
-
const {id, title, source, uri, clickUri, permanentid} =
|
|
89
|
-
agentData.citations[citationIndex];
|
|
90
|
-
const citationClickAnalyticRequestPromise =
|
|
91
|
-
generatedAnswer.waitForCitationClickAnalytics({
|
|
92
|
-
documentTitle: title,
|
|
93
|
-
sourceName: source,
|
|
94
|
-
documentPosition: citationIndex + 1,
|
|
95
|
-
documentUri: uri,
|
|
96
|
-
documentUrl: clickUri,
|
|
97
|
-
citationId: id,
|
|
98
|
-
contentIDKey: 'permanentid',
|
|
99
|
-
contentIDValue: permanentid,
|
|
100
|
-
});
|
|
101
|
-
await generatedAnswer.clickOnCitation(citationIndex);
|
|
102
|
-
await citationClickAnalyticRequestPromise;
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
await testAgent.step(
|
|
107
|
-
'FIRST FOLLOW-UP: should send the follow-up request with the correct conversationId and conversationToken',
|
|
108
|
-
async () => {
|
|
109
|
-
const followUpRequestPromise =
|
|
110
|
-
generatedAnswer.waitForAgentFollowUpRequest();
|
|
111
|
-
|
|
112
|
-
await generatedAnswer.typeFollowUpQuestion('follow-up question');
|
|
113
|
-
await generatedAnswer.submitFollowUp();
|
|
114
|
-
|
|
115
|
-
const followUpRequest = await followUpRequestPromise;
|
|
116
|
-
const followUpRequestBody = followUpRequest.postDataJSON();
|
|
117
|
-
expect(followUpRequestBody.conversationId).toBe(
|
|
118
|
-
agentData.conversationId
|
|
119
|
-
);
|
|
120
|
-
expect(followUpRequestBody.conversationToken).toBe(
|
|
121
|
-
agentData.conversationToken
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
await testAgent.step(
|
|
127
|
-
'should send stream end analytics with the right answerId for the follow-up',
|
|
128
|
-
async () => {
|
|
129
|
-
const followUpStreamEndPromise =
|
|
130
|
-
generatedAnswer.waitForFollowUpStreamEndAnalytics(
|
|
131
|
-
agentData.answerId2
|
|
132
|
-
);
|
|
133
|
-
await followUpStreamEndPromise;
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
await testAgent.step(
|
|
138
|
-
'should send like analytics with the follow-up answerId when liking the first follow-up answer',
|
|
139
|
-
async () => {
|
|
140
|
-
const likeAnalyticRequestPromise =
|
|
141
|
-
generatedAnswer.waitForLikeGeneratedAnswerAnalyticsForId(
|
|
142
|
-
agentData.answerId2
|
|
143
|
-
);
|
|
144
|
-
// Should be the first like button, since the previous answers are collapsed and the follow-up answer is the only one visible.
|
|
145
|
-
await generatedAnswer.clickNthLikeButton(0);
|
|
146
|
-
await likeAnalyticRequestPromise;
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
await testAgent.step(
|
|
151
|
-
'SECOND FOLLOW-UP: should send the second follow-up request with the correct conversationId and conversationToken',
|
|
152
|
-
async () => {
|
|
153
|
-
const followUpRequestPromise =
|
|
154
|
-
generatedAnswer.waitForAgentFollowUpRequest();
|
|
155
|
-
|
|
156
|
-
await generatedAnswer.typeFollowUpQuestion(
|
|
157
|
-
'second follow-up question'
|
|
158
|
-
);
|
|
159
|
-
await generatedAnswer.submitFollowUp();
|
|
160
|
-
|
|
161
|
-
const followUpRequest = await followUpRequestPromise;
|
|
162
|
-
const followUpRequestBody = followUpRequest.postDataJSON();
|
|
163
|
-
expect(followUpRequestBody.conversationId).toBe(
|
|
164
|
-
agentData.conversationId
|
|
165
|
-
);
|
|
166
|
-
expect(followUpRequestBody.conversationToken).toBe(
|
|
167
|
-
agentData.conversationToken
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
await testAgent.step(
|
|
173
|
-
'should send stream end analytics with the right answerId for the second follow-up',
|
|
174
|
-
async () => {
|
|
175
|
-
const followUpStreamEndPromise =
|
|
176
|
-
generatedAnswer.waitForFollowUpStreamEndAnalytics(
|
|
177
|
-
agentData.answerId3
|
|
178
|
-
);
|
|
179
|
-
await followUpStreamEndPromise;
|
|
180
|
-
}
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
await testAgent.step(
|
|
184
|
-
'should send dislike analytics with the right answerId for the second follow-up when disliking the second follow-up answer',
|
|
185
|
-
async () => {
|
|
186
|
-
const dislikeAnalyticRequestPromise =
|
|
187
|
-
generatedAnswer.waitForDislikeGeneratedAnswerAnalyticsForId(
|
|
188
|
-
agentData.answerId3
|
|
189
|
-
);
|
|
190
|
-
// Should be the first dislike button, since the previous answers are collapsed and the second follow-up answer is the only one visible.
|
|
191
|
-
await generatedAnswer.clickNthDislikeButton(0);
|
|
192
|
-
await dislikeAnalyticRequestPromise;
|
|
193
|
-
}
|
|
194
|
-
);
|
|
195
|
-
|
|
196
|
-
await testAgent.step(
|
|
197
|
-
'should expand previous answers when clicking on the "Show previous answers" button',
|
|
198
|
-
async () => {
|
|
199
|
-
await generatedAnswer.clickShowPreviousAnswersButton();
|
|
200
|
-
await expect(generatedAnswer.threadItems).toHaveCount(3);
|
|
201
|
-
}
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
await testAgent.step(
|
|
205
|
-
'should expand the first answer when clicking on the toggle button of the first answer',
|
|
206
|
-
async () => {
|
|
207
|
-
await generatedAnswer.clickNthThreadItem(0);
|
|
208
|
-
await expect(generatedAnswer.generatedAnswerBody.nth(0)).toBeVisible();
|
|
209
|
-
await expect(generatedAnswer.generatedAnswerBody.nth(1)).not.toBeVisible();
|
|
210
|
-
await expect(generatedAnswer.generatedAnswerBody.nth(2)).toBeVisible();
|
|
211
|
-
}
|
|
212
|
-
);
|
|
213
|
-
|
|
214
|
-
await testAgent.step(
|
|
215
|
-
'should allow to like the first answer, sending the correct analytics and not affecting the other answers',
|
|
216
|
-
async () => {
|
|
217
|
-
const likeAnalyticRequestPromise =
|
|
218
|
-
generatedAnswer.waitForLikeGeneratedAnswerAnalyticsForId(
|
|
219
|
-
agentData.answerId1
|
|
220
|
-
);
|
|
221
|
-
await generatedAnswer.clickNthLikeButton(0);
|
|
222
|
-
await likeAnalyticRequestPromise;
|
|
223
|
-
await expect(generatedAnswer.likeButton.nth(0)).toHaveAttribute('aria-pressed', 'true');
|
|
224
|
-
await expect(generatedAnswer.dislikeButton.nth(0)).toHaveAttribute('aria-pressed', 'false');
|
|
225
|
-
// Only two answers are visible, so only 2 like/dislike buttons visible.
|
|
226
|
-
await expect(generatedAnswer.dislikeButton.nth(1)).toHaveAttribute('aria-pressed', 'true');
|
|
227
|
-
await expect(generatedAnswer.likeButton.nth(1)).toHaveAttribute('aria-pressed', 'false');
|
|
228
|
-
}
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
);
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
testAgent.describe('quantic generated answer - agent follow-up error handling', () => {
|
|
236
|
-
testAgent.use({
|
|
237
|
-
options: {agentId: exampleAgentId},
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
testAgent(
|
|
241
|
-
'should display a generic error message when the follow-up request fails due to a network error',
|
|
242
|
-
async ({generatedAnswer}) => {
|
|
243
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
244
|
-
await generatedAnswer.mockAgentFollowUpNetworkError();
|
|
245
|
-
|
|
246
|
-
await generatedAnswer.typeFollowUpQuestion('follow-up question');
|
|
247
|
-
await generatedAnswer.submitFollowUp();
|
|
248
|
-
|
|
249
|
-
await expect(generatedAnswer.threadItems).toHaveCount(2);
|
|
250
|
-
|
|
251
|
-
const errorMessage = generatedAnswer.threadItems
|
|
252
|
-
.last()
|
|
253
|
-
.getByTestId('generated-answer-body__error');
|
|
254
|
-
await expect(errorMessage).toBeVisible();
|
|
255
|
-
await expect(errorMessage).toContainText('Something went wrong.');
|
|
256
|
-
}
|
|
257
|
-
);
|
|
258
|
-
|
|
259
|
-
testAgent(
|
|
260
|
-
'should display a distinct turn-limit message when the follow-up SSE stream reports a turn-limit error',
|
|
261
|
-
async ({generatedAnswer}) => {
|
|
262
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
263
|
-
await generatedAnswer.mockAgentFollowUpResponse([turnLimitErrorStream]);
|
|
264
|
-
|
|
265
|
-
await generatedAnswer.typeFollowUpQuestion('follow-up question');
|
|
266
|
-
await generatedAnswer.submitFollowUp();
|
|
267
|
-
|
|
268
|
-
await expect(generatedAnswer.threadItems).toHaveCount(2);
|
|
269
|
-
|
|
270
|
-
const errorMessage = generatedAnswer.threadItems
|
|
271
|
-
.last()
|
|
272
|
-
.getByTestId('generated-answer-body__error');
|
|
273
|
-
await expect(errorMessage).toBeVisible();
|
|
274
|
-
await expect(errorMessage).toContainText(
|
|
275
|
-
'Conversation turn limit reached. Please start a new conversation.'
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
);
|
|
279
|
-
|
|
280
|
-
testAgent(
|
|
281
|
-
'should display a generic error message when the follow-up SSE stream reports a generic error',
|
|
282
|
-
async ({generatedAnswer}) => {
|
|
283
|
-
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
284
|
-
await generatedAnswer.mockAgentFollowUpResponse([genericErrorStream]);
|
|
285
|
-
|
|
286
|
-
await generatedAnswer.typeFollowUpQuestion('follow-up question');
|
|
287
|
-
await generatedAnswer.submitFollowUp();
|
|
288
|
-
|
|
289
|
-
await expect(generatedAnswer.threadItems).toHaveCount(2);
|
|
290
|
-
|
|
291
|
-
const errorMessage = generatedAnswer.threadItems
|
|
292
|
-
.last()
|
|
293
|
-
.getByTestId('generated-answer-body__error');
|
|
294
|
-
await expect(errorMessage).toBeVisible();
|
|
295
|
-
await expect(errorMessage).toContainText('Something went wrong.');
|
|
296
|
-
}
|
|
297
|
-
);
|
|
298
|
-
});
|