Fix serverless attachment framework tests for MKI (#175085)

## Summary

This PR fixes the cases attachment framework tests for MKI runs with
search projects.

### Details

- Recently, a refresh of the default data view field list has been added
(as part of field caps caching)
- However, during test run time, this data view does not necessarily
exist anymore (might have been cleaned up by an earlier test)
- This was the case for our MKI test runs (where tests run in a
different order / in different groups than in CI, which made the test
fail
- This introduced an optional parameter to ignore a missing data view
when `refreshDataViewFieldList` is called, which allows us to just move
on in that scenario
This commit is contained in:
Robert Oskamp 2024-01-18 13:09:25 +01:00 committed by GitHub
parent 51b8993963
commit bc9706577e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -494,10 +494,19 @@ export class SettingsPageObject extends FtrService {
await customDataViewIdInput.type(value);
}
async refreshDataViewFieldList(dataViewName?: string) {
async refreshDataViewFieldList(
dataViewName?: string,
options: { ignoreMissing?: boolean } = { ignoreMissing: false }
) {
if (dataViewName) {
await this.common.navigateToApp('management/kibana/dataViews');
await this.header.waitUntilLoadingHasFinished();
if (
options.ignoreMissing &&
(await this.testSubjects.exists(`detail-link-${dataViewName}`)) === false
) {
return;
}
await this.testSubjects.click(`detail-link-${dataViewName}`);
}
await this.testSubjects.click('refreshDataViewButton');

View file

@ -34,7 +34,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json'
);
await settings.refreshDataViewFieldList('default:all-data');
await settings.refreshDataViewFieldList('default:all-data', { ignoreMissing: true });
await svlSearchNavigation.navigateToLandingPage();