diff --git a/.github/workflows/assistant-release-e2e-workflow.yml b/.github/workflows/assistant-release-e2e-workflow.yml index 41568dd5f..952fd4cdd 100644 --- a/.github/workflows/assistant-release-e2e-workflow.yml +++ b/.github/workflows/assistant-release-e2e-workflow.yml @@ -21,5 +21,5 @@ jobs: uses: ./.github/workflows/release-e2e-workflow-template.yml with: test-name: dashboards assistant - test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/dashboards-assistant/*' + test-command: env CYPRESS_DASHBOARDS_ASSISTANT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/dashboards-assistant/*' osd-serve-args: --assistant.chat.enabled=true --assistant.chat.rootAgentName="Cypress test agent" diff --git a/cypress.json b/cypress.json index 9de868129..2b6abb7db 100644 --- a/cypress.json +++ b/cypress.json @@ -20,6 +20,7 @@ "VISBUILDER_ENABLED": true, "DATASOURCE_MANAGEMENT_ENABLED": false, "ML_COMMONS_DASHBOARDS_ENABLED": true, - "WAIT_FOR_LOADER_BUFFER_MS": 0 + "WAIT_FOR_LOADER_BUFFER_MS": 0, + "DASHBOARDS_ASSISTANT_ENABLED": false } } 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 3cdb96612..1bb3cb83f 100644 --- a/cypress/integration/plugins/dashboards-assistant/chatbot_agent_framework_spec.js +++ b/cypress/integration/plugins/dashboards-assistant/chatbot_agent_framework_spec.js @@ -4,49 +4,51 @@ */ import { BASE_PATH } from '../../../utils/constants'; -describe('Assistant basic spec', () => { - before(() => { - // Set welcome screen tracking to false - localStorage.setItem('home:welcome:show', 'false'); - // Set new theme modal to false - localStorage.setItem('home:newThemeModal:show', 'false'); - - cy.addAssistantRequiredSettings(); - cy.registerRootAgent(); - cy.startDummyServer(); - }); +if (Cypress.env('DASHBOARDS_ASSISTANT_ENABLED')) { + describe('Assistant basic spec', () => { + before(() => { + // Set welcome screen tracking to false + localStorage.setItem('home:welcome:show', 'false'); + // Set new theme modal to false + localStorage.setItem('home:newThemeModal:show', 'false'); + + cy.addAssistantRequiredSettings(); + cy.registerRootAgent(); + cy.startDummyServer(); + }); - beforeEach(() => { - // Visit ISM OSD - cy.visit(`${BASE_PATH}/app/home`); + beforeEach(() => { + // Visit ISM OSD + cy.visit(`${BASE_PATH}/app/home`); - // Common text to wait for to confirm page loaded, give up to 60 seconds for initial load - cy.get(`input[placeholder="Ask question"]`, { timeout: 60000 }).should( - 'be.length', - 1 - ); - }); + // Common text to wait for to confirm page loaded, give up to 60 seconds for initial load + cy.get(`input[placeholder="Ask question"]`, { timeout: 60000 }).should( + 'be.length', + 1 + ); + }); - describe('Interact with Agent framework', () => { - it('toggle Chatbot and enable to interact', () => { - // enable to toggle and show Chatbot - cy.get(`img[aria-label="toggle chat flyout icon"]`).click(); + describe('Interact with Agent framework', () => { + it('toggle Chatbot and enable to interact', () => { + // enable to toggle and show Chatbot + cy.get(`img[aria-label="toggle chat flyout icon"]`).click(); - // click suggestions to generate response - cy.contains('What are the indices in my cluster?').click(); + // click suggestions to generate response + cy.contains('What are the indices in my cluster?').click(); - // should have a LLM Response - 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 LLM Response + 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); + // should have a suggestion section + cy.get(`[aria-label="chat suggestions"]`).should('be.length', 1); + }); }); - }); - after(() => { - cy.cleanRootAgent(); - cy.stopDummyServer(); + after(() => { + cy.cleanRootAgent(); + cy.stopDummyServer(); + }); }); -}); +}