-
Notifications
You must be signed in to change notification settings - Fork 113
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: add test cases for assistant conversation history #1010
feat: add test cases for assistant conversation history #1010
Conversation
Signed-off-by: Lin Wang <[email protected]>
conversations.forEach(({ conversationId }) => { | ||
cy.get( | ||
`div[data-test-subj="chatHistoryItem-${conversationId}"]` | ||
).should('exist'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conversations here should be an empty array, is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, this case should be moved under history item operations.
`div[data-test-subj="chatHistoryItem-${conversationId}"]` | ||
).should('exist'); | ||
}); | ||
cy.contains('What are the indices in my cluster?'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a conversation from basic_spec.js right? Maybe we should not test that in this spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is for waiting assistant has been loaded successfully. I think we can keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: conversation_history_spec.js
Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
// Set welcome screen tracking to false | ||
localStorage.setItem('home:welcome:show', 'false'); | ||
// Hide new theme modal | ||
localStorage.setItem('home:newThemeModal:show', 'false'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to get their current value first and then set the back to the original value after these tests are complete in case there are tests specific to these values.
); | ||
|
||
// Open chat flyout | ||
cy.get('body') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some of these look like we can add test subjects to the source code so that it is easier to find the values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step is for check if flyout already opened before. Since we are visiting a new page. I think we can remove this check logic here. The flyout
must be closed by default.
after(() => { | ||
// Clear created conversations in tests | ||
conversations.map(({ conversationId }) => | ||
cy.deleteConversation(conversationId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a bulk delete API that we can use? are will there be no need to implement that API.
@@ -152,3 +153,14 @@ Cypress.Commands.add('stopDummyServer', () => { | |||
} | |||
}); | |||
}); | |||
|
|||
Cypress.Commands.add('sendMessage', (body) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this be too generic? trying to think if there might be a time where we want to avoid a conflict but I believe assistant is the only thing with a message
or conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change to sendAssistantMessage
.
@wanglam could you check the failed tests in this workflow run? |
Signed-off-by: Lin Wang <[email protected]>
05e373a
to
4f6e751
Compare
@ruanyl Added 10s delayed, now the workflow fixed. |
cypress/integration/plugins/dashboards-assistant/conversation_history_spec.js
Outdated
Show resolved
Hide resolved
…stId Signed-off-by: Lin Wang <[email protected]>
* feat: add test cases for assistant conversation history Signed-off-by: Lin Wang <[email protected]> * feat: move created history test below Signed-off-by: Lin Wang <[email protected]> * rename coversation_history_spec to conversation_history_spec Signed-off-by: Lin Wang <[email protected]> * Address pr comments Signed-off-by: Lin Wang <[email protected]> * refactor: move setStorageItem to helpers and change to getElementByTestId Signed-off-by: Lin Wang <[email protected]> --------- Signed-off-by: Lin Wang <[email protected]> (cherry picked from commit b65c5de)
* feat: add test cases for assistant conversation history Signed-off-by: Lin Wang <[email protected]> * feat: move created history test below Signed-off-by: Lin Wang <[email protected]> * rename coversation_history_spec to conversation_history_spec Signed-off-by: Lin Wang <[email protected]> * Address pr comments Signed-off-by: Lin Wang <[email protected]> * refactor: move setStorageItem to helpers and change to getElementByTestId Signed-off-by: Lin Wang <[email protected]> --------- Signed-off-by: Lin Wang <[email protected]> (cherry picked from commit b65c5de) Co-authored-by: Lin Wang <[email protected]> Co-authored-by: Yulong Ruan <[email protected]>
Description
Add tests for conversation history, here is the local test video:
conversation_history_spec.js.mp4
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.