Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reporting menu item #295

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .cypress/integration/04-download.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
'/reports-dashboards'
);

cy.wait(12500);

Check failure on line 14 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not wait for arbitrary time periods
cy.get('#landingPageOnDemandDownload').click({ force: true });

Check warning on line 15 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
cy.get('body').then($body => {
if ($body.find('#downloadInProgressLoadingModal').length > 0) {
return;
Expand All @@ -25,63 +25,63 @@

it('Download pdf from in-context menu', () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/dashboards#`);
cy.wait(5000);

Check failure on line 28 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not wait for arbitrary time periods

// click first entry in dashboards page
cy.get('tr.euiTableRow:nth-child(1) > td:nth-child(2) > div:nth-child(2) > a:nth-child(1)').click({ force: true });

Check warning on line 31 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls

// click Reporting in-context menu
cy.get('#downloadReport > span:nth-child(1) > span:nth-child(1)').click({ force: true });

Check warning on line 34 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls

// download PDF
// download PDF
cy.get('#generatePDF > span:nth-child(1) > span:nth-child(2)').click({ force: true });

Check warning on line 37 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls

cy.get('#reportGenerationProgressModal');
});

it('Download png from in-context menu', () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/dashboards#`);
cy.wait(5000);

Check failure on line 44 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not wait for arbitrary time periods

// click first entry in dashboards page
cy.get('tr.euiTableRow:nth-child(1) > td:nth-child(2) > div:nth-child(2) > a:nth-child(1)').click({ force: true });

Check warning on line 47 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls

// click Reporting in-context menu
cy.get('#downloadReport > span:nth-child(1) > span:nth-child(1)').click({ force: true });

Check warning on line 50 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls

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

Check warning on line 52 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls

cy.get('#reportGenerationProgressModal');
});

it('Download csv from saved search in-context menu', () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/discover#`);
cy.wait(5000);

Check failure on line 59 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not wait for arbitrary time periods

// 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 });

Check warning on line 62 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
cy.wait(5000);

Check failure on line 63 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not wait for arbitrary time periods

// click first entry
cy.get('li.euiListGroupItem:nth-child(1) > button:nth-child(1)').click({ force: true });

Check warning on line 66 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls

// open reporting menu
cy.get('#downloadReport').click({ force: true });

Check warning on line 69 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls

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

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(
'include',
'/reports-dashboards'
);
cy.wait(10000);

Check failure on line 82 in .cypress/integration/04-download.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Do not wait for arbitrary time periods

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');

Expand Down
2 changes: 1 addition & 1 deletion public/components/context_menu/context_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Loading