From 9edf60d6f398546de94de8e718498c85f2f4db7a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 16 Feb 2024 05:47:57 +0000 Subject: [PATCH] Nav menu length check (#295) (#295) Signed-off-by: Danila Gulderov (cherry picked from commit 58d52f71d19a8b96bbdf4f296d52e5a3ffecfc73) Signed-off-by: github-actions[bot] --- .cypress/integration/04-download.spec.ts | 8 ++++---- public/components/context_menu/context_menu.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.cypress/integration/04-download.spec.ts b/.cypress/integration/04-download.spec.ts index af7e6409..9bab9894 100644 --- a/.cypress/integration/04-download.spec.ts +++ b/.cypress/integration/04-download.spec.ts @@ -33,7 +33,7 @@ describe('Cypress', () => { // click Reporting in-context menu cy.get('#downloadReport > span:nth-child(1) > span:nth-child(1)').click({ force: true }); - // download PDF + // download PDF cy.get('#generatePDF > span:nth-child(1) > span:nth-child(2)').click({ force: true }); cy.get('#reportGenerationProgressModal'); @@ -59,7 +59,7 @@ describe('Cypress', () => { cy.wait(5000); // open saved search list - cy.get('button.euiButtonEmpty:nth-child(3) > span:nth-child(1) > span:nth-child(1)').click({ force: true }); + cy.get('[data-test-subj="discoverOpenButton"]').click({ force: true }); cy.wait(5000); // click first entry @@ -72,7 +72,7 @@ describe('Cypress', () => { }); it('Download from Report definition details page', () => { - // create an on-demand report definition + // create an on-demand report definition cy.visit(`${Cypress.env('opensearchDashboards')}/app/reports-dashboards#/`); cy.location('pathname', { timeout: 60000 }).should( @@ -81,7 +81,7 @@ describe('Cypress', () => { ); cy.wait(10000); - cy.get('tr.euiTableRow-isSelectable:nth-child(1) > td:nth-child(1) > div:nth-child(2) > button:nth-child(1)').first().click(); + cy.get('tr.euiTableRow-isSelectable:nth-child(1) > td:nth-child(1) > div:nth-child(2) > button:nth-child(1)').first().click(); cy.url().should('include', 'report_definition_details'); diff --git a/public/components/context_menu/context_menu.js b/public/components/context_menu/context_menu.js index 99b9a35f..d2738185 100644 --- a/public/components/context_menu/context_menu.js +++ b/public/components/context_menu/context_menu.js @@ -254,7 +254,7 @@ const checkURLParams = async () => { const isDiscoverNavMenu = (navMenu) => { return ( - navMenu[0].children.length === 5 && + (navMenu[0].children.length === 5 || navMenu[0].children.length === 6) && ($('[data-test-subj="breadcrumb first"]').prop('title') === 'Discover' || $('[data-test-subj="breadcrumb first last"]').prop('title') === 'Discover')