Skip to content

Commit 84924ac

Browse files
added pagination test
1 parent fc5cd2d commit 84924ac

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

x-pack/test/functional/apps/reporting_management/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ import { FtrProviderContext } from '../../ftr_provider_context';
99
export default ({ loadTestFile }: FtrProviderContext) => {
1010
describe('reporting management app', function() {
1111
this.tags('ciGroup7');
12-
loadTestFile(require.resolve('./report_delete'));
12+
loadTestFile(require.resolve('./report_delete_pagination'));
1313
});
1414
};

x-pack/test/functional/apps/reporting_management/report_delete.ts renamed to x-pack/test/functional/apps/reporting_management/report_delete_pagination.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
import expect from '@kbn/expect';
78
import { FtrProviderContext } from '../../ftr_provider_context';
89

910
export default ({ getPageObjects, getService }: FtrProviderContext) => {
1011
const pageObjects = getPageObjects(['common', 'reporting']);
1112
const log = getService('log');
1213
const retry = getService('retry');
14+
const security = getService('security');
1315

1416
const testSubjects = getService('testSubjects');
1517
const esArchiver = getService('esArchiver');
1618

1719
describe('Delete reports', function() {
1820
before(async () => {
21+
await security.testUser.setRoles(['global_discover_read', 'reporting_user']);
1922
await esArchiver.load('empty_kibana');
2023
await esArchiver.load('reporting/archived_reports');
2124
await pageObjects.common.navigateToActualUrl('kibana', '/management/kibana/reporting');
@@ -25,14 +28,12 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
2528
after(async () => {
2629
await esArchiver.unload('empty_kibana');
2730
await esArchiver.unload('reporting/archived_reports');
31+
await security.testUser.restoreDefaults();
2832
});
2933

3034
it('Confirm report deletion works', async () => {
3135
log.debug('Checking for reports.');
3236

33-
// const table = await testSubjects.find('reportJobListing');
34-
// const rows = await table.findAllByCssSelector('tbody tr');
35-
// log.debug(rows.length);
3637
await retry.try(async () => {
3738
await testSubjects.click('checkboxSelectRow-k9a9xlwl0gpe1457b10rraq3');
3839
});
@@ -47,5 +48,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
4748
await testSubjects.waitForDeleted('checkboxSelectRow-k9a9xlwl0gpe1457b10rraq3');
4849
});
4950
});
51+
52+
// functional test for report pagination: https://github.com/elastic/kibana/pull/62881
53+
it('Report pagination', async () => {
54+
const previousButton = await testSubjects.find('pagination-button-previous');
55+
expect(await previousButton.getAttribute('disabled')).to.be('true');
56+
await testSubjects.click('pagination-button-1');
57+
expect(await previousButton.getAttribute('disabled')).to.be(null);
58+
});
5059
});
5160
};

x-pack/test/functional/config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ export default async function({ readConfigFile }) {
229229
kibana: [],
230230
},
231231

232+
global_discover_read: {
233+
kibana: [
234+
{
235+
feature: {
236+
discover: ['read'],
237+
},
238+
spaces: ['*'],
239+
},
240+
],
241+
},
242+
232243
//Kibana feature privilege isn't specific to advancedSetting. It can be anything. https://github.com/elastic/kibana/issues/35965
233244
test_api_keys: {
234245
elasticsearch: {

0 commit comments

Comments
 (0)