From 7fc6ff8c95d6dac3c4a7bbb360c79b420576bbbd Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 5 Nov 2024 13:47:45 -0700 Subject: [PATCH] basic functional test for rerun copy change on searchbar update for log rate analysis --- x-pack/test/functional/apps/aiops/log_rate_analysis.ts | 6 ++++++ .../test_data/farequote_data_view_test_data_with_query.ts | 1 + x-pack/test/functional/apps/aiops/types.ts | 1 + 3 files changed, 8 insertions(+) diff --git a/x-pack/test/functional/apps/aiops/log_rate_analysis.ts b/x-pack/test/functional/apps/aiops/log_rate_analysis.ts index d6acad691b195..8ffbea4f1a0b0 100644 --- a/x-pack/test/functional/apps/aiops/log_rate_analysis.ts +++ b/x-pack/test/functional/apps/aiops/log_rate_analysis.ts @@ -167,6 +167,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { testData.dataGenerator ); + if (testData.editedQuery && testData.query) { + await aiops.logRateAnalysisPage.setQueryInput(testData.editedQuery); + await aiops.logRateAnalysisPage.assertRerunAnalysisButtonExists(true); + await aiops.logRateAnalysisPage.setQueryInput(testData.query); + } + // At this stage the baseline and deviation brush position should be stored in // the url state and a full browser refresh should restore the analysis. await browser.refresh(); diff --git a/x-pack/test/functional/apps/aiops/log_rate_analysis/test_data/farequote_data_view_test_data_with_query.ts b/x-pack/test/functional/apps/aiops/log_rate_analysis/test_data/farequote_data_view_test_data_with_query.ts index e5a8b4783d7bb..8a9957a82b89a 100644 --- a/x-pack/test/functional/apps/aiops/log_rate_analysis/test_data/farequote_data_view_test_data_with_query.ts +++ b/x-pack/test/functional/apps/aiops/log_rate_analysis/test_data/farequote_data_view_test_data_with_query.ts @@ -23,6 +23,7 @@ export const farequoteDataViewTestDataWithQuery: TestData = { fieldSelectorSearch: 'airline', fieldSelectorApplyAvailable: true, query: 'NOT airline:("SWR" OR "ACA" OR "AWE" OR "BAW" OR "JAL" OR "JBU" OR "JZA" OR "KLM")', + editedQuery: 'NOT airline:("SWR")', expected: { totalDocCountFormatted: '48,799', analysisGroupsTable: [ diff --git a/x-pack/test/functional/apps/aiops/types.ts b/x-pack/test/functional/apps/aiops/types.ts index aeac2ce33f718..bf72b9d987030 100644 --- a/x-pack/test/functional/apps/aiops/types.ts +++ b/x-pack/test/functional/apps/aiops/types.ts @@ -68,6 +68,7 @@ export interface TestData { fieldSelectorSearch: string; fieldSelectorApplyAvailable: boolean; query?: string; + editedQuery?: string; action?: TestDataTableActionLogPatternAnalysis; expected: TestDataExpectedWithSampleProbability | TestDataExpectedWithoutSampleProbability; }