Skip to content

Commit ee4f8a5

Browse files
committed
Apply new structure to data visualizer tests
1 parent 47b1d9d commit ee4f8a5

File tree

2 files changed

+51
-50
lines changed

2 files changed

+51
-50
lines changed

x-pack/test/functional/apps/ml/data_visualizer/file_data_visualizer.ts

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,56 +47,49 @@ export default function ({ getService }: FtrProviderContext) {
4747
await ml.api.deleteIndices(testData.indexName);
4848
});
4949

50-
it('loads the data visualizer selector page', async () => {
50+
it('displays and imports a file', async () => {
51+
await ml.testExecution.logTestStep('loads the data visualizer selector page');
5152
await ml.navigation.navigateToDataVisualizer();
52-
});
5353

54-
it('loads the file upload page', async () => {
54+
await ml.testExecution.logTestStep('loads the file upload page');
5555
await ml.dataVisualizer.navigateToFileUpload();
56-
});
5756

58-
it('selects a file and loads visualizer results', async () => {
57+
await ml.testExecution.logTestStep('selects a file and loads visualizer results');
5958
await ml.dataVisualizerFileBased.selectFile(testData.filePath);
60-
});
6159

62-
it('displays the components of the file details page', async () => {
60+
await ml.testExecution.logTestStep('displays the components of the file details page');
6361
await ml.dataVisualizerFileBased.assertFileTitle(testData.expected.results.title);
6462
await ml.dataVisualizerFileBased.assertFileContentPanelExists();
6563
await ml.dataVisualizerFileBased.assertSummaryPanelExists();
6664
await ml.dataVisualizerFileBased.assertFileStatsPanelExists();
67-
});
6865

69-
it('loads the import settings page', async () => {
66+
await ml.testExecution.logTestStep('loads the import settings page');
7067
await ml.dataVisualizerFileBased.navigateToFileImport();
71-
});
7268

73-
it('sets the index name', async () => {
69+
await ml.testExecution.logTestStep('sets the index name');
7470
await ml.dataVisualizerFileBased.setIndexName(testData.indexName);
75-
});
7671

77-
it('sets the create index pattern checkbox', async () => {
72+
await ml.testExecution.logTestStep('sets the create index pattern checkbox');
7873
await ml.dataVisualizerFileBased.setCreateIndexPatternCheckboxState(
7974
testData.createIndexPattern
8075
);
81-
});
8276

83-
it('imports the file', async () => {
77+
await ml.testExecution.logTestStep('imports the file');
8478
await ml.dataVisualizerFileBased.startImportAndWaitForProcessing();
8579
});
8680
});
8781
}
8882

8983
for (const testData of testDataListNegative) {
9084
describe(testData.suiteSuffix, function () {
91-
it('loads the data visualizer selector page', async () => {
85+
it('does not import an invalid file', async () => {
86+
await ml.testExecution.logTestStep('loads the data visualizer selector page');
9287
await ml.navigation.navigateToDataVisualizer();
93-
});
9488

95-
it('loads the file upload page', async () => {
89+
await ml.testExecution.logTestStep('loads the file upload page');
9690
await ml.dataVisualizer.navigateToFileUpload();
97-
});
9891

99-
it('selects a file and displays an error', async () => {
92+
await ml.testExecution.logTestStep('selects a file and displays an error');
10093
await ml.dataVisualizerFileBased.selectFile(testData.filePath, true);
10194
});
10295
});

x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer.ts

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -292,67 +292,74 @@ export default function ({ getService }: FtrProviderContext) {
292292
};
293293

294294
function runTests(testData: TestData) {
295-
it(`${testData.suiteTitle} loads the saved search selection page`, async () => {
295+
it(`${testData.suiteTitle} loads the source data in the data visualizer`, async () => {
296+
await ml.testExecution.logTestStep(
297+
`${testData.suiteTitle} loads the saved search selection page`
298+
);
296299
await ml.dataVisualizer.navigateToIndexPatternSelection();
297-
});
298300

299-
it(`${testData.suiteTitle} loads the index data visualizer page`, async () => {
301+
await ml.testExecution.logTestStep(
302+
`${testData.suiteTitle} loads the index data visualizer page`
303+
);
300304
await ml.jobSourceSelection.selectSourceForIndexBasedDataVisualizer(
301305
testData.sourceIndexOrSavedSearch
302306
);
303307
});
304308

305-
it(`${testData.suiteTitle} displays the time range step`, async () => {
309+
it(`${testData.suiteTitle} displays index details`, async () => {
310+
await ml.testExecution.logTestStep(`${testData.suiteTitle} displays the time range step`);
306311
await ml.dataVisualizerIndexBased.assertTimeRangeSelectorSectionExists();
307-
});
308312

309-
it(`${testData.suiteTitle} loads data for full time range`, async () => {
313+
await ml.testExecution.logTestStep(`${testData.suiteTitle} loads data for full time range`);
310314
await ml.dataVisualizerIndexBased.clickUseFullDataButton(testData.expected.totalDocCount);
311-
});
312315

313-
it(`${testData.suiteTitle} displays the panels of fields`, async () => {
316+
await ml.testExecution.logTestStep(`${testData.suiteTitle} displays the panels of fields`);
314317
await ml.dataVisualizerIndexBased.assertFieldsPanelsExist(testData.expected.fieldsPanelCount);
315-
});
316318

317-
if (testData.expected.metricCards !== undefined && testData.expected.metricCards.length > 0) {
318-
it(`${testData.suiteTitle} displays the Metrics panel`, async () => {
319+
if (testData.expected.metricCards !== undefined && testData.expected.metricCards.length > 0) {
320+
await ml.testExecution.logTestStep(`${testData.suiteTitle} displays the Metrics panel`);
319321
await ml.dataVisualizerIndexBased.assertFieldsPanelForTypesExist([
320322
ML_JOB_FIELD_TYPES.NUMBER,
321323
]); // document_count not exposed as a type in the panel
322-
});
323324

324-
it(`${testData.suiteTitle} displays the expected metric field cards`, async () => {
325+
await ml.testExecution.logTestStep(
326+
`${testData.suiteTitle} displays the expected metric field cards`
327+
);
325328
for (const fieldCard of testData.expected.metricCards as FieldVisConfig[]) {
326329
await ml.dataVisualizerIndexBased.assertCardExists(fieldCard.type, fieldCard.fieldName);
327330
}
328-
});
329331

330-
it(`${testData.suiteTitle} filters metric fields cards with search`, async () => {
332+
await ml.testExecution.logTestStep(
333+
`${testData.suiteTitle} filters metric fields cards with search`
334+
);
331335
await ml.dataVisualizerIndexBased.filterFieldsPanelWithSearchString(
332336
['number'],
333337
testData.metricFieldsFilter,
334338
testData.expected.metricFieldsFilterCardCount
335339
);
336-
});
337-
}
340+
}
338341

339-
if (
340-
testData.expected.nonMetricCards !== undefined &&
341-
testData.expected.nonMetricCards.length > 0
342-
) {
343-
it(`${testData.suiteTitle} displays the non-metric Fields panel`, async () => {
342+
if (
343+
testData.expected.nonMetricCards !== undefined &&
344+
testData.expected.nonMetricCards.length > 0
345+
) {
346+
await ml.testExecution.logTestStep(
347+
`${testData.suiteTitle} displays the non-metric Fields panel`
348+
);
344349
await ml.dataVisualizerIndexBased.assertFieldsPanelForTypesExist(
345350
getFieldTypes(testData.expected.nonMetricCards as FieldVisConfig[])
346351
);
347-
});
348352

349-
it(`${testData.suiteTitle} displays the expected non-metric field cards`, async () => {
353+
await ml.testExecution.logTestStep(
354+
`${testData.suiteTitle} displays the expected non-metric field cards`
355+
);
350356
for (const fieldCard of testData.expected.nonMetricCards!) {
351357
await ml.dataVisualizerIndexBased.assertCardExists(fieldCard.type, fieldCard.fieldName);
352358
}
353-
});
354359

355-
it(`${testData.suiteTitle} sets the non metric field types input`, async () => {
360+
await ml.testExecution.logTestStep(
361+
`${testData.suiteTitle} sets the non metric field types input`
362+
);
356363
const fieldTypes: ML_JOB_FIELD_TYPES[] = getFieldTypes(
357364
testData.expected.nonMetricCards as FieldVisConfig[]
358365
);
@@ -362,16 +369,17 @@ export default function ({ getService }: FtrProviderContext) {
362369
testData.nonMetricFieldsTypeFilter,
363370
testData.expected.nonMetricFieldsTypeFilterCardCount
364371
);
365-
});
366372

367-
it(`${testData.suiteTitle} filters non-metric fields cards with search`, async () => {
373+
await ml.testExecution.logTestStep(
374+
`${testData.suiteTitle} filters non-metric fields cards with search`
375+
);
368376
await ml.dataVisualizerIndexBased.filterFieldsPanelWithSearchString(
369377
getFieldTypes(testData.expected.nonMetricCards as FieldVisConfig[]),
370378
testData.nonMetricFieldsFilter,
371379
testData.expected.nonMetricFieldsFilterCardCount
372380
);
373-
});
374-
}
381+
}
382+
});
375383
}
376384

377385
describe('index based', function () {

0 commit comments

Comments
 (0)