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 82e26c306..3999826f2 100644 --- a/cypress/integration/plugins/dashboards-assistant/chatbot_agent_framework_spec.js +++ b/cypress/integration/plugins/dashboards-assistant/chatbot_agent_framework_spec.js @@ -39,6 +39,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); }); }); });