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

fix functional tests #127979

Merged
merged 2 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions x-pack/test/functional/apps/lens/add_to_dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await listingTable.searchForItemWithName('Artistpreviouslyknownaslens');
await PageObjects.lens.clickVisualizeListItemTitle('Artistpreviouslyknownaslens');
await PageObjects.lens.goToTimeRange();
await PageObjects.lens.waitForVisualization('mtrVis');
await PageObjects.lens.assertMetric('Maximum of bytes', '19,986');
};

Expand Down
20 changes: 11 additions & 9 deletions x-pack/test/functional/apps/lens/runtime_fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visualize.clickVisType('lens');
await PageObjects.lens.goToTimeRange();
await PageObjects.lens.switchToVisualization('lnsDatatable');
await PageObjects.lens.clickAddField();
await fieldEditor.setName('runtimefield');
await fieldEditor.enableValue();
await fieldEditor.typeScript("emit('abc')");
await fieldEditor.save();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.searchField('runtime');
await PageObjects.lens.waitForField('runtimefield');
await PageObjects.lens.dragFieldToWorkspace('runtimefield');
await retry.try(async () => {
await PageObjects.lens.clickAddField();
await fieldEditor.setName('runtimefield');
await fieldEditor.enableValue();
await fieldEditor.typeScript("emit('abc')");
await fieldEditor.save();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.lens.searchField('runtime');
await PageObjects.lens.waitForField('runtimefield');
await PageObjects.lens.dragFieldToWorkspace('runtimefield');
});
await PageObjects.lens.waitForVisualization();
expect(await PageObjects.lens.getDatatableHeaderText(0)).to.equal(
'Top values of runtimefield'
Expand Down
4 changes: 1 addition & 3 deletions x-pack/test/functional/page_objects/lens_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
},

async waitForField(field: string) {
await retry.try(async () => {
await testSubjects.existOrFail(`lnsFieldListPanelField-${field}`);
});
await testSubjects.existOrFail(`lnsFieldListPanelField-${field}`);
},

async waitForMissingDataViewWarning() {
Expand Down