@@ -155,80 +155,80 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
155155 // The group switch should be disabled by default
156156 await aiops . explainLogRateSpikesPage . assertSpikeAnalysisGroupSwitchExists ( false ) ;
157157
158- // Enabled grouping
159- await aiops . explainLogRateSpikesPage . clickSpikeAnalysisGroupSwitch ( false ) ;
158+ if ( ! isTestDataExpectedWithSampleProbability ( testData . expected ) ) {
159+ // Enabled grouping
160+ await aiops . explainLogRateSpikesPage . clickSpikeAnalysisGroupSwitch ( false ) ;
160161
161- await aiops . explainLogRateSpikesAnalysisGroupsTable . assertSpikeAnalysisTableExists ( ) ;
162+ await aiops . explainLogRateSpikesAnalysisGroupsTable . assertSpikeAnalysisTableExists ( ) ;
162163
163- if ( ! isTestDataExpectedWithSampleProbability ( testData . expected ) ) {
164164 const analysisGroupsTable =
165165 await aiops . explainLogRateSpikesAnalysisGroupsTable . parseAnalysisTable ( ) ;
166166 expect ( orderBy ( analysisGroupsTable , 'group' ) ) . to . be . eql (
167167 orderBy ( testData . expected . analysisGroupsTable , 'group' )
168168 ) ;
169- }
170-
171- await ml . testExecution . logTestStep ( 'expand table row' ) ;
172- await aiops . explainLogRateSpikesAnalysisGroupsTable . assertExpandRowButtonExists ( ) ;
173- await aiops . explainLogRateSpikesAnalysisGroupsTable . expandRow ( ) ;
174-
175- if ( ! isTestDataExpectedWithSampleProbability ( testData . expected ) ) {
176- const analysisTable = await aiops . explainLogRateSpikesAnalysisTable . parseAnalysisTable ( ) ;
177- expect ( orderBy ( analysisTable , [ 'fieldName' , 'fieldValue' ] ) ) . to . be . eql (
178- orderBy ( testData . expected . analysisTable , [ 'fieldName' , 'fieldValue' ] )
179- ) ;
180- }
181-
182- await ml . testExecution . logTestStep ( 'open the field filter' ) ;
183- await aiops . explainLogRateSpikesPage . assertFieldFilterPopoverButtonExists ( false ) ;
184- await aiops . explainLogRateSpikesPage . clickFieldFilterPopoverButton ( true ) ;
185- await aiops . explainLogRateSpikesPage . assertFieldSelectorFieldNameList (
186- testData . expected . fieldSelectorPopover
187- ) ;
188169
189- await ml . testExecution . logTestStep ( 'filter fields' ) ;
190- await aiops . explainLogRateSpikesPage . setFieldSelectorSearch ( testData . fieldSelectorSearch ) ;
191- await aiops . explainLogRateSpikesPage . assertFieldSelectorFieldNameList ( [
192- testData . fieldSelectorSearch ,
193- ] ) ;
194- await aiops . explainLogRateSpikesPage . clickFieldSelectorDisableAllSelectedButton ( ) ;
195- await aiops . explainLogRateSpikesPage . assertFieldFilterApplyButtonExists (
196- ! testData . fieldSelectorApplyAvailable
197- ) ;
198-
199- if ( testData . fieldSelectorApplyAvailable ) {
200- await ml . testExecution . logTestStep ( 'regroup results' ) ;
201- await aiops . explainLogRateSpikesPage . clickFieldFilterApplyButton ( ) ;
170+ await ml . testExecution . logTestStep ( 'expand table row' ) ;
171+ await aiops . explainLogRateSpikesAnalysisGroupsTable . assertExpandRowButtonExists ( ) ;
172+ await aiops . explainLogRateSpikesAnalysisGroupsTable . expandRow ( ) ;
202173
203174 if ( ! isTestDataExpectedWithSampleProbability ( testData . expected ) ) {
204- const filteredAnalysisGroupsTable =
205- await aiops . explainLogRateSpikesAnalysisGroupsTable . parseAnalysisTable ( ) ;
206- expect ( orderBy ( filteredAnalysisGroupsTable , 'group' ) ) . to . be . eql (
207- orderBy ( testData . expected . filteredAnalysisGroupsTable , 'group' )
175+ const analysisTable = await aiops . explainLogRateSpikesAnalysisTable . parseAnalysisTable ( ) ;
176+ expect ( orderBy ( analysisTable , [ 'fieldName' , 'fieldValue' ] ) ) . to . be . eql (
177+ orderBy ( testData . expected . analysisTable , [ 'fieldName' , 'fieldValue' ] )
208178 ) ;
209179 }
210- }
211180
212- if ( testData . action !== undefined ) {
213- await ml . testExecution . logTestStep ( 'check all table row actions are present' ) ;
214- await aiops . explainLogRateSpikesAnalysisGroupsTable . assertRowActions (
215- testData . action . tableRowId
181+ await ml . testExecution . logTestStep ( 'open the field filter' ) ;
182+ await aiops . explainLogRateSpikesPage . assertFieldFilterPopoverButtonExists ( false ) ;
183+ await aiops . explainLogRateSpikesPage . clickFieldFilterPopoverButton ( true ) ;
184+ await aiops . explainLogRateSpikesPage . assertFieldSelectorFieldNameList (
185+ testData . expected . fieldSelectorPopover
216186 ) ;
217187
218- await ml . testExecution . logTestStep ( 'click log pattern analysis action' ) ;
219- await aiops . explainLogRateSpikesAnalysisGroupsTable . clickRowAction (
220- testData . action . tableRowId ,
221- testData . action . type
188+ await ml . testExecution . logTestStep ( 'filter fields' ) ;
189+ await aiops . explainLogRateSpikesPage . setFieldSelectorSearch ( testData . fieldSelectorSearch ) ;
190+ await aiops . explainLogRateSpikesPage . assertFieldSelectorFieldNameList ( [
191+ testData . fieldSelectorSearch ,
192+ ] ) ;
193+ await aiops . explainLogRateSpikesPage . clickFieldSelectorDisableAllSelectedButton ( ) ;
194+ await aiops . explainLogRateSpikesPage . assertFieldFilterApplyButtonExists (
195+ ! testData . fieldSelectorApplyAvailable
222196 ) ;
223197
224- await ml . testExecution . logTestStep ( 'check log pattern analysis page loaded correctly' ) ;
225- await aiops . logPatternAnalysisPageProvider . assertLogCategorizationPageExists ( ) ;
226- await aiops . logPatternAnalysisPageProvider . assertTotalDocumentCount (
227- testData . action . expected . totalDocCount
228- ) ;
229- await aiops . logPatternAnalysisPageProvider . assertQueryInput (
230- testData . action . expected . queryBar
231- ) ;
198+ if ( testData . fieldSelectorApplyAvailable ) {
199+ await ml . testExecution . logTestStep ( 'regroup results' ) ;
200+ await aiops . explainLogRateSpikesPage . clickFieldFilterApplyButton ( ) ;
201+
202+ if ( ! isTestDataExpectedWithSampleProbability ( testData . expected ) ) {
203+ const filteredAnalysisGroupsTable =
204+ await aiops . explainLogRateSpikesAnalysisGroupsTable . parseAnalysisTable ( ) ;
205+ expect ( orderBy ( filteredAnalysisGroupsTable , 'group' ) ) . to . be . eql (
206+ orderBy ( testData . expected . filteredAnalysisGroupsTable , 'group' )
207+ ) ;
208+ }
209+ }
210+
211+ if ( testData . action !== undefined ) {
212+ await ml . testExecution . logTestStep ( 'check all table row actions are present' ) ;
213+ await aiops . explainLogRateSpikesAnalysisGroupsTable . assertRowActions (
214+ testData . action . tableRowId
215+ ) ;
216+
217+ await ml . testExecution . logTestStep ( 'click log pattern analysis action' ) ;
218+ await aiops . explainLogRateSpikesAnalysisGroupsTable . clickRowAction (
219+ testData . action . tableRowId ,
220+ testData . action . type
221+ ) ;
222+
223+ await ml . testExecution . logTestStep ( 'check log pattern analysis page loaded correctly' ) ;
224+ await aiops . logPatternAnalysisPageProvider . assertLogCategorizationPageExists ( ) ;
225+ await aiops . logPatternAnalysisPageProvider . assertTotalDocumentCount (
226+ testData . action . expected . totalDocCount
227+ ) ;
228+ await aiops . logPatternAnalysisPageProvider . assertQueryInput (
229+ testData . action . expected . queryBar
230+ ) ;
231+ }
232232 }
233233 } ) ;
234234 }
0 commit comments