Skip to content

Commit

Permalink
Switch to capitalized naming
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <[email protected]>
  • Loading branch information
RyanL1997 committed Jan 10, 2024
1 parent ec90078 commit 1a1957d
Showing 1 changed file with 15 additions and 25 deletions.
40 changes: 15 additions & 25 deletions .cypress/integration/datasources_test/datasources_basic_ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {
FONTEND_BASE_PATH,
DATASOURCES_API_PREFIX,
DATASOURCES_PATH,
} from '../../utils/constants'
import { FONTEND_BASE_PATH, DATASOURCES_API_PREFIX, DATASOURCES_PATH } from '../../utils/constants';

const manageDataSourcesTag = 'button[data-test-subj="manage"]';
const newDataSourcesTag = 'button[data-test-subj="new"]';
const createS3Button = '[data-test-subj="datasource_card_s3glue"]';
const createPrometheusButton = '[data-test-subj="datasource_card_prometheus"]';
const MANAGE_DATASOURCES_TAG = 'button[data-test-subj="manage"]';
const NEW_DATASOURCES_TAG = 'button[data-test-subj="new"]';
const CREATE_S3_BUTTON = '[data-test-subj="datasource_card_s3glue"]';
const CREATE_PROMETHEUS_BUTTON = '[data-test-subj="datasource_card_prometheus"]';

const visitDatasourcesHomePage = () => {
cy.visit(FONTEND_BASE_PATH + DATASOURCES_API_PREFIX);
Expand All @@ -31,30 +27,27 @@ describe('Integration tests for datasources plugin', () => {
it('Tests navigation between tabs', () => {
visitDatasourcesHomePage();

cy.get(manageDataSourcesTag)
cy.get(MANAGE_DATASOURCES_TAG)
.should('have.class', 'euiTab-isSelected')
.and('have.attr', 'aria-selected', 'true');
cy.get(manageDataSourcesTag).click();
cy.get(MANAGE_DATASOURCES_TAG).click();
cy.url().should('include', '/manage');

cy.get(newDataSourcesTag).click();
cy.get(newDataSourcesTag)
cy.get(NEW_DATASOURCES_TAG).click();
cy.get(NEW_DATASOURCES_TAG)
.should('have.class', 'euiTab-isSelected')
.and('have.attr', 'aria-selected', 'true');
cy.url().should('include', '/new');

cy.get(createS3Button).should('be.visible');
cy.get(createPrometheusButton).should('be.visible');
cy.get(CREATE_S3_BUTTON).should('be.visible');
cy.get(CREATE_PROMETHEUS_BUTTON).should('be.visible');
});

it('Tests navigation of S3 datasources creation page with hash', () => {
visitDatasourcesCreationPage();

cy.get(createS3Button).should('be.visible').click();
cy.url().should(
'include',
DATASOURCES_PATH.DATASOURCES_CONFIG_BASE + '/AmazonS3AWSGlue'
);
cy.get(CREATE_S3_BUTTON).should('be.visible').click();
cy.url().should('include', DATASOURCES_PATH.DATASOURCES_CONFIG_BASE + '/AmazonS3AWSGlue');

cy.get('h1.euiTitle.euiTitle--medium')
.should('be.visible')
Expand All @@ -64,11 +57,8 @@ describe('Integration tests for datasources plugin', () => {
it('Tests navigation of Prometheus datasources creation page with hash', () => {
visitDatasourcesCreationPage();

cy.get(createPrometheusButton).should('be.visible').click();
cy.url().should(
'include',
DATASOURCES_PATH.DATASOURCES_CONFIG_BASE + '/Prometheus'
);
cy.get(CREATE_PROMETHEUS_BUTTON).should('be.visible').click();
cy.url().should('include', DATASOURCES_PATH.DATASOURCES_CONFIG_BASE + '/Prometheus');

cy.get('h4.euiTitle.euiTitle--medium')
.should('be.visible')
Expand Down

0 comments on commit 1a1957d

Please sign in to comment.