Skip to content

Commit

Permalink
[MD] datasource edit/update page functional tests (#341)
Browse files Browse the repository at this point in the history
Signed-off-by: mpabba3003 <[email protected]>

Signed-off-by: mpabba3003 <[email protected]>
  • Loading branch information
mpabba3003 authored Oct 19, 2022
1 parent 7755b38 commit 994904f
Show file tree
Hide file tree
Showing 5 changed files with 673 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-tes
import {
OSD_TEST_DOMAIN_ENDPOINT_URL,
OSD_INVALID_ENPOINT_URL,
} from '../../../../utils/dashboards/datasource-management-dashboards-plugin/cosntants';
} from '../../../../utils/dashboards/datasource-management-dashboards-plugin/constants';

const miscUtils = new MiscUtils(cy);
// Get environment variables
Expand All @@ -23,6 +23,11 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
);
});

after(() => {
// Clean up after all test are run
cy.deleteAllDataSources();
});

it('should successfully load the page', () => {
cy.contains(
'Create a new data source connection to help you retrieve data from an external OpenSearch compatible source.',
Expand All @@ -31,9 +36,7 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
});

it('should successfully show the experimental feature callout', () => {
cy.get('[data-test-subj="data-source-experimental-call"]').should(
'exist'
);
cy.getElementByTestId('data-source-experimental-call').should('exist');
});

describe('Datasource can be created successfully', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { TIMEOUT_OPTS } from '../../../../utils/dashboards/datasource-management-dashboards-plugin/constants';

const searchFieldIdentifier = 'input[type="search"]';
const tableHeadIdentifier = 'thead > tr > th';

Expand All @@ -21,15 +23,13 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
it('should successfully load the page', () => {
cy.contains(
'Create and manage data source connections to help you retrieve data from multiple OpenSearch compatible sources.',
{ timeout: 60000 }
TIMEOUT_OPTS
);
});

/* Experimental Callout */
it('should display experimental call out', () => {
cy.get('[data-test-subj="data-source-experimental-call"]').should(
'exist'
);
cy.getElementByTestId('data-source-experimental-call').should('exist');
});

describe('Empty State', () => {
Expand Down
Loading

0 comments on commit 994904f

Please sign in to comment.