@@ -11,6 +11,7 @@ import {
11
11
longRunningStreamQuery ,
12
12
longTableSelect ,
13
13
longerRunningStreamQuery ,
14
+ simpleQuery ,
14
15
} from '../constants' ;
15
16
16
17
import {
@@ -407,4 +408,42 @@ test.describe('Test Query Editor', async () => {
407
408
// Verify clipboard contains the query result
408
409
expect ( clipboardContent ) . toContain ( '42' ) ;
409
410
} ) ;
411
+
412
+ test . describe ( 'Statistics Modes Tests' , async ( ) => {
413
+ test ( 'Stats tab shows no stats message when STATISTICS_MODES.none' , async ( { page} ) => {
414
+ const queryEditor = new QueryEditor ( page ) ;
415
+
416
+ // Set query and configure statistics mode to none
417
+ await queryEditor . setQuery ( simpleQuery ) ;
418
+ await queryEditor . clickGearButton ( ) ;
419
+ await queryEditor . settingsDialog . changeStatsLevel ( STATISTICS_MODES . none ) ;
420
+ await queryEditor . settingsDialog . clickButton ( ButtonNames . Save ) ;
421
+
422
+ // Execute query
423
+ await queryEditor . clickRunButton ( ) ;
424
+ await expect ( queryEditor . waitForStatus ( 'Completed' ) ) . resolves . toBe ( true ) ;
425
+
426
+ // Check Stats tab content
427
+ const statsContent = await queryEditor . getStatsTabContent ( ) ;
428
+ expect ( statsContent ) . toContain ( 'There is no Stats for the request' ) ;
429
+ } ) ;
430
+
431
+ test ( 'Stats tab shows JSON viewer when STATISTICS_MODES.basic' , async ( { page} ) => {
432
+ const queryEditor = new QueryEditor ( page ) ;
433
+
434
+ // Set query and configure statistics mode to basic
435
+ await queryEditor . setQuery ( simpleQuery ) ;
436
+ await queryEditor . clickGearButton ( ) ;
437
+ await queryEditor . settingsDialog . changeStatsLevel ( STATISTICS_MODES . basic ) ;
438
+ await queryEditor . settingsDialog . clickButton ( ButtonNames . Save ) ;
439
+
440
+ // Execute query
441
+ await queryEditor . clickRunButton ( ) ;
442
+ await expect ( queryEditor . waitForStatus ( 'Completed' ) ) . resolves . toBe ( true ) ;
443
+
444
+ // Check that Stats tab contains JSON viewer
445
+ const hasJsonViewer = await queryEditor . hasStatsJsonViewer ( ) ;
446
+ expect ( hasJsonViewer ) . toBe ( true ) ;
447
+ } ) ;
448
+ } ) ;
410
449
} ) ;
0 commit comments