Skip to content

Commit

Permalink
[Files management] Fix flaky functional test (#162146)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga authored Jul 18, 2023
1 parent e1b4910 commit fde21b1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/functional/apps/management/_files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* Side Public License, v 1.
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'filesManagement']);
const testSubjects = getService('testSubjects');
const retry = getService('retry');

describe('Files management', () => {
before(async () => {
Expand All @@ -21,9 +21,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
it(`should render an empty prompt`, async () => {
await testSubjects.existOrFail('filesManagementApp');

const pageText = await (await testSubjects.find('filesManagementApp')).getVisibleText();

expect(pageText).to.contain('No files found');
await retry.waitFor('Render empty files prompt', async () => {
const pageText = await (await testSubjects.find('filesManagementApp')).getVisibleText();
return pageText.includes('No files found');
});
});
});
}

0 comments on commit fde21b1

Please sign in to comment.