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

[Security assistant] Update converations.cy.ts #204404

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
RULE_MANAGEMENT_CONTEXT_DESCRIPTION,
} from '@kbn/security-solution-plugin/public/detections/pages/detection_engine/rules/translations';
import { EXPLAIN_THEN_SUMMARIZE_SUGGEST_INVESTIGATION_GUIDE_NON_I18N } from '@kbn/security-solution-plugin/public/assistant/content/prompts/user/translations';
import { NEW_CHAT } from '@kbn/elastic-assistant/impl/assistant/conversations/conversation_sidepanel/translations';
import {
assertConnectorSelected,
assertNewConversation,
Expand All @@ -19,7 +20,7 @@ import {
createNewChat,
selectConversation,
assertMessageSent,
assertConversationTitle,
assertNotConversationTitle,
typeAndSendMessage,
assertErrorResponse,
selectRule,
Expand Down Expand Up @@ -47,8 +48,7 @@ import {
} from '../../screens/ai_assistant';
import { visit, visitGetStartedPage } from '../../tasks/navigation';

// Failing: See https://github.com/elastic/kibana/issues/204167
describe.skip('AI Assistant Conversations', { tags: ['@ess', '@serverless'] }, () => {
describe('AI Assistant Conversations', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
deleteConnectors();
deleteConversations();
Expand Down Expand Up @@ -150,11 +150,11 @@ describe.skip('AI Assistant Conversations', { tags: ['@ess', '@serverless'] }, (
visitGetStartedPage();
openAssistant();
createNewChat();
assertNewConversation(false, 'New chat');
assertNewConversation(false, NEW_CHAT);
assertConnectorSelected(azureConnectorAPIPayload.name);
typeAndSendMessage('hello');
assertMessageSent('hello');
assertConversationTitle('Unexpected API Error: - Connection error.');
assertNotConversationTitle(NEW_CHAT);
updateConversationTitle('Something else');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ export const assertNewConversation = (isWelcome: boolean, title: string) => {
export const assertConversationTitle = (title: string) =>
cy.get(CONVERSATION_TITLE + ' h2').should('have.text', title);

export const assertNotConversationTitle = (title: string) =>
cy.get(CONVERSATION_TITLE + ' h2').should('not.have.text', title);

export const assertSystemPromptSent = (message: string) => {
cy.get(CONVERSATION_MESSAGE).eq(0).should('contain', message);
};
Expand Down