mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Fix Failing test: X-Pack CCS Tests.x-pack/test/functional/apps/lens/roup1/smokescreen·ts - lens app - group 1 lens smokescreen tests should allow to change index pattern (#133015) (#135398)
* Fix Failing test: X-Pack CCS Tests.x-pack/test/functional/apps/lens/group1/smokescreen·ts - lens app - group 1 lens smokescreen tests should allow to change index pattern
* fix CI
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 0ac9a7c802
)
Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
This commit is contained in:
parent
98609f54af
commit
a4f8dc60ed
3 changed files with 19 additions and 6 deletions
|
@ -56,6 +56,7 @@ export function DataViewsList({
|
|||
placeholder: i18n.translate('unifiedSearch.query.queryBar.indexPattern.findDataView', {
|
||||
defaultMessage: 'Find a data view',
|
||||
}),
|
||||
'data-test-subj': 'indexPattern-switcher--input',
|
||||
...(selectableProps ? selectableProps.searchProps : undefined),
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -10,6 +10,7 @@ import { FtrService } from '../ftr_provider_context';
|
|||
|
||||
export class UnifiedSearchPageObject extends FtrService {
|
||||
private readonly browser = this.ctx.getService('browser');
|
||||
private readonly retry = this.ctx.getService('retry');
|
||||
private readonly testSubjects = this.ctx.getService('testSubjects');
|
||||
|
||||
public async closeTour() {
|
||||
|
@ -23,4 +24,17 @@ export class UnifiedSearchPageObject extends FtrService {
|
|||
await this.browser.setLocalStorageItem('data.newDataViewMenu', 'true');
|
||||
await this.browser.refresh();
|
||||
}
|
||||
|
||||
public async switchDataView(switchButtonSelector: string, dataViewTitle: string) {
|
||||
await this.testSubjects.click(switchButtonSelector);
|
||||
|
||||
const indexPatternSwitcher = await this.testSubjects.find('indexPattern-switcher', 500);
|
||||
await this.testSubjects.setValue('indexPattern-switcher--input', dataViewTitle);
|
||||
await (await indexPatternSwitcher.findByCssSelector(`[title="${dataViewTitle}"]`)).click();
|
||||
|
||||
await this.retry.waitFor(
|
||||
'wait for updating switcher',
|
||||
async () => (await this.testSubjects.getVisibleText(switchButtonSelector)) === dataViewTitle
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -841,18 +841,16 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
|
|||
/**
|
||||
* Changes the index pattern in the data panel
|
||||
*/
|
||||
async switchDataPanelIndexPattern(name: string) {
|
||||
await testSubjects.click('lns-dataView-switch-link');
|
||||
await find.clickByCssSelector(`[title="${name}"]`);
|
||||
async switchDataPanelIndexPattern(dataViewTitle: string) {
|
||||
await PageObjects.unifiedSearch.switchDataView('lns-dataView-switch-link', dataViewTitle);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
},
|
||||
|
||||
/**
|
||||
* Changes the index pattern for the first layer
|
||||
*/
|
||||
async switchFirstLayerIndexPattern(name: string) {
|
||||
await testSubjects.click('lns_layerIndexPatternLabel');
|
||||
await find.clickByCssSelector(`.lnsChangeIndexPatternPopover [title="${name}"]`);
|
||||
async switchFirstLayerIndexPattern(dataViewTitle: string) {
|
||||
await PageObjects.unifiedSearch.switchDataView('lns_layerIndexPatternLabel', dataViewTitle);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue