Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(quantic): Smart Snippets E2E Cypress to Playwright + unit tests Migration #4785

Merged
merged 33 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fbafe23
added initial smart snippet testing structure
SimonMilord Dec 12, 2024
db7d2e4
added structure for tests for quantic smart snippet suggestions
SimonMilord Dec 12, 2024
748bffc
added basic SSS unit tests
SimonMilord Dec 12, 2024
dff2aee
added basic tests for quantic SS
SimonMilord Dec 12, 2024
573b4c6
improved setup for unit tests
SimonMilord Dec 13, 2024
8782377
added unit tests for smartsnippets
SimonMilord Dec 13, 2024
de5a9a0
renamed pageObject
SimonMilord Jan 8, 2025
af3009c
reverted smart snippet suggestions, will do in seperate PR
SimonMilord Jan 8, 2025
22e8a52
Merge branch 'master' into SFINT-5790
SimonMilord Jan 8, 2025
7825249
added unit tests for smart snippets
SimonMilord Jan 9, 2025
0c11359
Merge branch 'master' into SFINT-5790
SimonMilord Jan 9, 2025
c74803a
Merge branch 'SFINT-5790' of https://github.com/coveo/ui-kit into SFI…
SimonMilord Jan 9, 2025
eb6785f
added mocking for response
SimonMilord Jan 9, 2025
322bf45
added tests and added stuff in the pageObject
SimonMilord Jan 10, 2025
3c1329a
added smart snippets e2e tests
SimonMilord Jan 13, 2025
030bdb3
few changes
SimonMilord Jan 13, 2025
10e47e2
skip two tests
SimonMilord Jan 13, 2025
10839fd
Merge branch 'master' into SFINT-5790
SimonMilord Jan 13, 2025
ed904b9
Merge branch 'master' into SFINT-5790
SimonMilord Jan 13, 2025
9b5bf7c
Merge branch 'master' into SFINT-5790
SimonMilord Jan 14, 2025
329e5be
some minor feedback, removed extra cypress selectors
SimonMilord Jan 16, 2025
87b69e8
restructured the test structure
SimonMilord Jan 16, 2025
6775e52
added jira
SimonMilord Jan 16, 2025
8f53163
Merge branch 'master' into SFINT-5790
SimonMilord Jan 16, 2025
7e7390a
fix failing unit test
SimonMilord Jan 16, 2025
5e2e740
fixed linter issue
SimonMilord Jan 16, 2025
7e53dc3
Merge branch 'SFINT-5790' of https://github.com/coveo/ui-kit into SFI…
SimonMilord Jan 16, 2025
f7e7185
fixed cypress tests
SimonMilord Jan 16, 2025
2b532bb
Merge branch 'master' into SFINT-5790
SimonMilord Jan 16, 2025
5027450
Merge branch 'master' into SFINT-5790
erocheleau Jan 16, 2025
983f2bf
ran lint fix
SimonMilord Jan 17, 2025
aa4282a
fix failing quanticTabBar test
SimonMilord Jan 17, 2025
f0d1786
Merge branch 'master' into SFINT-5790
SimonMilord Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export const GeneratedAnswerSelectors: GeneratedAnswerSelector = {
GeneratedAnswerSelectors.get().find('[data-cy="generated-answer__answer"]'),
likeButton: () =>
GeneratedAnswerSelectors.get().find(
'[data-cy="generated-answer__feedback"] c-quantic-stateful-button[data-cy="feedback__like-button"] button'
'[data-cy="generated-answer__feedback"] c-quantic-stateful-button[data-testid="feedback__like-button"] button'
),
dislikeButton: () =>
GeneratedAnswerSelectors.get().find(
'[data-cy="generated-answer__feedback"] c-quantic-stateful-button[data-cy="feedback__dislike-button"] button'
'[data-cy="generated-answer__feedback"] c-quantic-stateful-button[data-testid="feedback__dislike-button"] button'
),
citations: () =>
GeneratedAnswerSelectors.get().find(
Expand Down Expand Up @@ -84,7 +84,7 @@ export const GeneratedAnswerSelectors: GeneratedAnswerSelector = {
),
feedbackCancelButton: () =>
GeneratedAnswerSelectors.feedbackModal().find(
'[data-cy="feedback-modal-footer__cancel"]'
'[data-testid="feedback-modal-footer__cancel"]'
),
feedbackDoneButton: () =>
GeneratedAnswerSelectors.feedbackModal().find(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export const SmartSnippetSuggestionsSelectors: SmartSnippetSuggestionsSelector =
.eq(index),
smartSnippetSuggestionsSourceUri: (index: number) =>
SmartSnippetSuggestionsSelectors.get()
.find('[data-cy="smart-snippet__source-uri"]')
.find('[data-testid="smart-snippet__source-uri"]')
.eq(index),
smartSnippetSuggestionsSourceTitle: (index: number) =>
SmartSnippetSuggestionsSelectors.get()
.find('[data-cy="smart-snippet__source-title"]')
.find('[data-testid="smart-snippet__source-title"]')
.eq(index),
smartSnippetSuggestionsInlineLink: (index: number) =>
SmartSnippetSuggestionsSelectors.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ export const SmartSnippetSelectors: SmartSnippetSelector = {
smartSnippetAnswer: () =>
SmartSnippetSelectors.get().find('[data-cy="smart-snippet-answer"]'),
smartSnippetSourceUri: () =>
SmartSnippetSelectors.get().find('[data-cy="smart-snippet__source-uri"]'),
SmartSnippetSelectors.get().find(
'[data-testid="smart-snippet__source-uri"]'
),
smartSnippetSourceTitle: () =>
SmartSnippetSelectors.get().find('[data-cy="smart-snippet__source-title"]'),
SmartSnippetSelectors.get().find(
'[data-testid="smart-snippet__source-title"]'
),
smartSnippetAnswerToggle: () =>
SmartSnippetSelectors.get().find('[data-cy="smart-snippet-answer-toggle"]'),
SmartSnippetSelectors.get().find(
'[data-testid="smart-snippet__toggle-button"]'
),
smartSnippetExpandableAnswer: () =>
SmartSnippetSelectors.get().find(
'[data-cy="expandable-smart-snippet-answer"]'
Expand All @@ -45,19 +51,25 @@ export const SmartSnippetSelectors: SmartSnippetSelector = {
'[data-cy="smart-snippet__inline-link"] > a'
),
smartSnippetLikeButton: () =>
SmartSnippetSelectors.get().find('[data-cy="feedback__like-button"]'),
SmartSnippetSelectors.get().find('[data-testid="feedback__like-button"]'),
smartSnippetDislikeButton: () =>
SmartSnippetSelectors.get().find('[data-cy="feedback__dislike-button"]'),
SmartSnippetSelectors.get().find(
'[data-testid="feedback__dislike-button"]'
),
smartSnippetExplainWhyButton: () =>
SmartSnippetSelectors.get().find(
'[data-cy="feedback__explain-why-button"]'
'[data-testid="feedback__explain-why-button"]'
),
feedbackOption: (index: number) =>
cy.get('lightning-modal').find('lightning-radio-group input').eq(index),
feedbackSubmitButton: () =>
cy.get('lightning-modal').find('[data-cy="feedback-modal-footer__submit"]'),
cy
.get('lightning-modal')
.find('[data-testid="feedback-modal-footer__submit"]'),
feedbackCancelButton: () =>
cy.get('lightning-modal').find('[data-cy="feedback-modal-footer__cancel"]'),
cy
.get('lightning-modal')
.find('[data-testid="feedback-modal-footer__cancel"]'),
feedbackDoneButton: () =>
cy.get('lightning-modal').find('[data-cy="feedback-modal-footer__done"]'),
feedbackDetailsInput: () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jest.mock(

const selectors = {
feedbackQuestion: '.feedback__question',
likeButton: 'c-quantic-stateful-button[data-cy="feedback__like-button"]',
likeButton: 'c-quantic-stateful-button[data-testid="feedback__like-button"]',
dislikeButton:
'c-quantic-stateful-button[data-cy="feedback__dislike-button"]',
'c-quantic-stateful-button[data-testid="feedback__dislike-button"]',
successMessage: '.feedback__success-message',
explainWhyButton: '.feedback__explain-why',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
<div class="slds-grid feedback__main-section">
<span class="slds-var-p-right_small slds-text-color_weak feedback__question"
id="feedback__question">{question}</span>
<c-quantic-stateful-button selected={liked} data-cy="feedback__like-button" tooltip={likeLabel}
<c-quantic-stateful-button selected={liked} data-testid="feedback__like-button" tooltip={likeLabel}
icon-name={likeIconName} onquantic__select={handleLike} onquantic__deselect={handleLike} without-borders selected-state-color="#2e844a"
label={likeButtonLabel} icon-size={size}></c-quantic-stateful-button>
<c-quantic-stateful-button selected={disliked} data-cy="feedback__dislike-button" tooltip={dislikeLabel}
<c-quantic-stateful-button selected={disliked} data-testid="feedback__dislike-button" tooltip={dislikeLabel}
icon-name={dislikeIconName} onquantic__select={handleDislike} onquantic__deselect={handleDislike} without-borders selected-state-color="#ea001e"
label={dislikeButtonLabel} icon-size={size}></c-quantic-stateful-button>
</div>
<template if:true={displaySuccessMessage}>
<div class="slds-grid feedback__success-message">
<span class="slds-var-p-vertical_x-small">{successMessage}</span>
<template if:false={hideExplainWhyButton}>
<lightning-button data-cy="feedback__explain-why-button" class="slds-var-m-left_x-small feedback__explain-why"
<lightning-button data-testid="feedback__explain-why-button" class="slds-var-m-left_x-small feedback__explain-why"
variant="base" label={labels.explainWhy} onclick={handlePressExplainWhyButton}></lightning-button>
</template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div data-cy="feedback-modal-body__error" class="error-message slds-text-color_destructive">{error}</div>
</lightning-modal-body>
<lightning-modal-footer>
<lightning-button data-cy="feedback-modal-footer__cancel" class="slds-button" variant="neutral"
<lightning-button data-testid="feedback-modal-footer__cancel" class="slds-button" variant="neutral"
label={labels.cancel} onclick={closeModal}></lightning-button>
</lightning-modal-footer>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
</div>
</lightning-modal-body>
<lightning-modal-footer>
<lightning-button data-cy="feedback-modal-footer__cancel" class="slds-button" variant="neutral" label={labels.cancel}
<lightning-button data-testid="feedback-modal-footer__cancel" class="slds-button" variant="neutral" label={labels.cancel}
onclick={closeModal}></lightning-button>
<lightning-button data-cy="feedback-modal-footer__submit" class="slds-button slds-m-left_x-small feedback-modal-footer__submit" variant="brand"
<lightning-button data-testid="feedback-modal-footer__submit" class="slds-button slds-m-left_x-small feedback-modal-footer__submit" variant="brand"
label={labels.sendFeedback} onclick={handleSubmitFeedback}></lightning-button>
</lightning-modal-footer>
</template>
Expand Down
Loading
Loading