mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* [ML] Functional tests - always refresh job list before filtering (#123195)
This PR stabilizes tests that are filtering the anomaly detection job list by making sure the list is always refreshed before filtering.
(cherry picked from commit a3359b7d15
)
# Conflicts:
# x-pack/test/functional/apps/ml/stack_management_jobs/import_jobs.ts
* Fix backport merge issues
* Fix backport merge issues - part 2
This commit is contained in:
parent
b92f3ee293
commit
53c0e362bc
20 changed files with 4 additions and 37 deletions
|
@ -433,7 +433,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.testExecution.logTestStep(
|
||||
'job creation displays the created job in the job list'
|
||||
);
|
||||
await ml.jobTable.refreshJobList();
|
||||
await ml.jobTable.filterWithSearchString(testData.jobId, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
@ -649,7 +648,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.testExecution.logTestStep(
|
||||
'job cloning displays the created job in the job list'
|
||||
);
|
||||
await ml.jobTable.refreshJobList();
|
||||
await ml.jobTable.filterWithSearchString(testData.jobIdClone, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
|
|
@ -396,7 +396,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.testExecution.logTestStep(
|
||||
'check that the single metric viewer button is enabled'
|
||||
);
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(testData.jobConfig.job_id, 1);
|
||||
|
||||
await ml.jobTable.assertJobActionSingleMetricViewerButtonEnabled(
|
||||
|
@ -442,7 +441,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.testExecution.logTestStep(
|
||||
'check that the single metric viewer button is disabled'
|
||||
);
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(testData.jobConfig.job_id, 1);
|
||||
|
||||
await ml.jobTable.assertJobActionSingleMetricViewerButtonEnabled(
|
||||
|
|
|
@ -58,7 +58,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
|
||||
await ml.jobTable.clickOpenJobInSingleMetricViewerButton(jobId);
|
||||
|
@ -90,7 +89,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('should display created annotation in job list');
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
await ml.jobTable.openAnnotationsTab(jobId);
|
||||
await ml.jobAnnotations.assertAnnotationExists({
|
||||
|
@ -125,7 +123,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
await ml.jobTable.openAnnotationsTab(jobId);
|
||||
await ml.jobAnnotations.assertAnnotationContentById(
|
||||
|
@ -179,7 +176,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('should display edited annotation in job list');
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
await ml.jobTable.openAnnotationsTab(jobId);
|
||||
await ml.jobAnnotations.assertAnnotationContentById(annotationId, expectedEditedAnnotation);
|
||||
|
@ -200,7 +196,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
await ml.jobTable.openAnnotationsTab(jobId);
|
||||
|
||||
|
@ -221,7 +216,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
|
||||
await ml.jobTable.clickOpenJobInSingleMetricViewerButton(jobId);
|
||||
|
@ -257,7 +251,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
await ml.testExecution.logTestStep('does not show the deleted annotation in job list');
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
await ml.jobTable.openAnnotationsTab(jobId);
|
||||
await ml.jobAnnotations.assertAnnotationsRowMissing(annotationId);
|
||||
|
|
|
@ -102,7 +102,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.testExecution.logTestStep('open job in anomaly explorer');
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(testData.jobConfig.job_id, 1);
|
||||
|
||||
await ml.jobTable.clickOpenJobInAnomalyExplorerButton(testData.jobConfig.job_id);
|
||||
|
|
|
@ -202,7 +202,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
@ -318,7 +317,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobIdClone, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
@ -350,7 +348,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.testExecution.logTestStep(
|
||||
'job deletion does not display the deleted job in the job list any more'
|
||||
);
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobIdClone, 0);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
|
|
@ -313,7 +313,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.testExecution.logTestStep(
|
||||
'job creation displays the created job in the job list'
|
||||
);
|
||||
await ml.jobTable.refreshJobList();
|
||||
await ml.jobTable.filterWithSearchString(testData.jobId, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
|
|
@ -63,7 +63,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.testExecution.logTestStep('open job in single metric viewer');
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(JOB_CONFIG.job_id, 1);
|
||||
|
||||
await ml.jobTable.clickOpenJobInSingleMetricViewerButton(JOB_CONFIG.job_id);
|
||||
|
|
|
@ -205,7 +205,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
@ -338,7 +337,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobIdClone, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
|
|
@ -231,7 +231,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
@ -375,7 +374,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobIdClone, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
|
|
@ -411,7 +411,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(testData.jobId, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
|
|
@ -185,7 +185,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
@ -321,7 +320,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToMl();
|
||||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobIdClone, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
@ -353,7 +351,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.testExecution.logTestStep(
|
||||
'job deletion does not display the deleted job in the job list any more'
|
||||
);
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobIdClone, 0);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
|
|
@ -135,7 +135,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.jobWizardCommon.assertCreateJobButtonExists();
|
||||
await ml.jobWizardCommon.createJobWithoutDatafeedStart();
|
||||
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobId, 1);
|
||||
|
||||
await ml.testExecution.logTestStep(
|
||||
|
|
|
@ -64,7 +64,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.testExecution.logTestStep('open job in single metric viewer');
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(JOB_CONFIG.job_id, 1);
|
||||
|
||||
await ml.jobTable.clickOpenJobInSingleMetricViewerButton(JOB_CONFIG.job_id);
|
||||
|
@ -152,7 +151,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.testExecution.logTestStep('open job in single metric viewer');
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(jobConfig.job_id, 1);
|
||||
|
||||
await ml.jobTable.clickOpenJobInSingleMetricViewerButton(jobConfig.job_id);
|
||||
|
|
|
@ -75,9 +75,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
it('ensures jobs have been imported', async () => {
|
||||
if (testData.expected.jobType === 'anomaly-detector') {
|
||||
await ml.navigation.navigateToStackManagementJobsListPageAnomalyDetectionTab();
|
||||
await ml.jobTable.refreshJobList();
|
||||
for (const id of testData.expected.jobIds) {
|
||||
await ml.jobTable.filterWithSearchString(id);
|
||||
await ml.jobTable.filterWithSearchString(id, 1);
|
||||
}
|
||||
for (const id of testData.expected.skippedJobIds) {
|
||||
await ml.jobTable.filterWithSearchString(id, 0);
|
||||
|
|
|
@ -174,7 +174,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToStackManagementJobsListPage();
|
||||
|
||||
// AD
|
||||
await ml.jobTable.filterWithSearchString(testData.adJobId);
|
||||
await ml.jobTable.filterWithSearchString(testData.adJobId, 1);
|
||||
await ml.stackManagementJobs.assertADJobRowSpaces(testData.adJobId, [
|
||||
testData.initialSpace,
|
||||
]);
|
||||
|
@ -218,7 +218,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
// AD
|
||||
await ml.navigation.navigateToStackManagementJobsListPageAnomalyDetectionTab();
|
||||
await ml.jobTable.filterWithSearchString(testData.adJobId);
|
||||
await ml.jobTable.filterWithSearchString(testData.adJobId, 1);
|
||||
await ml.stackManagementJobs.assertADJobRowSpaces(testData.adJobId, expectedJobRowSpaces);
|
||||
|
||||
// DFA
|
||||
|
|
|
@ -239,6 +239,7 @@ export function MachineLearningJobTableProvider(
|
|||
|
||||
public async filterWithSearchString(filter: string, expectedRowCount: number = 1) {
|
||||
await this.waitForJobsToLoad();
|
||||
await this.refreshJobList();
|
||||
const searchBar = await testSubjects.find('mlJobListSearchBar');
|
||||
const searchBarInput = await searchBar.findByTagName('input');
|
||||
await searchBarInput.clearValueWithKeyboard();
|
||||
|
|
|
@ -86,7 +86,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.testExecution.logTestStep('open job in anomaly explorer');
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(ecommerceJobConfig.job_id, 1);
|
||||
await ml.jobTable.clickOpenJobInAnomalyExplorerButton(ecommerceJobConfig.job_id);
|
||||
await ml.commonUI.waitForMlLoadingIndicatorToDisappear();
|
||||
|
|
|
@ -229,7 +229,6 @@ export default function ({ getPageObject, getService }: FtrProviderContext) {
|
|||
await elasticChart.setNewChartUiDebugFlag(true);
|
||||
|
||||
await ml.testExecution.logTestStep('open job in anomaly explorer');
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(ecommerceGeoJobConfig.job_id, 1);
|
||||
await ml.jobTable.clickOpenJobInAnomalyExplorerButton(ecommerceGeoJobConfig.job_id);
|
||||
await ml.commonUI.waitForMlLoadingIndicatorToDisappear();
|
||||
|
@ -260,7 +259,6 @@ export default function ({ getPageObject, getService }: FtrProviderContext) {
|
|||
await elasticChart.setNewChartUiDebugFlag(true);
|
||||
|
||||
await ml.testExecution.logTestStep('open job in anomaly explorer');
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(weblogGeoJobConfig.job_id, 1);
|
||||
await ml.jobTable.clickOpenJobInAnomalyExplorerButton(weblogGeoJobConfig.job_id);
|
||||
await ml.commonUI.waitForMlLoadingIndicatorToDisappear();
|
||||
|
|
|
@ -114,7 +114,6 @@ export default function ({ getPageObject, getService }: FtrProviderContext) {
|
|||
await ml.navigation.navigateToJobManagement();
|
||||
|
||||
await ml.testExecution.logTestStep('open job in anomaly explorer');
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(weblogVectorJobConfig.job_id, 1);
|
||||
await ml.jobTable.clickOpenJobInAnomalyExplorerButton(weblogVectorJobConfig.job_id);
|
||||
await ml.commonUI.waitForMlLoadingIndicatorToDisappear();
|
||||
|
|
|
@ -82,7 +82,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
await elasticChart.setNewChartUiDebugFlag(true);
|
||||
|
||||
await ml.testExecution.logTestStep('open job in anomaly explorer');
|
||||
await ml.jobTable.waitForJobsToLoad();
|
||||
await ml.jobTable.filterWithSearchString(populationJobConfig.job_id, 1);
|
||||
await ml.jobTable.clickOpenJobInAnomalyExplorerButton(populationJobConfig.job_id);
|
||||
await ml.commonUI.waitForMlLoadingIndicatorToDisappear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue