From 4800836db2b3e9fa82a383c708974bf414eb5084 Mon Sep 17 00:00:00 2001 From: Sumukh Swamy Date: Thu, 22 Aug 2024 09:40:14 -0700 Subject: [PATCH] Fix for reporting integ test failures (#1530) * added fix for integ test failures Signed-off-by: sumukhswamy * linter changes Signed-off-by: sumukhswamy --------- Signed-off-by: sumukhswamy (cherry picked from commit cc112532b48b6f23260f8dfec04cfff0d2a6c374) --- .../reports-dashboards/02-edit.spec.js | 89 +++++++++++++++++-- 1 file changed, 84 insertions(+), 5 deletions(-) diff --git a/cypress/integration/plugins/reports-dashboards/02-edit.spec.js b/cypress/integration/plugins/reports-dashboards/02-edit.spec.js index 152094d61..53ced4565 100644 --- a/cypress/integration/plugins/reports-dashboards/02-edit.spec.js +++ b/cypress/integration/plugins/reports-dashboards/02-edit.spec.js @@ -17,6 +17,24 @@ describe('Cypress', () => { cy.wait(12500); + cy.intercept( + 'GET', + `${BASE_PATH}/api/reporting/getReportSource/dashboard` + ).as('dashboard'); + + cy.intercept( + 'GET', + `${BASE_PATH}/api/reporting/getReportSource/visualization` + ).as('visualization'); + + cy.intercept('GET', `${BASE_PATH}/api/reporting/getReportSource/search`).as( + 'search' + ); + + cy.intercept('GET', `${BASE_PATH}/api/observability/notebooks/`).as( + 'notebook' + ); + cy.get('#reportDefinitionDetailsLink').first().click({ force: true }); cy.get('#editReportDefinitionButton').should('exist'); @@ -26,14 +44,23 @@ describe('Cypress', () => { cy.url().should('include', 'edit'); cy.wait(1000); + cy.wait('@dashboard'); + cy.wait('@visualization'); + cy.wait('@search'); + cy.wait('@notebook'); // update the report name - cy.get('#reportSettingsName').type(' update name'); + cy.get('#reportSettingsName').type('{selectall}{backspace} update name'); // update report description - cy.get('#reportSettingsDescription').type(' update description'); + cy.get('#reportSettingsDescription').type( + '{selectall}{backspace} update description' + ); - cy.get('#editReportDefinitionButton').click({ force: true }); + cy.get('#editReportDefinitionButton') + .contains('Save Changes') + .trigger('mouseover') + .click({ force: true }); cy.wait(12500); @@ -52,6 +79,24 @@ describe('Cypress', () => { cy.wait(12500); + cy.intercept( + 'GET', + `${BASE_PATH}/api/reporting/getReportSource/dashboard` + ).as('dashboard'); + + cy.intercept( + 'GET', + `${BASE_PATH}/api/reporting/getReportSource/visualization` + ).as('visualization'); + + cy.intercept('GET', `${BASE_PATH}/api/reporting/getReportSource/search`).as( + 'search' + ); + + cy.intercept('GET', `${BASE_PATH}/api/observability/notebooks/`).as( + 'notebook' + ); + cy.get('#reportDefinitionDetailsLink').first().click(); cy.get('#editReportDefinitionButton').should('exist'); @@ -61,12 +106,20 @@ describe('Cypress', () => { cy.url().should('include', 'edit'); cy.wait(1000); + + cy.wait('@dashboard'); + cy.wait('@visualization'); + cy.wait('@search'); + cy.wait('@notebook'); cy.get('#reportDefinitionTriggerTypes > div:nth-child(2)').click({ force: true, }); cy.get('#Schedule').check({ force: true }); - cy.get('#editReportDefinitionButton').click({ force: true }); + cy.get('#editReportDefinitionButton') + .contains('Save Changes') + .trigger('mouseover') + .click({ force: true }); cy.wait(12500); @@ -85,6 +138,24 @@ describe('Cypress', () => { cy.wait(12500); + cy.intercept( + 'GET', + `${BASE_PATH}/api/reporting/getReportSource/dashboard` + ).as('dashboard'); + + cy.intercept( + 'GET', + `${BASE_PATH}/api/reporting/getReportSource/visualization` + ).as('visualization'); + + cy.intercept('GET', `${BASE_PATH}/api/reporting/getReportSource/search`).as( + 'search' + ); + + cy.intercept('GET', `${BASE_PATH}/api/observability/notebooks/`).as( + 'notebook' + ); + cy.get('#reportDefinitionDetailsLink').first().click(); cy.get('#editReportDefinitionButton').should('exist'); @@ -95,11 +166,19 @@ describe('Cypress', () => { cy.wait(1000); + cy.wait('@dashboard'); + cy.wait('@visualization'); + cy.wait('@search'); + cy.wait('@notebook'); + cy.get('#reportDefinitionTriggerTypes > div:nth-child(1)').click({ force: true, }); - cy.get('#editReportDefinitionButton').click({ force: true }); + cy.get('#editReportDefinitionButton') + .contains('Save Changes') + .trigger('mouseover') + .click({ force: true }); cy.wait(12500);