[Cases] Unskip MKI tests (#168924)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Christos Nasikas 2023-10-23 12:21:25 +03:00 committed by GitHub
parent a8a22c39b3
commit 2146a7ef16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 149 additions and 110 deletions

View file

@ -98,7 +98,12 @@ const STANDARD_LIST_TYPES = [
'lens',
'links',
'map',
// cases saved objects
'cases',
'cases-comments',
'cases-user-actions',
'cases-configure',
'cases-connector-mappings',
// synthetics based objects
'synthetics-monitor',
'uptime-dynamic-settings',

View file

@ -96,7 +96,6 @@ export function CasesCommonServiceProvider({ getService, getPageObject }: FtrPro
async expectToasterToContain(content: string) {
const toast = await toasts.getToastElement(1);
expect(await toast.getVisibleText()).to.contain(content);
await toasts.dismissAllToasts();
},
async assertCaseModalVisible(expectVisible = true) {

View file

@ -1154,8 +1154,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
});
// FLAKY: https://github.com/elastic/kibana/issues/168534
describe.skip('customFields', () => {
describe('customFields', () => {
const customFields = [
{
key: 'valid_key_1',
@ -1198,13 +1197,13 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
it('updates a custom field correctly', async () => {
const summary = await testSubjects.find(`case-text-custom-field-${customFields[0].key}`);
expect(await summary.getVisibleText()).equal('this is a text field value');
const textField = await testSubjects.find(`case-text-custom-field-${customFields[0].key}`);
expect(await textField.getVisibleText()).equal('this is a text field value');
const sync = await testSubjects.find(
const toggle = await testSubjects.find(
`case-toggle-custom-field-form-field-${customFields[1].key}`
);
expect(await sync.getAttribute('aria-checked')).equal('true');
expect(await toggle.getAttribute('aria-checked')).equal('true');
await testSubjects.click(`case-text-custom-field-edit-button-${customFields[0].key}`);
@ -1222,19 +1221,23 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await testSubjects.click(`case-text-custom-field-submit-button-${customFields[0].key}`);
await header.waitUntilLoadingHasFinished();
await retry.waitFor('update toast exist', async () => {
return await testSubjects.exists('toastCloseButton');
});
await testSubjects.click('toastCloseButton');
await sync.click();
await header.waitUntilLoadingHasFinished();
await toggle.click();
await header.waitUntilLoadingHasFinished();
expect(await summary.getVisibleText()).equal('this is a text field value edited!!');
expect(await textField.getVisibleText()).equal('this is a text field value edited!!');
expect(await sync.getAttribute('aria-checked')).equal('false');
expect(await toggle.getAttribute('aria-checked')).equal('false');
// validate user action
const userActions = await find.allByCssSelector(

View file

@ -61,6 +61,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const dashboard = getPageObject('dashboard');
const lens = getPageObject('lens');
const listingTable = getService('listingTable');
const toasts = getService('toasts');
const createAttachmentAndNavigate = async (attachment: AttachmentRequest) => {
const caseData = await cases.api.createCase({
@ -249,6 +250,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
*/
await cases.create.createCase({ owner });
await cases.common.expectToasterToContain('has been updated');
await toasts.dismissAllToastsWithChecks();
}
const casesCreatedFromFlyout = await findCases({ supertest });
@ -325,6 +327,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await testSubjects.click(`cases-table-row-select-${currentCaseId}`);
await cases.common.expectToasterToContain('has been updated');
await toasts.dismissAllToastsWithChecks();
await ensureFirstCommentOwner(currentCaseId, owner);
}
});
@ -387,6 +390,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await cases.common.expectToasterToContain(`${caseTitle} has been updated`);
await testSubjects.click('toaster-content-case-view-link');
await toasts.dismissAllToastsWithChecks();
const title = await find.byCssSelector('[data-test-subj="editable-title-header-value"]');
expect(await title.getVisibleText()).toEqual(caseTitle);
@ -414,6 +418,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await cases.common.expectToasterToContain(`${theCaseTitle} has been updated`);
await testSubjects.click('toaster-content-case-view-link');
await toasts.dismissAllToastsWithChecks();
const title = await find.byCssSelector('[data-test-subj="editable-title-header-value"]');
expect(await title.getVisibleText()).toEqual(theCaseTitle);

View file

@ -79,7 +79,7 @@ export function SvlCasesApiServiceProvider({ getService }: FtrProviderContext) {
async deleteAllCaseItems() {
await Promise.all([
this.deleteCasesByESQuery(),
this.deleteCases(),
this.deleteCasesUserActions(),
this.deleteComments(),
this.deleteConfiguration(),
@ -91,7 +91,7 @@ export function SvlCasesApiServiceProvider({ getService }: FtrProviderContext) {
await kbnServer.savedObjects.clean({ types: ['cases-user-actions'] });
},
async deleteCasesByESQuery(): Promise<void> {
async deleteCases(): Promise<void> {
await kbnServer.savedObjects.clean({ types: ['cases'] });
},

View file

@ -14,7 +14,7 @@ export default ({ getService }: FtrProviderContext): void => {
describe('get_case', () => {
afterEach(async () => {
await svlCases.api.deleteCasesByESQuery();
await svlCases.api.deleteCases();
});
it('should return a case', async () => {

View file

@ -15,7 +15,7 @@ export default ({ getService }: FtrProviderContext): void => {
describe('post_case', () => {
afterEach(async () => {
await svlCases.api.deleteCasesByESQuery();
await svlCases.api.deleteCases();
});
it('should create a case', async () => {

View file

@ -13,7 +13,7 @@ export default ({ getService }: FtrProviderContext): void => {
describe('get_case', () => {
afterEach(async () => {
await svlCases.api.deleteCasesByESQuery();
await svlCases.api.deleteCases();
});
it('should return a case', async () => {

View file

@ -15,7 +15,7 @@ export default ({ getService }: FtrProviderContext): void => {
describe('post_case', () => {
afterEach(async () => {
await svlCases.api.deleteCasesByESQuery();
await svlCases.api.deleteCases();
});
it('should create a case', async () => {

View file

@ -18,39 +18,37 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const cases = getService('cases');
const svlCases = getService('svlCases');
const find = getService('find');
const toasts = getService('toasts');
// failing test https://github.com/elastic/kibana/issues/166592
describe.skip('Cases persistable attachments', function () {
// security_exception: action [indices:data/write/delete/byquery] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.kibana_alerting_cases], this action is granted by the index privileges [delete,write,all]
this.tags(['failsOnMKI']);
describe('Cases persistable attachments', function () {
describe('lens visualization', () => {
before(async () => {
await svlCommonPage.login();
await kibanaServer.savedObjects.cleanStandardList();
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
await kibanaServer.importExport.load(
'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json'
);
await svlObltNavigation.navigateToLandingPage();
await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'dashboards' });
await dashboard.clickNewDashboard();
await lens.createAndAddLensFromDashboard({});
await dashboard.waitForRenderComplete();
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await esArchiver.unload('x-pack/test/functional/es_archives/logstash_functional');
await kibanaServer.importExport.unload(
'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json'
);
await kibanaServer.savedObjects.cleanStandardList();
await svlCommonPage.forceLogout();
});
@ -73,8 +71,8 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await testSubjects.click('create-case-submit');
await cases.common.expectToasterToContain(`${caseTitle} has been updated`);
await testSubjects.click('toaster-content-case-view-link');
await toasts.dismissAllToastsWithChecks();
if (await testSubjects.exists('appLeaveConfirmModal')) {
await testSubjects.exists('confirmModalConfirmButton');
@ -108,6 +106,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await cases.common.expectToasterToContain(`${theCaseTitle} has been updated`);
await testSubjects.click('toaster-content-case-view-link');
await toasts.dismissAllToastsWithChecks();
if (await testSubjects.exists('appLeaveConfirmModal')) {
await testSubjects.exists('confirmModalConfirmButton');

View file

@ -16,13 +16,12 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const svlObltNavigation = getService('svlObltNavigation');
const testSubjects = getService('testSubjects');
const cases = getService('cases');
const svlCases = getService('svlCases');
const toasts = getService('toasts');
const retry = getService('retry');
const find = getService('find');
describe('Configure Case', function () {
// security_exception: action [indices:data/write/delete/byquery] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.kibana_alerting_cases], this action is granted by the index privileges [delete,write,all]
this.tags(['failsOnMKI']);
before(async () => {
await svlCommonPage.login();
await svlObltNavigation.navigateToLandingPage();
@ -42,7 +41,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await svlCommonPage.forceLogout();
});

View file

@ -16,10 +16,9 @@ const owner = OBSERVABILITY_OWNER;
export default ({ getService, getPageObject }: FtrProviderContext) => {
describe('Create Case', function () {
// security_exception: action [indices:data/write/delete/byquery] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.kibana_alerting_cases], this action is granted by the index privileges [delete,write,all]
this.tags(['failsOnMKI']);
const find = getService('find');
const cases = getService('cases');
const svlCases = getService('svlCases');
const testSubjects = getService('testSubjects');
const svlCommonPage = getPageObject('svlCommonPage');
const config = getService('config');
@ -35,7 +34,7 @@ export default ({ getService, getPageObject }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await svlCommonPage.forceLogout();
});

View file

@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('Serverless Observability Cases', function () {
loadTestFile(require.resolve('./attachment_framework'));
loadTestFile(require.resolve('./view_case'));
loadTestFile(require.resolve('./configure'));
loadTestFile(require.resolve('./create_case_form'));
loadTestFile(require.resolve('./list_view'));
});
}

View file

@ -14,13 +14,12 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const header = getPageObject('header');
const testSubjects = getService('testSubjects');
const cases = getService('cases');
const svlCases = getService('svlCases');
const svlCommonNavigation = getPageObject('svlCommonNavigation');
const svlCommonPage = getPageObject('svlCommonPage');
const svlObltNavigation = getService('svlObltNavigation');
describe('Cases list', function () {
// multiple errors in after hook due to delete permission
this.tags(['failsOnMKI']);
before(async () => {
await svlCommonPage.login();
await svlObltNavigation.navigateToLandingPage();
@ -28,7 +27,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await cases.casesTable.waitForCasesToBeDeleted();
await svlCommonPage.forceLogout();
});
@ -107,7 +106,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
afterEach(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await cases.casesTable.waitForCasesToBeDeleted();
});
@ -170,7 +169,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await cases.casesTable.waitForCasesToBeDeleted();
});
@ -274,6 +273,7 @@ const createNCasesBeforeDeleteAllAfter = (
getService: FtrProviderContext['getService']
) => {
const cases = getService('cases');
const svlCases = getService('svlCases');
const header = getPageObject('header');
before(async () => {
@ -283,7 +283,7 @@ const createNCasesBeforeDeleteAllAfter = (
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await cases.casesTable.waitForCasesToBeDeleted();
});
};

View file

@ -26,6 +26,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const header = getPageObject('header');
const testSubjects = getService('testSubjects');
const cases = getService('cases');
const svlCases = getService('svlCases');
const find = getService('find');
const retry = getService('retry');
@ -34,14 +35,12 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const svlCommonPage = getPageObject('svlCommonPage');
describe('Case View', function () {
// security_exception: action [indices:data/write/delete/byquery] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.kibana_alerting_cases], this action is granted by the index privileges [delete,write,all]
this.tags(['failsOnMKI']);
before(async () => {
await svlCommonPage.login();
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await svlCommonPage.forceLogout();
});
@ -280,7 +279,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
after(async () => {
await cases.testResources.removeKibanaSampleData('logs');
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
});
it('adds lens visualization in description', async () => {
@ -325,7 +324,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
});
it('initially renders user actions list correctly', async () => {
@ -437,7 +436,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
});
it('should set the cases title', async () => {
@ -498,17 +497,17 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
afterEach(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
});
it('updates a custom field correctly', async () => {
const summary = await testSubjects.find(`case-text-custom-field-${customFields[0].key}`);
expect(await summary.getVisibleText()).equal('this is a text field value');
const textField = await testSubjects.find(`case-text-custom-field-${customFields[0].key}`);
expect(await textField.getVisibleText()).equal('this is a text field value');
const sync = await testSubjects.find(
const toggle = await testSubjects.find(
`case-toggle-custom-field-form-field-${customFields[1].key}`
);
expect(await sync.getAttribute('aria-checked')).equal('true');
expect(await toggle.getAttribute('aria-checked')).equal('true');
await testSubjects.click(`case-text-custom-field-edit-button-${customFields[0].key}`);
@ -526,19 +525,23 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await testSubjects.click(`case-text-custom-field-submit-button-${customFields[0].key}`);
await header.waitUntilLoadingHasFinished();
await retry.waitFor('update toast exist', async () => {
return await testSubjects.exists('toastCloseButton');
});
await testSubjects.click('toastCloseButton');
await sync.click();
await header.waitUntilLoadingHasFinished();
await toggle.click();
await header.waitUntilLoadingHasFinished();
expect(await summary.getVisibleText()).equal('this is a text field value edited!!');
expect(await textField.getVisibleText()).equal('this is a text field value edited!!');
expect(await sync.getAttribute('aria-checked')).equal('false');
expect(await toggle.getAttribute('aria-checked')).equal('false');
// validate user action
const userActions = await find.allByCssSelector(

View file

@ -12,12 +12,8 @@ export default function ({ loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./landing_page'));
loadTestFile(require.resolve('./navigation'));
loadTestFile(require.resolve('./observability_log_explorer'));
loadTestFile(require.resolve('./cases/attachment_framework'));
loadTestFile(require.resolve('./rules/rules_list'));
loadTestFile(require.resolve('./cases/view_case'));
loadTestFile(require.resolve('./cases/configure'));
loadTestFile(require.resolve('./cases/create_case_form'));
loadTestFile(require.resolve('./cases/list_view'));
loadTestFile(require.resolve('./cases'));
loadTestFile(require.resolve('./advanced_settings'));
loadTestFile(require.resolve('./infra'));
loadTestFile(require.resolve('./ml'));

View file

@ -12,40 +12,38 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const dashboard = getPageObject('dashboard');
const lens = getPageObject('lens');
const svlSecNavigation = getService('svlSecNavigation');
const svlCommonPage = getPageObject('svlCommonPage');
const testSubjects = getService('testSubjects');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const cases = getService('cases');
const svlCases = getService('svlCases');
const find = getService('find');
const retry = getService('retry');
const header = getPageObject('header');
const toasts = getService('toasts');
// Failing
// Issue: https://github.com/elastic/kibana/issues/165135
describe.skip('Cases persistable attachments', () => {
describe('Cases persistable attachments', () => {
describe('lens visualization', () => {
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
await kibanaServer.importExport.load(
'x-pack/test/functional/fixtures/kbn_archiver/dashboard/feature_controls/security/security.json'
);
await svlCommonPage.login();
await svlSecNavigation.navigateToLandingPage();
await testSubjects.click('solutionSideNavItemLink-dashboards');
await header.waitUntilLoadingHasFinished();
await retry.waitFor('createDashboardButton', async () => {
return await testSubjects.exists('createDashboardButton');
});
await testSubjects.click('createDashboardButton');
await header.waitUntilLoadingHasFinished();
await lens.createAndAddLensFromDashboard({});
await dashboard.waitForRenderComplete();
});
after(async () => {
await cases.api.deleteAllCases();
await esArchiver.unload('x-pack/test/functional/es_archives/logstash_functional');
await kibanaServer.importExport.unload(
'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json'
);
await svlCases.api.deleteAllCaseItems();
await svlCommonPage.forceLogout();
});
it('adds lens visualization to a new case', async () => {
@ -68,8 +66,8 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await testSubjects.click('create-case-submit');
await cases.common.expectToasterToContain(`${caseTitle} has been updated`);
await testSubjects.click('toaster-content-case-view-link');
await toasts.dismissAllToastsWithChecks();
if (await testSubjects.exists('appLeaveConfirmModal')) {
await testSubjects.exists('confirmModalConfirmButton');
@ -107,6 +105,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await cases.common.expectToasterToContain(`${theCaseTitle} has been updated`);
await testSubjects.click('toaster-content-case-view-link');
await toasts.dismissAllToastsWithChecks();
if (await testSubjects.exists('appLeaveConfirmModal')) {
await testSubjects.exists('confirmModalConfirmButton');

View file

@ -15,13 +15,12 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const svlSecNavigation = getService('svlSecNavigation');
const testSubjects = getService('testSubjects');
const cases = getService('cases');
const svlCases = getService('svlCases');
const toasts = getService('toasts');
const retry = getService('retry');
const find = getService('find');
describe('Configure Case', function () {
// security_exception: action [indices:data/write/delete/byquery] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.kibana_alerting_cases], this action is granted by the index privileges [delete,write,all]
this.tags(['failsOnMKI']);
before(async () => {
await svlCommonPage.login();
await svlSecNavigation.navigateToLandingPage();
@ -41,7 +40,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await svlCommonPage.forceLogout();
});

View file

@ -16,9 +16,9 @@ const owner = SECURITY_SOLUTION_OWNER;
export default ({ getService, getPageObject }: FtrProviderContext) => {
describe('Create Case', function () {
this.tags(['failsOnMKI']);
const find = getService('find');
const cases = getService('cases');
const svlCases = getService('svlCases');
const testSubjects = getService('testSubjects');
const config = getService('config');
const svlCommonPage = getPageObject('svlCommonPage');
@ -34,7 +34,7 @@ export default ({ getService, getPageObject }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await svlCommonPage.forceLogout();
});

View file

@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('Serverless Security Cases', function () {
loadTestFile(require.resolve('./attachment_framework'));
loadTestFile(require.resolve('./view_case'));
loadTestFile(require.resolve('./create_case_form'));
loadTestFile(require.resolve('./configure'));
loadTestFile(require.resolve('./list_view'));
});
}

View file

@ -14,12 +14,11 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const header = getPageObject('header');
const testSubjects = getService('testSubjects');
const cases = getService('cases');
const svlCases = getService('svlCases');
const svlSecNavigation = getService('svlSecNavigation');
const svlCommonPage = getPageObject('svlCommonPage');
describe('Cases List', function () {
// multiple errors in after hook due to delete permission
this.tags(['failsOnMKI']);
before(async () => {
await svlCommonPage.login();
@ -29,7 +28,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await cases.casesTable.waitForCasesToBeDeleted();
await svlCommonPage.forceLogout();
});
@ -49,8 +48,6 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
describe('bulk actions', () => {
// security_exception: action [indices:data/write/delete/byquery] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.kibana_alerting_cases], this action is granted by the index privileges [delete,write,all]
// action [indices:data/write/delete/byquery] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.kibana_alerting_cases], this action is granted by the index privileges [delete,write,all]
describe('delete', () => {
createNCasesBeforeDeleteAllAfter(8, getPageObject, getService);
@ -110,7 +107,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
afterEach(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await cases.casesTable.waitForCasesToBeDeleted();
});
@ -174,7 +171,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await cases.casesTable.waitForCasesToBeDeleted();
});
@ -279,6 +276,7 @@ const createNCasesBeforeDeleteAllAfter = (
getService: FtrProviderContext['getService']
) => {
const cases = getService('cases');
const svlCases = getService('svlCases');
const header = getPageObject('header');
before(async () => {
@ -288,7 +286,7 @@ const createNCasesBeforeDeleteAllAfter = (
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await cases.casesTable.waitForCasesToBeDeleted();
});
};

View file

@ -26,6 +26,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const header = getPageObject('header');
const testSubjects = getService('testSubjects');
const cases = getService('cases');
const svlCases = getService('svlCases');
const find = getService('find');
const retry = getService('retry');
@ -34,14 +35,12 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const svlCommonPage = getPageObject('svlCommonPage');
describe('Case View', function () {
// security_exception: action [indices:data/write/delete/byquery] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.kibana_alerting_cases], this action is granted by the index privileges [delete,write,all]
this.tags(['failsOnMKI']);
before(async () => {
await svlCommonPage.login();
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
await svlCommonPage.forceLogout();
});
@ -279,7 +278,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
after(async () => {
await cases.testResources.removeKibanaSampleData('logs');
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
});
it('adds lens visualization in description', async () => {
@ -324,7 +323,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
});
it('initially renders user actions list correctly', async () => {
@ -436,7 +435,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
});
it('should set the cases title', async () => {
@ -498,17 +497,17 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
});
afterEach(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
});
it('updates a custom field correctly', async () => {
const summary = await testSubjects.find(`case-text-custom-field-${customFields[0].key}`);
expect(await summary.getVisibleText()).equal('this is a text field value');
const textField = await testSubjects.find(`case-text-custom-field-${customFields[0].key}`);
expect(await textField.getVisibleText()).equal('this is a text field value');
const sync = await testSubjects.find(
const toggle = await testSubjects.find(
`case-toggle-custom-field-form-field-${customFields[1].key}`
);
expect(await sync.getAttribute('aria-checked')).equal('true');
expect(await toggle.getAttribute('aria-checked')).equal('true');
await testSubjects.click(`case-text-custom-field-edit-button-${customFields[0].key}`);
@ -526,19 +525,23 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
await testSubjects.click(`case-text-custom-field-submit-button-${customFields[0].key}`);
await header.waitUntilLoadingHasFinished();
await retry.waitFor('update toast exist', async () => {
return await testSubjects.exists('toastCloseButton');
});
await testSubjects.click('toastCloseButton');
await sync.click();
await header.waitUntilLoadingHasFinished();
await toggle.click();
await header.waitUntilLoadingHasFinished();
expect(await summary.getVisibleText()).equal('this is a text field value edited!!');
expect(await textField.getVisibleText()).equal('this is a text field value edited!!');
expect(await sync.getAttribute('aria-checked')).equal('false');
expect(await toggle.getAttribute('aria-checked')).equal('false');
// validate user action
const userActions = await find.allByCssSelector(

View file

@ -11,11 +11,7 @@ export default function ({ loadTestFile }: FtrProviderContext) {
describe('serverless security UI', function () {
loadTestFile(require.resolve('./ftr/landing_page'));
loadTestFile(require.resolve('./ftr/navigation'));
loadTestFile(require.resolve('./ftr/cases/attachment_framework'));
loadTestFile(require.resolve('./ftr/cases/view_case'));
loadTestFile(require.resolve('./ftr/cases/create_case_form'));
loadTestFile(require.resolve('./ftr/cases/configure'));
loadTestFile(require.resolve('./ftr/cases/list_view'));
loadTestFile(require.resolve('./ftr/cases'));
loadTestFile(require.resolve('./advanced_settings'));
loadTestFile(require.resolve('./ml'));
});

View file

@ -13,14 +13,14 @@ export const createOneCaseBeforeDeleteAllAfter = (
getService: FtrProviderContext['getService'],
owner: string
) => {
const cases = getService('cases');
const svlCases = getService('svlCases');
before(async () => {
await createAndNavigateToCase(getPageObject, getService, owner);
});
after(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
});
};
@ -29,14 +29,14 @@ export const createOneCaseBeforeEachDeleteAllAfterEach = (
getService: FtrProviderContext['getService'],
owner: string
) => {
const cases = getService('cases');
const svlCases = getService('svlCases');
beforeEach(async () => {
await createAndNavigateToCase(getPageObject, getService, owner);
});
afterEach(async () => {
await cases.api.deleteAllCases();
await svlCases.api.deleteAllCaseItems();
});
};