Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 24 additions & 2 deletions .cypress/integration/10_datasources.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,38 @@
*/

/// <reference types="cypress" />


const moveToDatasourcesHome = () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/dataconnections`);
cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources`);
};

const moveToNewDatasourcesPage = () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources#/new`);
};

const moveToCreatePrometheusDatasourcePage = () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources#/configure/PROMETHEUS`);
};

describe('Basic sanity test for datasources plugin', () => {
describe('Integration tests for datasources plugin', () => {
const testPrometheusSuffix = (Math.random() + 1).toString(36).substring(7);
const testPrometheusInstance = `Prometheus_${testPrometheusSuffix}`;
const testS3Suffix = (Math.random() + 1).toString(36).substring(7);
const testS3Instance = `S3_${testS3Suffix}`;
it('Navigates to datasources plugin and expects the correct header', () => {
moveToDatasourcesHome();
cy.get('[data-test-subj="dataconnections-header"]').should('exist');
});

it('Tests navigation between tabs and goes to Prometheus creation flow', () => {
moveToDatasourcesHome();
cy.get('[data-test-subj="new"]').click();
cy.url().should('include', '/new')
cy.get('[data-test-subj="datasource_card_prometheus"]').click();
cy.url().should('include', '/configure/PROMETHEUS');
});

});


Expand Down
12 changes: 10 additions & 2 deletions common/constants/data_connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
* SPDX-License-Identifier: Apache-2.0
*/

export const OPENSEARCH_DOCUMENTATION_URL =
'https://opensearch.org/docs/latest/data-connections/index';
import { DatasourceType } from '../../common/types/data_connections';

export const OPENSEARCH_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/data-sources/index';

export const QUERY_RESTRICTED = 'query-restricted';
export const QUERY_ALL = 'query-all';

export const DatasourceTypeToDisplayName: { [key in DatasourceType]: string } = {
PROMETHEUS: 'Prometheus',
S3GLUE: 'S3',
};

export type AuthMethod = 'noauth' | 'basicauth' | 'awssigv4';
2 changes: 1 addition & 1 deletion common/types/data_connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export interface PermissionsConfigurationProps {

export type Role = EuiComboBoxOptionOption;

export type DatasourceType = 'SPARK' | 'S3GLUE' | 'OPENSEARCH' | 'PROMETHEUS';
export type DatasourceType = 'S3GLUE' | 'PROMETHEUS';
Loading