-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move search relevance card to search plugin (#1715)
Signed-off-by: yubonluo <yubonluo@amazon.com> Date: Wed Feb 12 10:08:40 2025 -0800
- Loading branch information
Showing
2 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
cypress/integration/plugins/search-relevance-dashboards/2_search_card.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
const workspaceName = `test_workspace_search_${Math.random() | ||
.toString(36) | ||
.substring(7)}`; | ||
let workspaceId; | ||
let datasourceId; | ||
|
||
if (Cypress.env('WORKSPACE_ENABLED')) { | ||
const createWorkspace = (datasourceId) => { | ||
cy.createWorkspace({ | ||
name: workspaceName, | ||
features: ['use-case-search'], | ||
settings: { | ||
permissions: { | ||
library_write: { users: ['%me%'] }, | ||
write: { users: ['%me%'] }, | ||
}, | ||
...(datasourceId ? { dataSources: [datasourceId] } : {}), | ||
}, | ||
}).then((value) => { | ||
workspaceId = value; | ||
}); | ||
}; | ||
|
||
describe('Search card', () => { | ||
before(() => { | ||
cy.deleteWorkspaceByName(workspaceName); | ||
if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) { | ||
cy.deleteAllDataSources(); | ||
cy.createDataSourceNoAuth().then((result) => { | ||
datasourceId = result[0]; | ||
expect(datasourceId).to.be.a('string').that.is.not.empty; | ||
createWorkspace(datasourceId); | ||
}); | ||
} else { | ||
createWorkspace(); | ||
} | ||
}); | ||
|
||
after(() => { | ||
if (workspaceId) { | ||
cy.deleteWorkspaceById(workspaceId); | ||
} | ||
cy.deleteAllDataSources(); | ||
}); | ||
|
||
beforeEach(() => { | ||
// Visit workspace overview page | ||
miscUtils.visitPage(`w/${workspaceId}/app/search_overview`); | ||
// wait for page load | ||
cy.contains('h1', 'Overview'); | ||
}); | ||
|
||
it('Configure and evaluate search cards should display correctly', () => { | ||
cy.contains('Compare search results').should('be.visible').click(); | ||
cy.url().should('contains', 'app/searchRelevance'); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters