Skip to content

Commit

Permalink
[8.5] [ML] Modifies script for population analysis screenshot (#146393)…
Browse files Browse the repository at this point in the history
… (#146495)

# Backport

This will backport the following commits from `main` to `8.5`:
- [[ML] Modifies script for population analysis screenshot
(#146393)](#146393)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"István Zoltán
Szabó","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-11-29T06:44:25Z","message":"[ML]
Modifies script for population analysis screenshot (#146393)\n\nThis PR
adjusts the screenshot automation script to take
the\r\n`ml-population-results` screenshots with swim lanes
visible.","sha":"115c250a9b79f552395e75b5534d86acc8789597","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","v8.7.0","v8.5.3","v8.6.1"],"number":146393,"url":"https://github.com/elastic/kibana/pull/146393","mergeCommit":{"message":"[ML]
Modifies script for population analysis screenshot (#146393)\n\nThis PR
adjusts the screenshot automation script to take
the\r\n`ml-population-results` screenshots with swim lanes
visible.","sha":"115c250a9b79f552395e75b5534d86acc8789597"}},"sourceBranch":"main","suggestedTargetBranches":["8.5","8.6"],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146393","number":146393,"mergeCommit":{"message":"[ML]
Modifies script for population analysis screenshot (#146393)\n\nThis PR
adjusts the screenshot automation script to take
the\r\n`ml-population-results` screenshots with swim lanes
visible.","sha":"115c250a9b79f552395e75b5534d86acc8789597"}},{"branch":"8.5","label":"v8.5.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.6","label":"v8.6.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: István Zoltán Szabó <[email protected]>
  • Loading branch information
kibanamachine and szabosteve authored Nov 29, 2022
1 parent 8af4e2e commit c7f2e04
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c7f2e04

Please sign in to comment.