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 <elasticmachine@users.noreply.github.com>
This commit is contained in:
Rashmi Kulkarni 2020-04-24 10:48:36 -07:00 committed by GitHub
parent cbf006c2a0
commit 9703d85b30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 204 additions and 2 deletions

View file

@ -83,7 +83,12 @@ export class ReportDeleteButton extends PureComponent<Props, State> {
return (
<Fragment>
<EuiButton onClick={() => this.showConfirm()} iconType="trash" color={'danger'}>
<EuiButton
onClick={() => this.showConfirm()}
iconType="trash"
color={'danger'}
data-test-subj="deleteReportButton"
>
{intl.formatMessage(
{
id: 'xpack.reporting.listing.table.deleteReportButton',

View file

@ -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'));
});
};

View file

@ -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);
});
});
};

View file

@ -57,6 +57,8 @@ export default async function({ readConfigFile }) {
resolve(__dirname, './apps/cross_cluster_replication'),
resolve(__dirname, './apps/remote_clusters'),
resolve(__dirname, './apps/transform'),
resolve(__dirname, './apps/reporting_management'),
// This license_management file must be last because it is destructive.
resolve(__dirname, './apps/license_management'),
],
@ -196,6 +198,10 @@ export default async function({ readConfigFile }) {
pathname: '/app/kibana/',
hash: '/management/elasticsearch/transform',
},
reporting: {
pathname: '/app/kibana/',
hash: '/management/kibana/reporting',
},
},
// choose where esArchiver should load archives from
@ -228,6 +234,17 @@ export default async function({ readConfigFile }) {
kibana: [],
},
global_discover_read: {
kibana: [
{
feature: {
discover: ['read'],
},
spaces: ['*'],
},
],
},
//Kibana feature privilege isn't specific to advancedSetting. It can be anything. https://github.com/elastic/kibana/issues/35965
test_api_keys: {
elasticsearch: {

View file

@ -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"
}
}
}
}

View file

@ -170,6 +170,5 @@ export function ReportingPageProvider({ getService, getPageObjects }) {
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
}
}
return new ReportingPage();
}