Skip to content

Commit

Permalink
Add containsModels param to handle custom/empty template (#1713) (#1716)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
(cherry picked from commit 2b57298)

Co-authored-by: Tyler Ohlsen <ohltyler@amazon.com>
  • Loading branch information
opensearch-trigger-bot[bot] and ohltyler authored Feb 13, 2025
1 parent 42c9db3 commit 9741e9d
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ describe('Creating Workflows Using Various Methods', () => {
});

it('Create workflow from hybrid search template', () => {
createPreset('Hybrid Search');
createPreset('Hybrid Search', true);
});

it('Create workflow from multimodal template', () => {
createPreset('Multimodal Search');
createPreset('Multimodal Search', true);
});

it('Create workflow from custom template', () => {
createPreset('Custom Search');
createPreset('Custom Search', false);
});

after(() => {
Expand All @@ -188,7 +188,7 @@ describe('Creating Workflows Using Various Methods', () => {
});

// Reusable fn to check the preset exists, and able to create it, and navigate to its details page.
function createPreset(presetName) {
function createPreset(presetName, containsModels = false) {
cy.getElementByDataTestId('createWorkflowButton', { timeout: FF_TIMEOUT })
.should('be.visible')
.click();
Expand All @@ -205,8 +205,12 @@ function createPreset(presetName) {
.clear()
.type(presetName.toLowerCase().replace(/\s/g, ''));
});
cy.getElementByDataTestId('selectDeployedModel').should('be.visible').click();
cy.get('.euiSuperSelect__item').contains('BedRock').click();
if (containsModels) {
cy.getElementByDataTestId('selectDeployedModel')
.should('be.visible')
.click();
cy.get('.euiSuperSelect__item').contains('BedRock').click();
}
cy.getElementByDataTestId('quickConfigureCreateButton')
.should('be.visible')
.click();
Expand Down

0 comments on commit 9741e9d

Please sign in to comment.