Skip to content

Commit

Permalink
assert read ml access
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Feb 7, 2022
1 parent 653ff25 commit dfb8ba3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
31 changes: 25 additions & 6 deletions x-pack/test/functional/apps/ml/permissions/read_ml_access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,51 @@ export default function ({ getService }: FtrProviderContext) {
await ml.navigation.assertOverviewTabEnabled(true);

await ml.testExecution.logTestStep(
'should display the enabled "Anomaly Detection" tab'
'should display the enabled "Anomaly Detection" section correctly'
);
await ml.navigation.assertAnomalyDetectionTabEnabled(true);
await ml.navigation.assertAnomalyExplorerNavItemEnabled(true);
await ml.navigation.assertSingleMetricViewerNavItemEnabled(true);
await ml.navigation.assertSettingsTabEnabled(true);

await ml.testExecution.logTestStep(
'should display the enabled "Data Frame Analytics" tab'
'should display the enabled "Data Frame Analytics" section'
);
await ml.navigation.assertDataFrameAnalyticsTabEnabled(true);

await ml.testExecution.logTestStep('should display the enabled "Data Visualizer" tab');
await ml.navigation.assertDataVisualizerTabEnabled(true);
await ml.testExecution.logTestStep(
'should display the enabled "Model Management" section'
);
await ml.navigation.assertTrainedModelsNavItemEnabled(true);
await ml.navigation.assertNodesNavItemEnabled(false);

await ml.testExecution.logTestStep('should display the enabled "Settings" tab');
await ml.navigation.assertSettingsTabEnabled(true);
await ml.testExecution.logTestStep(
'should display the enabled "Data Visualizer" section'
);
await ml.navigation.assertDataVisualizerTabEnabled(true);
await ml.navigation.assertFileDataVisualizerNavItemEnabled(true);
await ml.navigation.assertIndexDataVisualizerNavItemEnabled(true);
});

it('should display elements on ML Overview page correctly', async () => {
await ml.testExecution.logTestStep('should load the ML overview page');
await ml.navigation.navigateToMl();
await ml.navigation.navigateToOverview();

await ml.testExecution.logTestStep('should display a welcome callout');
await ml.overviewPage.assertGettingStartedCalloutVisible(true);
await ml.overviewPage.dismissGettingStartedCallout();

await ml.testExecution.logTestStep('should not display ML Nodes panel');
await ml.mlNodesPanel.assertNodesOverviewPanelExists(false);

await ml.testExecution.logTestStep('should display disabled AD create job button');
await ml.overviewPage.assertADEmptyStateExists();
await ml.overviewPage.assertADCreateJobButtonExists();
await ml.overviewPage.assertADCreateJobButtonEnabled(false);

await ml.testExecution.logTestStep('should display disabled DFA create job button');
await ml.overviewPage.assertDFAEmptyStateExists();
await ml.overviewPage.assertDFACreateJobButtonExists();
await ml.overviewPage.assertDFACreateJobButtonEnabled(false);
});
Expand Down
8 changes: 6 additions & 2 deletions x-pack/test/functional/services/ml/ml_nodes_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ export function MlNodesPanelProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');

return {
async assertNodesOverviewPanelExists() {
await testSubjects.existOrFail('mlNodesOverviewPanel');
async assertNodesOverviewPanelExists(expectPanelExits: boolean = true) {
if (expectPanelExits) {
await testSubjects.existOrFail('mlNodesOverviewPanel');
} else {
await testSubjects.missingOrFail('mlNodesOverviewPanel');
}
},

async assertNodesListLoaded() {
Expand Down

0 comments on commit dfb8ba3

Please sign in to comment.