Skip to content

Commit

Permalink
fixing some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrdyn committed Nov 27, 2024
1 parent f10abac commit f9ba989
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@

import expect from '@kbn/expect';
import { DatasetQualityFtrProviderContext } from './config';
import { datasetNames, getInitialTestLogs, getLogsForDataset, productionNamespace } from './data';
import {
createFailedRecords,
datasetNames,
getInitialTestLogs,
getLogsForDataset,
productionNamespace,
} from './data';

export default function ({ getService, getPageObjects }: DatasetQualityFtrProviderContext) {
const PageObjects = getPageObjects([
Expand All @@ -19,6 +25,7 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
const synthtrace = getService('logSynthtraceEsClient');
const testSubjects = getService('testSubjects');
const to = '2024-01-01T12:00:00.000Z';
const failedDatasetName = 'synth.failed';
const apacheAccessDatasetName = 'apache.access';
const apacheAccessDatasetHumanName = 'Apache access logs';
const apacheIntegrationName = 'Apache HTTP Server';
Expand Down Expand Up @@ -50,6 +57,13 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
dataset: apacheAccessDatasetName,
namespace: productionNamespace,
}),
// Ingest Failed Logs
createFailedRecords({
to: new Date().toISOString(),
count: 10,
dataset: failedDatasetName,
rate: 0.5,
}),
]);
await PageObjects.datasetQuality.navigateTo();
});
Expand Down Expand Up @@ -143,15 +157,15 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
const expectedQuality = 'Poor';
// Get default quality
const cols = await PageObjects.datasetQuality.parseDatasetTable();
const datasetQuality = cols['Data Set Quality'];
const datasetQuality = cols['Data set quality'];
const datasetQualityCellTexts = await datasetQuality.getCellTexts();
expect(datasetQualityCellTexts).to.contain(expectedQuality);

// Filter for Poor quality
await PageObjects.datasetQuality.filterForQualities([expectedQuality]);

const colsAfterFilter = await PageObjects.datasetQuality.parseDatasetTable();
const datasetQualityAfterFilter = colsAfterFilter['Data Set Quality'];
const datasetQualityAfterFilter = colsAfterFilter['Data set quality'];
const datasetQualityCellTextsAfterFilter = await datasetQualityAfterFilter.getCellTexts();

expect(datasetQualityCellTextsAfterFilter).to.eql([expectedQuality]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import expect from '@kbn/expect';
import { createFailedRecords } from '@kbn/test-suites-xpack/functional/apps/dataset_quality/data';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { datasetNames, getInitialTestLogs, getLogsForDataset, productionNamespace } from './data';

Expand All @@ -20,6 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const synthtrace = getService('svlLogsSynthtraceClient');
const testSubjects = getService('testSubjects');
const to = '2024-01-01T12:00:00.000Z';
const failedDatasetName = 'synth.failed';
const apacheAccessDatasetName = 'apache.access';
const apacheAccessDatasetHumanName = 'Apache access logs';
const apacheIntegrationName = 'Apache HTTP Server';
Expand Down Expand Up @@ -51,6 +53,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
dataset: apacheAccessDatasetName,
namespace: productionNamespace,
}),
// Ingest Failed Logs
createFailedRecords({
to: new Date().toISOString(),
count: 10,
dataset: failedDatasetName,
rate: 0.5,
}),
]);
await PageObjects.svlCommonPage.loginWithPrivilegedRole();
await PageObjects.datasetQuality.navigateTo();
Expand Down Expand Up @@ -142,15 +151,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const expectedQuality = 'Poor';
// Get default quality
const cols = await PageObjects.datasetQuality.parseDatasetTable();
const datasetQuality = cols['Data Set Quality'];
const datasetQuality = cols['Data set quality'];
const datasetQualityCellTexts = await datasetQuality.getCellTexts();
expect(datasetQualityCellTexts).to.contain(expectedQuality);

// Filter for Poor quality
await PageObjects.datasetQuality.filterForQualities([expectedQuality]);

const colsAfterFilter = await PageObjects.datasetQuality.parseDatasetTable();
const datasetQualityAfterFilter = colsAfterFilter['Data Set Quality'];
const datasetQualityAfterFilter = colsAfterFilter['Data set quality'];
const datasetQualityCellTextsAfterFilter = await datasetQualityAfterFilter.getCellTexts();

expect(datasetQualityCellTextsAfterFilter).to.eql([expectedQuality]);
Expand Down

0 comments on commit f9ba989

Please sign in to comment.