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/Test] Add Functional test for download CSV #65401

Merged

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented May 5, 2020

Summary

Depends on #65476

Reporting Team is preparing on making some changes to the Download CSV server-side code, but there is a gap in functional testing, as there are no existing functional tests for this feature.

We have API Integration tests running, which verify the server-side works when explicitly given all the POST parameters.

This PR adds functional tests for Download CSV. Since we are not able to check that the CSV file was successfully downloaded, this test validates that the button creates the correct POST parameters to send to the server and have it start the download.

Checklist

  • Run through flaky test runner


const REPORTS_FOLDER = path.resolve(__dirname, 'reports');

export default function({ getService, getPageObjects }: FtrProviderContext) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored these tests to screenshots.ts

@tsullivan tsullivan added Feature:Functional Testing (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead v7.8.0 v7.9.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes labels May 5, 2020
@elasticmachine
Copy link
Contributor

user doesn't have permission to update head repository

@tsullivan tsullivan marked this pull request as ready for review May 7, 2020 21:03
@elastic elastic deleted a comment from elasticmachine May 7, 2020
@tsullivan tsullivan requested a review from dmlemeshko May 7, 2020 21:04
@@ -198,7 +198,7 @@ export async function FindProvider({ getService }: FtrProviderContext) {
if (isDisplayed) {
return descendant;
} else {
throw new Error('Element is not displayed');
throw new Error(`Element "${selector}" is not displayed`);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting some flakiness in the tests, so I added this debug.

I think the flaky is coming from using dashboardPanelActions.toggleContextMenu(savedSearchPanel) to open the panel share menu.

Let's see if this keeps turning out to be flaky.

const csvPath = path.resolve(
__dirname,
'../../../../../../target/functional-tests/downloads/Ecommerce Data.csv'
);
Copy link
Member

@dmlemeshko dmlemeshko May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Spencer showed me a nice way to do it

import { REPO_ROOT } from '@kbn/dev-utils';
const csvPath = path.resolve(REPO_ROOT, 'target/functional-tests/downloads/Ecommerce Data.csv');

Copy link
Member

@dmlemeshko dmlemeshko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM.
Flaky test runner showed 30 passed: https://kibana-ci.elastic.co/job/kibana+flaky-test-suite-runner/439/

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

user doesn't have permission to update head repository

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

user doesn't have permission to update head repository

@tsullivan
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@tsullivan tsullivan merged commit f4d27b2 into elastic:master May 11, 2020
tsullivan added a commit to tsullivan/kibana that referenced this pull request May 11, 2020
* [Reporting/Test] Add Functional test for download CSV

* add todo

* add fs.existsSync check to find download

* debug

* handle timeout

* validate toast

* different way of getting repo_root
tsullivan added a commit to tsullivan/kibana that referenced this pull request May 11, 2020
* [Reporting/Test] Add Functional test for download CSV

* add todo

* add fs.existsSync check to find download

* debug

* handle timeout

* validate toast

* different way of getting repo_root
tsullivan added a commit that referenced this pull request May 11, 2020
* [Reporting/Test] Add Functional test for download CSV

* add todo

* add fs.existsSync check to find download

* debug

* handle timeout

* validate toast

* different way of getting repo_root
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 12, 2020
* master: (46 commits)
  [Drilldowns][chore] Remove some any's from components. Remove `PlaceContext` from components (elastic#65854)
  [functional/services] import By/until from module (elastic#66015)
  [Drilldowns][IE] fix welcome bar layout in IE (elastic#65676)
  Inspect action shows on dashboard for every chart (elastic#65998)
  Fix heigt calc in calc issue for ie11 (elastic#66010)
  [Flights] Delay Bucket - Error notification on opening sample visualization (elastic#66028)
  [SIEM] [Security] unified code structure phase 0 (elastic#65965)
  [Maps] Organize layers into subfolders (elastic#65513)
  skip flaky suite (elastic#59849)
  Cleanup prefill and edit flow. (elastic#66105)
  Fix major severity service map ring colors (elastic#66124)
  [DOCS] Improves formatting in action types (elastic#65932)
  [DOCS] APM Agent config: Setting values must be string (elastic#65875)
  Change default cert age limit value. (elastic#65918)
  [DOCS] Removed saved object options (elastic#66072)
  [SIEM] [Cases] Case API tests (elastic#65777)
  Add example of of local plugin installation (elastic#65986)
  skip flaky suite (elastic#65741)
  [SIEM][Detections] Restrict ML rule modification to ML Admins (elastic#65583)
  [Reporting/Test] Add Functional test for download CSV (elastic#65401)
  ...
tsullivan added a commit that referenced this pull request May 13, 2020
* [Reporting/Test] Add Functional test for download CSV

* add todo

* add fs.existsSync check to find download

* debug

* handle timeout

* validate toast

* different way of getting repo_root

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@tsullivan tsullivan deleted the reporting/test-dashboard-csv-download branch June 25, 2020 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Feature:Functional Testing release_note:skip Skip the PR/issue when compiling release notes v7.8.0 v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants