From 2b9a2eb0845c8a2c7795ca7d6020fd14c85582f3 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Thu, 21 Dec 2023 12:08:28 -0800 Subject: [PATCH] Fix the datasources cypress tests Signed-off-by: Ryan Liang --- .../datasources_test/datasources.spec.js | 56 +++++++++---------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/.cypress/integration/datasources_test/datasources.spec.js b/.cypress/integration/datasources_test/datasources.spec.js index fdfe21b285..3c9ff64d6b 100644 --- a/.cypress/integration/datasources_test/datasources.spec.js +++ b/.cypress/integration/datasources_test/datasources.spec.js @@ -5,38 +5,34 @@ /// - - const moveToDatasourcesHome = () => { - cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources`); - }; +const moveToDatasourcesHome = () => { + cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources`); +}; - const moveToNewDatasourcesPage = () => { - cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources#/new`); - }; +// const moveToNewDatasourcesPage = () => { +// cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources#/new`); +// }; - const moveToCreatePrometheusDatasourcePage = () => { - cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources#/configure/PROMETHEUS`); - }; - - 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'); - }); +// const moveToCreatePrometheusDatasourcePage = () => { +// cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources#/configure/PROMETHEUS`); +// }; - 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'); - }); +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'); + }); +});