From 395d5b5ddadff6e3abbd8a3134e49a774d84662e Mon Sep 17 00:00:00 2001 From: Adam Tackett Date: Mon, 28 Oct 2024 15:32:01 -0700 Subject: [PATCH] test stubbing window.open Signed-off-by: Adam Tackett --- .../observability-dashboards/6_notebooks.spec.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cypress/integration/plugins/observability-dashboards/6_notebooks.spec.js b/cypress/integration/plugins/observability-dashboards/6_notebooks.spec.js index d6cf68e6f..fafc3a495 100644 --- a/cypress/integration/plugins/observability-dashboards/6_notebooks.spec.js +++ b/cypress/integration/plugins/observability-dashboards/6_notebooks.spec.js @@ -122,11 +122,17 @@ describe('Test reporting integration if the plugin is installed', () => { }); }); - it.skip('Create in-context PDF report from notebook', () => { + it('Create in-context PDF report from notebook', () => { cy.get('#reportingActionsButton').click(); cy.get('button.euiContextMenuItem:nth-child(1)') .contains('Download PDF') .click(); + + //Stub window.open to prevent new tab + cy.window().then((win) => { + cy.stub(win, 'open').as('windowOpen'); + }); + cy.get('body').contains('Please continue report generation in the new tab'); }); @@ -135,6 +141,12 @@ describe('Test reporting integration if the plugin is installed', () => { cy.get('button.euiContextMenuItem:nth-child(2)') .contains('Download PNG') .click(); + + //Stub window.open to prevent new tab + cy.window().then((win) => { + cy.stub(win, 'open').as('windowOpen'); + }); + cy.get('body').contains('Please continue report generation in the new tab'); });