-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Reporting/Test] Add Functional test for download CSV #65401
Conversation
|
||
const REPORTS_FOLDER = path.resolve(__dirname, 'reports'); | ||
|
||
export default function({ getService, getPageObjects }: FtrProviderContext) { |
There was a problem hiding this comment.
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
user doesn't have permission to update head repository |
@@ -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`); |
There was a problem hiding this comment.
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' | ||
); |
There was a problem hiding this comment.
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');
There was a problem hiding this 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/
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* [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
* [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
* 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) ...
* [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>
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