Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions x-pack/test/functional/page_objects/lens_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const find = getService('find');
const comboBox = getService('comboBox');
const PageObjects = getPageObjects([
'header',
'common',
Expand Down Expand Up @@ -107,20 +108,17 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
* @param opts.operation - the desired operation ID for the dimension
* @param opts.field - the desired field for the dimension
*/
async configureDimension(opts: { dimension: string; operation?: string; field?: string }) {
async configureDimension(opts: { dimension: string; operation: string; field: string }) {
await find.clickByCssSelector(opts.dimension);

if (opts.operation) {
await find.clickByCssSelector(
`[data-test-subj="lns-indexPatternDimensionIncompatible-${opts.operation}"],
[data-test-subj="lns-indexPatternDimension-${opts.operation}"]`
);
}
await find.clickByCssSelector(
`[data-test-subj="lns-indexPatternDimensionIncompatible-${opts.operation}"],
[data-test-subj="lns-indexPatternDimension-${opts.operation}"]`
);

if (opts.field) {
await testSubjects.click('indexPattern-dimension-field');
await testSubjects.click(`lns-fieldOption-${opts.field}`);
}
const target = await testSubjects.find('indexPattern-dimension-field');
await comboBox.openOptionsList(target);
await comboBox.setElement(target, opts.field);
},

/**
Expand Down