mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 10:23:14 -04:00
[ML] Fix bucket span initialisation on the Anomaly Explorer page (#133366)
* fix filter condition * add functional tests for browser refresh * waitForSwimLanesToLoad
This commit is contained in:
parent
e2336ff312
commit
91925d974a
2 changed files with 31 additions and 1 deletions
|
@ -732,7 +732,7 @@ export class AnomalyTimelineStateService extends StateService {
|
||||||
|
|
||||||
public getSwimLaneBucketInterval$(): Observable<TimeBucketsInterval> {
|
public getSwimLaneBucketInterval$(): Observable<TimeBucketsInterval> {
|
||||||
return this._swimLaneBucketInterval$.pipe(
|
return this._swimLaneBucketInterval$.pipe(
|
||||||
filter((v): v is TimeBucketsInterval => !v),
|
filter((v): v is TimeBucketsInterval => !!v),
|
||||||
distinctUntilChanged((prev, curr) => {
|
distinctUntilChanged((prev, curr) => {
|
||||||
return prev.asSeconds() === curr.asSeconds();
|
return prev.asSeconds() === curr.asSeconds();
|
||||||
})
|
})
|
||||||
|
|
|
@ -62,6 +62,7 @@ export default function ({ getService }: FtrProviderContext) {
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
const ml = getService('ml');
|
const ml = getService('ml');
|
||||||
const elasticChart = getService('elasticChart');
|
const elasticChart = getService('elasticChart');
|
||||||
|
const browser = getService('browser');
|
||||||
|
|
||||||
describe('anomaly explorer', function () {
|
describe('anomaly explorer', function () {
|
||||||
this.tags(['ml']);
|
this.tags(['ml']);
|
||||||
|
@ -213,6 +214,19 @@ export default function ({ getService }: FtrProviderContext) {
|
||||||
'selectedLanes%3A!(Overall)%2CselectedTimes%3A!(1454846400%2C1454860800)%2CselectedType%3Aoverall%2CshowTopFieldValues%3A!t'
|
'selectedLanes%3A!(Overall)%2CselectedTimes%3A!(1454846400%2C1454860800)%2CselectedType%3Aoverall%2CshowTopFieldValues%3A!t'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
await ml.testExecution.logTestStep('restores app state from the URL state');
|
||||||
|
await browser.refresh();
|
||||||
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
|
await ml.swimLane.waitForSwimLanesToLoad();
|
||||||
|
await ml.swimLane.assertSelection(overallSwimLaneTestSubj, {
|
||||||
|
x: [1454846400000, 1454860800000],
|
||||||
|
y: ['Overall'],
|
||||||
|
});
|
||||||
|
await ml.swimLane.assertAxisLabels(viewBySwimLaneTestSubj, 'y', ['EGF', 'DAL']);
|
||||||
|
await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(5);
|
||||||
|
await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 2);
|
||||||
|
await ml.anomaliesTable.assertTableRowsCount(4);
|
||||||
|
|
||||||
await ml.testExecution.logTestStep('clears the selection');
|
await ml.testExecution.logTestStep('clears the selection');
|
||||||
await ml.anomalyExplorer.clearSwimLaneSelection();
|
await ml.anomalyExplorer.clearSwimLaneSelection();
|
||||||
await ml.swimLane.waitForSwimLanesToLoad();
|
await ml.swimLane.waitForSwimLanesToLoad();
|
||||||
|
@ -274,6 +288,22 @@ export default function ({ getService }: FtrProviderContext) {
|
||||||
y: ['Overall'],
|
y: ['Overall'],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await ml.testExecution.logTestStep('restores app state from the URL state');
|
||||||
|
await browser.refresh();
|
||||||
|
await elasticChart.setNewChartUiDebugFlag(true);
|
||||||
|
await ml.swimLane.waitForSwimLanesToLoad();
|
||||||
|
await ml.swimLane.assertSelection(viewBySwimLaneTestSubj, {
|
||||||
|
x: [1454817600000, 1454832000000],
|
||||||
|
y: ['AAL'],
|
||||||
|
});
|
||||||
|
await ml.anomaliesTable.assertTableRowsCount(1);
|
||||||
|
await ml.anomalyExplorer.assertInfluencerFieldListLength('airline', 1);
|
||||||
|
await ml.anomalyExplorer.assertAnomalyExplorerChartsCount(1);
|
||||||
|
await ml.swimLane.assertSelection(overallSwimLaneTestSubj, {
|
||||||
|
x: [1454817600000, 1454832000000],
|
||||||
|
y: ['Overall'],
|
||||||
|
});
|
||||||
|
|
||||||
await ml.testExecution.logTestStep('clears the selection');
|
await ml.testExecution.logTestStep('clears the selection');
|
||||||
await ml.anomalyExplorer.clearSwimLaneSelection();
|
await ml.anomalyExplorer.clearSwimLaneSelection();
|
||||||
await ml.swimLane.waitForSwimLanesToLoad();
|
await ml.swimLane.waitForSwimLanesToLoad();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue