From c9197798eebfbf274ea01cdb9d00ff8eff341dbd Mon Sep 17 00:00:00 2001 From: "Qingyang(Abby) Hu" Date: Tue, 27 Feb 2024 15:16:34 -0800 Subject: [PATCH] Revert "fixed failed discover app shared links tests (#1079)" This reverts commit 3a98fe6bd54d4d35e8f43110fe55c0d57dc1e873. --- .../apps/data_explorer/shared_links.spec.js | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js index e1def423c..61b9ae7f9 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js @@ -26,6 +26,7 @@ const indexSet = [ describe('shared links', () => { before(() => { + CURRENT_TENANT.newTenant = 'global'; testFixtureHandler.importJSONMapping( 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/discover/discover.mappings.json.txt' ); @@ -44,19 +45,16 @@ describe('shared links', () => { cy.setAdvancedSetting({ defaultIndex: 'logstash-*', }); + + miscUtils.visitPage('app/data-explorer/discover#/'); + cy.waitForLoader(); + cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); + cy.waitForSearch(); }); describe('shared links with state in query', () => { - beforeEach(() => { - CURRENT_TENANT.newTenant = 'global'; - miscUtils.visitPage('app/data-explorer/discover#/'); - cy.waitForLoader(); - cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); - cy.waitForSearch(); - }); - it('should allow for copying the snapshot URL', function () { - const url = `http://localhost:5601/app/data-explorer/discover?security_tenant=global#/?_a=(discover:(columns:!(_source),isDirty:!f,sort:!()),metadata:(indexPattern:'logstash-*',view:discover))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))&_q=(filters:!(),query:(language:kuery,query:''))`; + const url = `http://localhost:5601/app/data-explorer/discover#/?_a=(discover:(columns:!(_source),isDirty:!f,sort:!()),metadata:(indexPattern:'logstash-*',view:discover))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))&_q=(filters:!(),query:(language:kuery,query:''))`; cy.getElementByTestId('shareTopNavButton').should('be.visible').click(); cy.getElementByTestId('copyShareUrlButton') .invoke('attr', 'data-share-url') @@ -68,7 +66,6 @@ describe('shared links', () => { }); it('should allow for copying the snapshot URL as a short URL', function () { - cy.getElementByTestId('shareTopNavButton').should('be.visible').click(); cy.getElementByTestId('useShortUrl') .should('be.visible') .invoke('attr', 'aria-checked', 'true'); @@ -79,11 +76,9 @@ describe('shared links', () => { }); it('should allow for copying the saved object URL', function () { - const url = decodeURI( - 'http://localhost:5601/app/data-explorer/discover/#/view/ab12e3c0-f231-11e6-9486-733b1ac9221a?_g=%28filters%3A%21%28%29%2CrefreshInterval%3A%28pause%3A%21t%2Cvalue%3A0%29%2Ctime%3A%28from%3A%272015-09-19T13%3A31%3A44.000Z%27%2Cto%3A%272015-09-24T01%3A31%3A44.000Z%27%29%29' - ); + const url = + 'http://localhost:5601/app/data-explorer/discover/#/view/ab12e3c0-f231-11e6-9486-733b1ac9221a?_g=%28filters%3A%21%28%29%2CrefreshInterval%3A%28pause%3A%21t%2Cvalue%3A0%29%2Ctime%3A%28from%3A%272015-09-19T13%3A31%3A44.000Z%27%2Cto%3A%272015-09-24T01%3A31%3A44.000Z%27%29%29'; - cy.getElementByTestId('shareTopNavButton').should('be.visible').click(); cy.getElementByTestId('exportAsSavedObject') .get('.euiRadio__input') .should('be.disabled'); @@ -108,10 +103,7 @@ describe('shared links', () => { cy.setAdvancedSetting({ 'state:storeInSessionStorage': true, }); - }); - beforeEach(() => { - CURRENT_TENANT.newTenant = 'global'; miscUtils.visitPage('app/data-explorer/discover#/'); cy.waitForLoader(); cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); @@ -135,7 +127,6 @@ describe('shared links', () => { }); it('should allow for copying the snapshot URL as a short URL', function () { - cy.getElementByTestId('shareTopNavButton').should('be.visible').click(); cy.getElementByTestId('useShortUrl').should('be.visible').click(); cy.getElementByTestId('copyShareUrlButton') .invoke('attr', 'data-share-url') @@ -146,7 +137,6 @@ describe('shared links', () => { }); it('should allow for copying the saved object URL', function () { - cy.getElementByTestId('shareTopNavButton').should('be.visible').click(); cy.getElementByTestId('exportAsSavedObject') .get('.euiRadio__input') .should('be.disabled');