From 88ea483820907b206db7d826c2e0eb898e44b3e7 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Fri, 2 Feb 2024 15:00:56 +0800 Subject: [PATCH] feat: add regenerate cases (#1027) * feat: add regenerate cases Signed-off-by: SuZhou-Joe * feat: optimize cases Signed-off-by: SuZhou-Joe --------- Signed-off-by: SuZhou-Joe (cherry picked from commit ad6faec0038c1fd6bf27a9e36343edd1ffd02cc0) --- .../chatbot_agent_framework_spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cypress/integration/plugins/dashboards-assistant/chatbot_agent_framework_spec.js b/cypress/integration/plugins/dashboards-assistant/chatbot_agent_framework_spec.js index b64408817..6e24d1b69 100644 --- a/cypress/integration/plugins/dashboards-assistant/chatbot_agent_framework_spec.js +++ b/cypress/integration/plugins/dashboards-assistant/chatbot_agent_framework_spec.js @@ -42,6 +42,23 @@ if (Cypress.env('DASHBOARDS_ASSISTANT_ENABLED')) { // should have a suggestion section cy.get(`[aria-label="chat suggestions"]`).should('be.length', 1); + + // Click regenerate button + cy.get(`button[title="regenerate message"]`).click(); + + // The previous message and the regenerate button should be gone + cy.get(`button[title="regenerate message"]`).should('be.length', 0); + + // suggestions should be gone + cy.get(`[aria-label="chat suggestions"]`).should('be.length', 0); + + // The regenrate message should be there + cy.contains( + 'The indices in your cluster are the names listed in the response obtained from using a tool to get information about the OpenSearch indices.' + ); + + // should have a suggestion section + cy.get(`[aria-label="chat suggestions"]`).should('be.length', 1); }); }); });