[ML] Functional tests - stabilize anomaly charts embeddables test (#97452)
This PR stabilizes the anomaly charts embeddables test by adding a retry.
This commit is contained in:
parent
e4bbdda129
commit
a3c2aebb9f
|
@ -58,7 +58,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const esArchiver = getService('esArchiver');
|
||||
const ml = getService('ml');
|
||||
const PageObjects = getPageObjects(['common', 'timePicker', 'dashboard']);
|
||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||
const a11y = getService('a11y'); /* this is the wrapping service around axe */
|
||||
|
||||
describe('machine learning embeddables anomaly charts', function () {
|
||||
|
@ -96,10 +95,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
it('can open job selection flyout', async () => {
|
||||
await PageObjects.dashboard.clickCreateDashboardPrompt();
|
||||
await ml.dashboardEmbeddables.assertDashboardIsEmpty();
|
||||
await dashboardAddPanel.clickEditorMenuButton();
|
||||
await dashboardAddPanel.clickEmbeddableFactoryGroupButton('ml');
|
||||
await dashboardAddPanel.clickAddNewEmbeddableLink('ml_anomaly_charts');
|
||||
await ml.dashboardJobSelectionTable.assertJobSelectionTableExists();
|
||||
await ml.dashboardEmbeddables.openJobSelectionFlyout();
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const esArchiver = getService('esArchiver');
|
||||
const ml = getService('ml');
|
||||
const PageObjects = getPageObjects(['common', 'timePicker', 'dashboard']);
|
||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||
|
||||
describe('anomaly charts', function () {
|
||||
this.tags(['mlqa']);
|
||||
|
@ -87,10 +86,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
it('can open job selection flyout', async () => {
|
||||
await PageObjects.dashboard.clickCreateDashboardPrompt();
|
||||
await ml.dashboardEmbeddables.assertDashboardIsEmpty();
|
||||
await dashboardAddPanel.clickEditorMenuButton();
|
||||
await dashboardAddPanel.clickEmbeddableFactoryGroupButton('ml');
|
||||
await dashboardAddPanel.clickAddNewEmbeddableLink('ml_anomaly_charts');
|
||||
await ml.dashboardJobSelectionTable.assertJobSelectionTableExists();
|
||||
await ml.dashboardEmbeddables.openJobSelectionFlyout();
|
||||
});
|
||||
|
||||
it('can select jobs', async () => {
|
||||
|
|
|
@ -8,14 +8,17 @@
|
|||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
import { MlCommonUI } from './common_ui';
|
||||
import { MlDashboardJobSelectionTable } from './dashboard_job_selection_table';
|
||||
|
||||
export function MachineLearningDashboardEmbeddablesProvider(
|
||||
{ getService }: FtrProviderContext,
|
||||
mlCommonUI: MlCommonUI
|
||||
mlCommonUI: MlCommonUI,
|
||||
mlDashboardJobSelectionTable: MlDashboardJobSelectionTable
|
||||
) {
|
||||
const retry = getService('retry');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const find = getService('find');
|
||||
const dashboardAddPanel = getService('dashboardAddPanel');
|
||||
|
||||
return {
|
||||
async assertAnomalyChartsEmbeddableInitializerExists() {
|
||||
|
@ -91,5 +94,17 @@ export function MachineLearningDashboardEmbeddablesProvider(
|
|||
async assertAnomalyChartsExists() {
|
||||
await testSubjects.existOrFail(`mlExplorerChartsContainer`);
|
||||
},
|
||||
|
||||
async openJobSelectionFlyout() {
|
||||
await retry.tryForTime(60 * 1000, async () => {
|
||||
await dashboardAddPanel.clickEditorMenuButton();
|
||||
await testSubjects.existOrFail('dashboardEditorContextMenu', { timeout: 2000 });
|
||||
|
||||
await dashboardAddPanel.clickEmbeddableFactoryGroupButton('ml');
|
||||
await dashboardAddPanel.clickAddNewEmbeddableLink('ml_anomaly_charts');
|
||||
|
||||
await mlDashboardJobSelectionTable.assertJobSelectionTableExists();
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,8 +6,13 @@
|
|||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { ProvidedType } from '@kbn/test/types/ftr';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
|
||||
export type MlDashboardJobSelectionTable = ProvidedType<
|
||||
typeof MachineLearningDashboardJobSelectionTableProvider
|
||||
>;
|
||||
|
||||
export function MachineLearningDashboardJobSelectionTableProvider({
|
||||
getService,
|
||||
}: FtrProviderContext) {
|
||||
|
@ -16,8 +21,8 @@ export function MachineLearningDashboardJobSelectionTableProvider({
|
|||
|
||||
return {
|
||||
async assertJobSelectionTableExists(): Promise<void> {
|
||||
await retry.tryForTime(5000, async () => {
|
||||
await testSubjects.existOrFail('mlCustomSelectionTable');
|
||||
await retry.tryForTime(20 * 1000, async () => {
|
||||
await testSubjects.existOrFail('mlCustomSelectionTable', { timeout: 2000 });
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -60,7 +60,11 @@ export function MachineLearningProvider(context: FtrProviderContext) {
|
|||
const customUrls = MachineLearningCustomUrlsProvider(context);
|
||||
|
||||
const dashboardJobSelectionTable = MachineLearningDashboardJobSelectionTableProvider(context);
|
||||
const dashboardEmbeddables = MachineLearningDashboardEmbeddablesProvider(context, commonUI);
|
||||
const dashboardEmbeddables = MachineLearningDashboardEmbeddablesProvider(
|
||||
context,
|
||||
commonUI,
|
||||
dashboardJobSelectionTable
|
||||
);
|
||||
|
||||
const dataFrameAnalytics = MachineLearningDataFrameAnalyticsProvider(context, api);
|
||||
const dataFrameAnalyticsCreation = MachineLearningDataFrameAnalyticsCreationProvider(
|
||||
|
|
Loading…
Reference in a new issue