Fix delete permissions flaky test (#141204) (#141352)

(cherry picked from commit de74a6ba52)

Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
This commit is contained in:
Kibana Machine 2022-09-23 05:31:26 -06:00 committed by GitHub
parent 6d10e8aaf4
commit d73b9f69cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View file

@ -20,7 +20,13 @@ export function CasesSingleViewServiceProvider({ getService, getPageObject }: Ft
return {
async deleteCase() {
await common.clickAndValidate('property-actions-ellipses', 'property-actions-trash');
const caseActions = await testSubjects.findDescendant(
'property-actions-ellipses',
await testSubjects.find('case-view-actions')
);
await caseActions.click();
await testSubjects.existOrFail('property-actions-trash');
await common.clickAndValidate('property-actions-trash', 'confirmModalConfirmButton');
await testSubjects.click('confirmModalConfirmButton');
await header.waitUntilLoadingHasFinished();

View file

@ -60,6 +60,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
it(`User ${user.username} can delete a case while on a specific case page`, async () => {
await cases.singleCase.deleteCase();
await cases.casesTable.waitForTableToFinishLoading();
await cases.casesTable.validateCasesTableHasNthRows(1);
});
});

View file

@ -167,6 +167,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
it('deletes the case successfully', async () => {
await cases.singleCase.deleteCase();
await cases.casesTable.waitForTableToFinishLoading();
await cases.casesTable.validateCasesTableHasNthRows(0);
});
});