Skip to content

Commit

Permalink
updated edit reports test to match gitfram (#1737)
Browse files Browse the repository at this point in the history
Signed-off-by: sumukhswamy <sumukhhs@amazon.com>
  • Loading branch information
sumukhswamy authored Feb 27, 2025
1 parent 75557b5 commit 4de64b9
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 6 deletions.
89 changes: 84 additions & 5 deletions cypress/integration/plugins/reports-dashboards/02-edit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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);

Expand All @@ -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');
Expand All @@ -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);

Expand All @@ -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');
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ describe('Cypress', () => {

it('Download from Report definition details page', () => {
// create an on-demand report definition
cy.intercept('POST', '/_dashboards/api/reporting/generateReport/*').as(
'generateReport'
);

cy.visit(`${BASE_PATH}/app/reports-dashboards#/`, {
waitForGetTenant: true,
Expand All @@ -134,6 +137,6 @@ describe('Cypress', () => {

cy.get('#generateReportFromDetailsFileFormat').click({ force: true });

cy.get('#downloadInProgressLoadingModal');
cy.wait('@generateReport').its('response.statusCode').should('eq', 200);
});
});

0 comments on commit 4de64b9

Please sign in to comment.