From 6fd5882b5b0f581683e9b605fafaddbed6c7cfd0 Mon Sep 17 00:00:00 2001 From: saimedhi Date: Tue, 22 Oct 2024 17:06:20 -0700 Subject: [PATCH] Update flow framework dashboards test spec Signed-off-by: saimedhi --- .../create_workflow_spec.js | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/cypress/integration/plugins/dashboards-flow-framework/create_workflow_spec.js b/cypress/integration/plugins/dashboards-flow-framework/create_workflow_spec.js index 1f759a819..6eef9aee8 100644 --- a/cypress/integration/plugins/dashboards-flow-framework/create_workflow_spec.js +++ b/cypress/integration/plugins/dashboards-flow-framework/create_workflow_spec.js @@ -11,12 +11,13 @@ import { } from '../../../utils/constants'; import createConnectorBody from '../../../fixtures/plugins/dashboards-flow-framework/create_connector.json'; import registerModelBody from '../../../fixtures/plugins/dashboards-flow-framework/register_model.json'; -import { getLastPathSegment } from '../../../utils/plugins/dashboards-flow-framework/helpers'; +import { CURRENT_TENANT } from '../../../utils/commands'; describe('Creating Workflows Using Various Methods', () => { var modelId = ''; before(() => { + CURRENT_TENANT.newTenant = 'global'; cy.createConnector(createConnectorBody) .then((connectorResponse) => { return cy.registerModel({ @@ -34,14 +35,17 @@ describe('Creating Workflows Using Various Methods', () => { }); beforeEach(() => { - cy.visit(FF_URL.WORKFLOWS_NEW); - cy.url().should('include', getLastPathSegment(FF_URL.WORKFLOWS_NEW)); + CURRENT_TENANT.newTenant = 'global'; + cy.wait(20000); + cy.visit(FF_URL.WORKFLOWS, { timeout: FF_TIMEOUT }); }); it('create workflow using import', () => { + CURRENT_TENANT.newTenant = 'global'; + cy.wait(20000); cy.getElementByDataTestId('importWorkflowButton', { timeout: FF_TIMEOUT }) .should('be.visible') - .click(); + .click({ force: true }); cy.contains('Import a workflow (JSON/YAML)').should('be.visible'); const filePath = 'cypress/fixtures/' + @@ -64,7 +68,7 @@ describe('Creating Workflows Using Various Methods', () => { }); it('Workflow Creation with Improper Import File', () => { - cy.getElementByDataTestId('importWorkflowButton') + cy.getElementByDataTestId('importWorkflowButton', { timeout: FF_TIMEOUT }) .should('be.visible') .click(); cy.contains('Import a workflow (JSON/YAML)').should('be.visible'); @@ -79,13 +83,18 @@ describe('Creating Workflows Using Various Methods', () => { }); it('create workflow using Semantic Search template', () => { + cy.getElementByDataTestId('createWorkflowButton', { timeout: FF_TIMEOUT }) + .should('be.visible') + .click(); cy.contains('h3', 'Semantic Search', { timeout: FF_TIMEOUT }) .should('be.visible') .parents('.euiCard') .within(() => { cy.contains('button', 'Go').click(); }); - cy.getElementByDataTestId('optionalConfigurationButton') + cy.getElementByDataTestId('optionalConfigurationButton', { + timeout: FF_TIMEOUT, + }) .should('be.visible') .click(); cy.getElementByDataTestId('selectDeployedModel') @@ -102,7 +111,7 @@ describe('Creating Workflows Using Various Methods', () => { .should('be.visible') .click(); cy.url().should('include', '/workflows/'); - cy.getElementByDataTestId('editSourceDataButton') + cy.getElementByDataTestId('selectDataToImportButton') .should('be.visible') .click(); cy.getElementByDataTestId('uploadSourceDataButton') @@ -188,6 +197,9 @@ describe('Creating Workflows Using Various Methods', () => { }); it('create workflow using Sentiment Analysis template', () => { + cy.getElementByDataTestId('createWorkflowButton', { timeout: FF_TIMEOUT }) + .should('be.visible') + .click(); cy.contains('h3', 'Sentiment Analysis', { timeout: FF_TIMEOUT }) .should('be.visible') .parents('.euiCard') @@ -201,6 +213,9 @@ describe('Creating Workflows Using Various Methods', () => { }); it('create workflow using Hybrid Search template', () => { + cy.getElementByDataTestId('createWorkflowButton', { timeout: FF_TIMEOUT }) + .should('be.visible') + .click(); cy.contains('h3', 'Hybrid Search', { timeout: FF_TIMEOUT }) .should('be.visible') .parents('.euiCard') @@ -214,6 +229,9 @@ describe('Creating Workflows Using Various Methods', () => { }); it('create workflow using Multimodal Search template', () => { + cy.getElementByDataTestId('createWorkflowButton', { timeout: FF_TIMEOUT }) + .should('be.visible') + .click(); cy.contains('h3', 'Multimodal Search', { timeout: FF_TIMEOUT }) .should('be.visible') .parents('.euiCard') @@ -227,6 +245,9 @@ describe('Creating Workflows Using Various Methods', () => { }); it('create workflow using Retrieval-Augmented Generation (RAG) template', () => { + cy.getElementByDataTestId('createWorkflowButton', { timeout: FF_TIMEOUT }) + .should('be.visible') + .click(); cy.contains('h3', 'Retrieval-Augmented Generation (RAG)', { timeout: FF_TIMEOUT, })