Skip to content

Commit

Permalink
e2e: added tests for compare feature (#284)
Browse files Browse the repository at this point in the history
* e2e/medium_priority_compare_tests: added tests for compare feature

* e2e/medium_priority_compare_tests: fixed like/dislike element visibility; added clipboard permissions to config

* e2e/medium_priority_compare_tests: added index for chat message locator

* e2e/medium_priority_compare_tests: added random side selection for close compare mode test

* e2e/medium_priority_compare_tests: change request for flaky test

---------

Co-authored-by: Irina_Kartun <[email protected]>
Co-authored-by: Ilya Bondar <[email protected]>
  • Loading branch information
3 people authored Dec 11, 2023
1 parent b2d6a48 commit e81f3c9
Show file tree
Hide file tree
Showing 14 changed files with 809 additions and 228 deletions.
7 changes: 6 additions & 1 deletion e2e/config/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default defineConfig({
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'off',
screenshot: 'only-on-failure',
permissions: ['clipboard-read', 'clipboard-write'],
},
expect: {
timeout: 20000,
Expand All @@ -51,7 +52,11 @@ export default defineConfig({
},
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], storageState: STORAGE_STATE },
use: {
...devices['Desktop Chrome'],
storageState: STORAGE_STATE,
viewport: { width: 1536, height: 864 },
},
dependencies: ['setup'],
},

Expand Down
7 changes: 7 additions & 0 deletions e2e/src/testData/expectedConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const ExpectedConstants = {
backgroundColorPattern: /(rgba\(\d+,\s*\d+,\s*\d+),\s*\d+\.*\d+\)/,
sendMessageTooltip: 'Please type a message',
proceedReplayTooltip: 'Please continue replay to continue working with chat',
waitForAssistantAnswerTooltip:
'Please wait for full assistant answer to continue working with chat',
selectedPromptOptionAttribute: 'bg-blue-500/20',
noResults: 'No results found',
notAllowedModelError:
Expand Down Expand Up @@ -98,3 +100,8 @@ export enum ModelIds {
BISON_001 = 'chat-bison@001',
AWS_TITAN = 'amazon.titan-tg1-large',
}

export enum Rate {
like = 'like',
dislike = 'dislike',
}
5 changes: 5 additions & 0 deletions e2e/src/testData/expectedMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export enum ExpectedMessages {
sendMessageButtonEnabled = 'Send message button is enabled',
tooltipContentIsValid = 'Tooltip content is valid',
headerTitleCorrespondRequest = 'Chat header title correspond sent request',
headerTitleIsValid = 'Chat header title is valid',
headerIconsCountIsValid = 'Chat header icons number is valid',
headerCleanConversationIconVisible = 'Chat header Clean Conversation icon is visible',
headerIconEntityIsValid = 'Chat header icon entity is valid',
Expand Down Expand Up @@ -165,4 +166,8 @@ export enum ExpectedMessages {
replayAsIsDescriptionIsVisible = 'Replay as is description is visible',
replayOldVersionWarningIsVisible = 'Replay old version of DIAL conversation warning is displayed',
warningLabelColorIsValid = 'Warning label color is valid',
compareButtonIsDisabled = 'Chat bar Compare button is disabled',
closeChatIconIsNotVisible = 'Close chat icon is not visible',
chatMessageIsRated = 'Chat message was rated',
entityNameIsTruncated = 'Entity name is truncated',
}
Loading

0 comments on commit e81f3c9

Please sign in to comment.