-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report Deletion via UI- functional test (#64031)
* report delete test * removed the exclusive test * new archived reports * added pagination test * implemented review changes * Removed the unwanted method * addressed the review comments Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
cbf006c
commit 9703d85
Showing
8 changed files
with
204 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default ({ loadTestFile }: FtrProviderContext) => { | ||
describe('reporting management app', function() { | ||
this.tags('ciGroup7'); | ||
loadTestFile(require.resolve('./report_delete_pagination')); | ||
}); | ||
}; |
59 changes: 59 additions & 0 deletions
59
x-pack/test/functional/apps/reporting_management/report_delete_pagination.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default ({ getPageObjects, getService }: FtrProviderContext) => { | ||
const pageObjects = getPageObjects(['common', 'reporting']); | ||
const log = getService('log'); | ||
const retry = getService('retry'); | ||
const security = getService('security'); | ||
|
||
const testSubjects = getService('testSubjects'); | ||
const esArchiver = getService('esArchiver'); | ||
|
||
describe('Delete reports', function() { | ||
before(async () => { | ||
await security.testUser.setRoles(['global_discover_read', 'reporting_user']); | ||
await esArchiver.load('empty_kibana'); | ||
await esArchiver.load('reporting/archived_reports'); | ||
await pageObjects.common.navigateToActualUrl('kibana', '/management/kibana/reporting'); | ||
await testSubjects.existOrFail('reportJobListing', { timeout: 200000 }); | ||
}); | ||
|
||
after(async () => { | ||
await esArchiver.unload('empty_kibana'); | ||
await esArchiver.unload('reporting/archived_reports'); | ||
await security.testUser.restoreDefaults(); | ||
}); | ||
|
||
it('Confirm single report deletion works', async () => { | ||
log.debug('Checking for reports.'); | ||
await retry.try(async () => { | ||
await testSubjects.click('checkboxSelectRow-k9a9xlwl0gpe1457b10rraq3'); | ||
}); | ||
const deleteButton = await testSubjects.find('deleteReportButton'); | ||
await retry.waitFor('delete button to become enabled', async () => { | ||
return await deleteButton.isEnabled(); | ||
}); | ||
await deleteButton.click(); | ||
await testSubjects.exists('confirmModalBodyText'); | ||
await testSubjects.click('confirmModalConfirmButton'); | ||
await retry.try(async () => { | ||
await testSubjects.waitForDeleted('checkboxSelectRow-k9a9xlwl0gpe1457b10rraq3'); | ||
}); | ||
}); | ||
|
||
// functional test for report pagination: https://github.com/elastic/kibana/pull/62881 | ||
it('Report pagination', async () => { | ||
const previousButton = await testSubjects.find('pagination-button-previous'); | ||
expect(await previousButton.getAttribute('disabled')).to.be('true'); | ||
await testSubjects.click('pagination-button-1'); | ||
expect(await previousButton.getAttribute('disabled')).to.be(null); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+13.3 MB
x-pack/test/functional/es_archives/reporting/archived_reports/data.json.gz
Binary file not shown.
108 changes: 108 additions & 0 deletions
108
x-pack/test/functional/es_archives/reporting/archived_reports/mappings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
{ | ||
"type": "index", | ||
"value": { | ||
"aliases": { | ||
}, | ||
"index": ".reporting-2020.04.19", | ||
"mappings": { | ||
"properties": { | ||
"attempts": { | ||
"type": "short" | ||
}, | ||
"browser_type": { | ||
"type": "keyword" | ||
}, | ||
"completed_at": { | ||
"type": "date" | ||
}, | ||
"created_at": { | ||
"type": "date" | ||
}, | ||
"created_by": { | ||
"type": "keyword" | ||
}, | ||
"jobtype": { | ||
"type": "keyword" | ||
}, | ||
"kibana_id": { | ||
"type": "keyword" | ||
}, | ||
"kibana_name": { | ||
"type": "keyword" | ||
}, | ||
"max_attempts": { | ||
"type": "short" | ||
}, | ||
"meta": { | ||
"properties": { | ||
"layout": { | ||
"fields": { | ||
"keyword": { | ||
"ignore_above": 256, | ||
"type": "keyword" | ||
} | ||
}, | ||
"type": "text" | ||
}, | ||
"objectType": { | ||
"fields": { | ||
"keyword": { | ||
"ignore_above": 256, | ||
"type": "keyword" | ||
} | ||
}, | ||
"type": "text" | ||
} | ||
} | ||
}, | ||
"output": { | ||
"properties": { | ||
"content": { | ||
"enabled": false, | ||
"type": "object" | ||
}, | ||
"content_type": { | ||
"type": "keyword" | ||
}, | ||
"csv_contains_formulas": { | ||
"type": "boolean" | ||
}, | ||
"max_size_reached": { | ||
"type": "boolean" | ||
}, | ||
"size": { | ||
"type": "long" | ||
} | ||
} | ||
}, | ||
"payload": { | ||
"enabled": false, | ||
"type": "object" | ||
}, | ||
"priority": { | ||
"type": "byte" | ||
}, | ||
"process_expiration": { | ||
"type": "date" | ||
}, | ||
"started_at": { | ||
"type": "date" | ||
}, | ||
"status": { | ||
"type": "keyword" | ||
}, | ||
"timeout": { | ||
"type": "long" | ||
} | ||
} | ||
}, | ||
"settings": { | ||
"index": { | ||
"auto_expand_replicas": "0-1", | ||
"number_of_replicas": "0", | ||
"number_of_shards": "1", | ||
"prefer_v2_templates": "false" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters