[8.9] [Files management] Fix flaky functional test (#162146) (#162305)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Files management] Fix flaky functional test
(#162146)](https://github.com/elastic/kibana/pull/162146)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Sébastien
Loix","email":"sebastien.loix@elastic.co"},"sourceCommit":{"committedDate":"2023-07-18T14:40:51Z","message":"[Files
management] Fix flaky functional test
(#162146)","sha":"fde21b15de69831e5b2b9f3df919b9d6d13ccebd","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:SharedUX","backport:prev-minor","v8.10.0"],"number":162146,"url":"https://github.com/elastic/kibana/pull/162146","mergeCommit":{"message":"[Files
management] Fix flaky functional test
(#162146)","sha":"fde21b15de69831e5b2b9f3df919b9d6d13ccebd"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/162146","number":162146,"mergeCommit":{"message":"[Files
management] Fix flaky functional test
(#162146)","sha":"fde21b15de69831e5b2b9f3df919b9d6d13ccebd"}}]}]
BACKPORT-->

Co-authored-by: Sébastien Loix <sebastien.loix@elastic.co>
This commit is contained in:
Kibana Machine 2023-07-20 05:43:12 -04:00 committed by GitHub
parent 667f868451
commit a5860bf113
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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