From 43b4fa68ca88e6d9e4a55ff049c4d3c82b885817 Mon Sep 17 00:00:00 2001 From: Jialiang Liang Date: Wed, 8 May 2024 20:15:25 -0700 Subject: [PATCH] Skip datasources tests for managed service run (#1297) Signed-off-by: Ryan Liang --- .../7_datasources_dashboard.spec.js | 98 ++++++++++--------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/cypress/integration/plugins/observability-dashboards/7_datasources_dashboard.spec.js b/cypress/integration/plugins/observability-dashboards/7_datasources_dashboard.spec.js index 33bc4ec3f..16ccffb10 100644 --- a/cypress/integration/plugins/observability-dashboards/7_datasources_dashboard.spec.js +++ b/cypress/integration/plugins/observability-dashboards/7_datasources_dashboard.spec.js @@ -25,52 +25,54 @@ const visitDatasourcesCreationPage = () => { cy.visit(BASE_PATH + DATASOURCES_PATH.DATASOURCES_CREATION_BASE); }; -describe('Integration tests for datasources plugin', () => { - it('Navigates to datasources plugin and expects the correct header', () => { - visitDatasourcesHomePage(); - cy.get('[data-test-subj="dataconnections-header"]', { - timeout: 120000, - }).should('exist'); +if (!Cypress.env('MANAGED_SERVICE_ENDPOINT')) { + describe('Integration tests for datasources plugin', () => { + it('Navigates to datasources plugin and expects the correct header', () => { + visitDatasourcesHomePage(); + cy.get('[data-test-subj="dataconnections-header"]', { + timeout: 120000, + }).should('exist'); + }); + + it('Tests navigation between tabs', () => { + visitDatasourcesHomePage(); + + cy.get(manageDataSourcesTag) + .should('have.class', 'euiTab-isSelected') + .and('have.attr', 'aria-selected', 'true'); + cy.get(manageDataSourcesTag).click(); + cy.url().should('include', '/manage'); + + cy.get(newDataSourcesTag).click(); + cy.get(newDataSourcesTag) + .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'); + }); + + it('Tests navigation of S3 datasources creation page with hash', () => { + visitDatasourcesCreationPage(); + + cy.get(createS3Button).should('be.visible').click(); + cy.url().should('include', 'configure/AmazonS3AWSGlue'); + + cy.get('h1.euiTitle.euiTitle--medium') + .should('be.visible') + .and('contain', 'Configure Amazon S3 data source'); + }); + + it('Tests navigation of Prometheus datasources creation page with hash', () => { + visitDatasourcesCreationPage(); + + cy.get(createPrometheusButton).should('be.visible').click(); + cy.url().should('include', 'configure/Prometheus'); + + cy.get('h4.euiTitle.euiTitle--medium') + .should('be.visible') + .and('contain', 'Configure Prometheus data source'); + }); }); - - it('Tests navigation between tabs', () => { - visitDatasourcesHomePage(); - - cy.get(manageDataSourcesTag) - .should('have.class', 'euiTab-isSelected') - .and('have.attr', 'aria-selected', 'true'); - cy.get(manageDataSourcesTag).click(); - cy.url().should('include', '/manage'); - - cy.get(newDataSourcesTag).click(); - cy.get(newDataSourcesTag) - .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'); - }); - - it('Tests navigation of S3 datasources creation page with hash', () => { - visitDatasourcesCreationPage(); - - cy.get(createS3Button).should('be.visible').click(); - cy.url().should('include', 'configure/AmazonS3AWSGlue'); - - cy.get('h1.euiTitle.euiTitle--medium') - .should('be.visible') - .and('contain', 'Configure Amazon S3 data source'); - }); - - it('Tests navigation of Prometheus datasources creation page with hash', () => { - visitDatasourcesCreationPage(); - - cy.get(createPrometheusButton).should('be.visible').click(); - cy.url().should('include', 'configure/Prometheus'); - - cy.get('h4.euiTitle.euiTitle--medium') - .should('be.visible') - .and('contain', 'Configure Prometheus data source'); - }); -}); +}