Skip to content

Commit

Permalink
fix ml test
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Feb 3, 2021
1 parent 358e51a commit d035eab
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export function MachineLearningDataFrameAnalyticsResultsProvider({
},

async getResultTableRows() {
return await testSubjects.findAll('mlExplorationDataGrid loaded > dataGridRowCell');
return (await testSubjects.find('mlExplorationDataGrid loaded')).findAllByTestSubject(
'dataGridRowCell'
);
},

async assertResultsTableNotEmpty() {
Expand Down Expand Up @@ -87,6 +89,7 @@ export function MachineLearningDataFrameAnalyticsResultsProvider({
this.assertResultsTableNotEmpty();

const featureImportanceCell = await this.getFirstFeatureImportanceCell();
await featureImportanceCell.focus();
const interactionButton = await featureImportanceCell.findByTagName('button');

// simulate hover and wait for button to appear
Expand All @@ -100,11 +103,9 @@ export function MachineLearningDataFrameAnalyticsResultsProvider({

async getFirstFeatureImportanceCell(): Promise<WebElementWrapper> {
// get first row of the data grid
const firstDataGridRow = await testSubjects.find(
'mlExplorationDataGrid loaded > dataGridRow'
);
const dataGrid = await testSubjects.find('mlExplorationDataGrid loaded');
// find the feature importance cell in that row
const featureImportanceCell = await firstDataGridRow.findByCssSelector(
const featureImportanceCell = await dataGrid.findByCssSelector(
'[data-test-subj="dataGridRowCell"][class*="featureImportance"]'
);
return featureImportanceCell;
Expand Down

0 comments on commit d035eab

Please sign in to comment.