From 7dc9a1658a1f85f0866ce33a9169bbe93c19d378 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Thu, 13 Aug 2020 09:56:27 -0700 Subject: [PATCH 1/3] [Reporting/Functional] unskip pagination test --- .../__snapshots__/report_listing.test.tsx.snap | 3 --- .../reporting/public/components/report_listing.tsx | 1 - .../apps/reporting_management/report_listing.ts | 13 ++++++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/reporting/public/components/__snapshots__/report_listing.test.tsx.snap b/x-pack/plugins/reporting/public/components/__snapshots__/report_listing.test.tsx.snap index 66c3aea8acc13..ddba7842f1199 100644 --- a/x-pack/plugins/reporting/public/components/__snapshots__/report_listing.test.tsx.snap +++ b/x-pack/plugins/reporting/public/components/__snapshots__/report_listing.test.tsx.snap @@ -30,7 +30,6 @@ Array [ }, ] } - data-test-page={0} data-test-subj="reportJobListing" isSelectable={true} itemId="id" @@ -57,7 +56,6 @@ Array [ >
@@ -368,7 +366,6 @@ Array [ ,
diff --git a/x-pack/plugins/reporting/public/components/report_listing.tsx b/x-pack/plugins/reporting/public/components/report_listing.tsx index 80ef9311fd0e5..afcae93a8db16 100644 --- a/x-pack/plugins/reporting/public/components/report_listing.tsx +++ b/x-pack/plugins/reporting/public/components/report_listing.tsx @@ -513,7 +513,6 @@ class ReportListingUi extends Component { isSelectable={true} onChange={this.onTableChange} data-test-subj="reportJobListing" - data-test-page={this.state.page} /> {this.state.selectedJobs.length > 0 ? this.renderDeleteButton() : null} diff --git a/x-pack/test/functional/apps/reporting_management/report_listing.ts b/x-pack/test/functional/apps/reporting_management/report_listing.ts index 476f3e73d0923..c8ce75d7efbde 100644 --- a/x-pack/test/functional/apps/reporting_management/report_listing.ts +++ b/x-pack/test/functional/apps/reporting_management/report_listing.ts @@ -68,7 +68,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); }); - it.skip('Paginates content', async () => { + it('Paginates historical reports', async () => { + // wait for first row of page 1 + await testSubjects.find('checkboxSelectRow-k9a9xlwl0gpe1457b10rraq3'); + const previousButton = await testSubjects.find('pagination-button-previous'); // previous CAN NOT be clicked @@ -90,7 +93,9 @@ pdf\ndashboard\n2020-04-21 @ 07:00 PM\ntest_user\nCompleted at 2020-04-21 @ 07:0 // click page 2 await testSubjects.click('pagination-button-1'); - await findInstance.byCssSelector('[data-test-page="1"]'); + + // wait for first row of page 2 + await testSubjects.find('checkboxSelectRow-k9a9uc4x0gpe1457b16wthc8'); // previous CAN be clicked expect(await previousButton.getAttribute('disabled')).to.be(null); @@ -110,7 +115,9 @@ test_user\nCompleted at 2020-04-21 @ 06:55 PM - Max size reached\nreport2csv\n20 // click page 3 await testSubjects.click('pagination-button-2'); - await findInstance.byCssSelector('[data-test-page="2"]'); + + // wait for first row of page 3 + await testSubjects.find('checkboxSelectRow-k9a9p1840gpe1457b1ghfxw5'); // scan page 3 tableText = await getTableTextFromElement(await testSubjects.find('reportJobListing')); From 23dc5153c50bd36cc167487876eeda5116d5ce0d Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Thu, 13 Aug 2020 10:12:17 -0700 Subject: [PATCH 2/3] change to js file for flaky test runner --- .../apps/reporting_management/{index.ts => index.js} | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) rename x-pack/test/functional/apps/reporting_management/{index.ts => index.js} (75%) diff --git a/x-pack/test/functional/apps/reporting_management/index.ts b/x-pack/test/functional/apps/reporting_management/index.js similarity index 75% rename from x-pack/test/functional/apps/reporting_management/index.ts rename to x-pack/test/functional/apps/reporting_management/index.js index 8606c46053ab0..ef92e7d04ef0c 100644 --- a/x-pack/test/functional/apps/reporting_management/index.ts +++ b/x-pack/test/functional/apps/reporting_management/index.js @@ -4,9 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default ({ loadTestFile }: FtrProviderContext) => { +export default ({ loadTestFile }) => { describe('reporting management app', function () { this.tags('ciGroup7'); loadTestFile(require.resolve('./report_listing')); From 70b94bf663acb234f418c54a407d068b57c08098 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Thu, 13 Aug 2020 12:09:08 -0700 Subject: [PATCH 3/3] fix ts --- .../test/functional/apps/reporting_management/report_listing.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test/functional/apps/reporting_management/report_listing.ts b/x-pack/test/functional/apps/reporting_management/report_listing.ts index c8ce75d7efbde..ca5fb888e67e1 100644 --- a/x-pack/test/functional/apps/reporting_management/report_listing.ts +++ b/x-pack/test/functional/apps/reporting_management/report_listing.ts @@ -26,7 +26,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const security = getService('security'); const testSubjects = getService('testSubjects'); - const findInstance = getService('find'); const esArchiver = getService('esArchiver'); describe('Listing of Reports', function () {