[ML] Modifies script for population analysis screenshot (#146393)

This PR adjusts the screenshot automation script to take the
`ml-population-results` screenshots with swim lanes visible.
This commit is contained in:
István Zoltán Szabó 2022-11-29 07:44:25 +01:00 committed by GitHub
parent 743bbdea84
commit 115c250a9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,6 @@ export default function ({ getService }: FtrProviderContext) {
const elasticChart = getService('elasticChart');
const ml = getService('ml');
const commonScreenshots = getService('commonScreenshots');
const testSubjects = getService('testSubjects');
const screenshotDirectories = ['ml_docs', 'anomaly_detection'];
@ -85,22 +84,12 @@ export default function ({ getService }: FtrProviderContext) {
await ml.jobTable.filterWithSearchString(populationJobConfig.job_id, 1);
await ml.jobTable.clickOpenJobInAnomalyExplorerButton(populationJobConfig.job_id);
await ml.commonUI.waitForMlLoadingIndicatorToDisappear();
await ml.testExecution.logTestStep('open tooltip and take screenshot');
const viewBySwimLanes = await testSubjects.find(viewBySwimLaneTestSubj);
const cells = await ml.swimLane.getCells(viewBySwimLaneTestSubj);
const sampleCell = cells[0];
await viewBySwimLanes.moveMouseTo({
xOffset: Math.floor(cellSize / 2.0),
yOffset: Math.floor(cellSize / 2.0),
});
await commonScreenshots.takeScreenshot('ml-population-results', screenshotDirectories);
await ml.testExecution.logTestStep(
'select swim lane tile, expand anomaly row and take screenshot'
);
const cells = await ml.swimLane.getCells(viewBySwimLaneTestSubj);
const sampleCell = cells[0];
await ml.swimLane.selectSingleCell(viewBySwimLaneTestSubj, {
x: sampleCell.x + cellSize,
y: sampleCell.y + cellSize,