44 * you may not use this file except in compliance with the Elastic License.
55 */
66
7+ import expect from '@kbn/expect' ;
78import { FtrProviderContext } from '../../ftr_provider_context' ;
89
910export 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} ;
0 commit comments