FIx [test-failed]: Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/lens/group1/persistent_context·ts - lens app - group 1 lens query context keeps selected index pattern after refresh (#134039)

This commit is contained in:
Alexey Antonov 2022-06-10 11:26:58 +03:00 committed by GitHub
parent 6f2a7f487c
commit cb71390ed5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View file

@ -34,7 +34,18 @@ export class UnifiedSearchPageObject extends FtrService {
await this.retry.waitFor(
'wait for updating switcher',
async () => (await this.testSubjects.getVisibleText(switchButtonSelector)) === dataViewTitle
async () => (await this.getSelectedDataView(switchButtonSelector)) === dataViewTitle
);
}
public async getSelectedDataView(switchButtonSelector: string) {
let visibleText = '';
await this.retry.waitFor('wait for updating switcher', async () => {
visibleText = await this.testSubjects.getVisibleText(switchButtonSelector);
return Boolean(visibleText);
});
return visibleText;
}
}

View file

@ -860,14 +860,14 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
* Returns the current index pattern of the data panel
*/
async getDataPanelIndexPattern() {
return await (await testSubjects.find('lns-dataView-switch-link')).getAttribute('title');
return await PageObjects.unifiedSearch.getSelectedDataView('lns-dataView-switch-link');
},
/**
* Returns the current index pattern of the first layer
*/
async getFirstLayerIndexPattern() {
return await (await testSubjects.find('lns_layerIndexPatternLabel')).getAttribute('title');
return await PageObjects.unifiedSearch.getSelectedDataView('lns_layerIndexPatternLabel');
},
async linkedToOriginatingApp() {