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

Update flow framework dashboards test spec #1599

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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/' +
Expand All @@ -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');
Expand All @@ -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')
Expand All @@ -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')
Expand Down Expand Up @@ -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')
Expand All @@ -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')
Expand All @@ -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')
Expand All @@ -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,
})
Expand Down
Loading