Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] Fix flaky test by closing options after use #64714

Merged
merged 2 commits into from
Apr 29, 2020
Merged
Changes from all commits
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