@@ -63,6 +63,64 @@ export default function ({ getPageObjects }: FtrProviderContext) {
6363 const tableData = await visualBuilder . getViewTable ( ) ;
6464 expect ( tableData ) . to . be ( EXPECTED ) ;
6565 } ) ;
66+
67+ it ( 'should display correct values for variance aggregation' , async ( ) => {
68+ const EXPECTED =
69+ 'OS Variance of bytes\nwin 8 2,707,941.822\nwin xp 2,595,612.24\nwin 7 16,055,541.306\nios 6,505,206.56\nosx 1,016,620.667' ;
70+ await visualBuilder . selectAggType ( 'Variance' ) ;
71+ await visualBuilder . setFieldForAggregation ( 'bytes' ) ;
72+
73+ const tableData = await visualBuilder . getViewTable ( ) ;
74+ expect ( tableData ) . to . be ( EXPECTED ) ;
75+ } ) ;
76+
77+ it ( 'should display correct values for filter ratio aggregation with numerator and denominator' , async ( ) => {
78+ const EXPECTED = 'OS Filter Ratio\nwin 8 2\nwin xp 0\nwin 7 3\nios 0\nosx 0' ;
79+ await visualBuilder . selectAggType ( 'Filter Ratio' ) ;
80+ await visualBuilder . setFilterRatioNumeratorDenominator (
81+ 'extension.raw : "css"' ,
82+ 'bytes <= 3000'
83+ ) ;
84+ await visChart . waitForVisualizationRenderingStabilized ( ) ;
85+
86+ const tableData = await visualBuilder . getViewTable ( ) ;
87+ expect ( tableData ) . to . be ( EXPECTED ) ;
88+ } ) ;
89+
90+ it ( 'should display correct values for average aggregation with last value time range mode' , async ( ) => {
91+ const EXPECTED =
92+ 'OS Average of machine.ram\nwin 8 13,958,643,712\nwin xp 14,602,888,806.4\nwin 7 14,048,122,197.333\nios 11,166,914,969.6\nosx 20,401,094,656' ;
93+ await visualBuilder . selectAggType ( 'Average' ) ;
94+ await visualBuilder . setFieldForAggregation ( 'machine.ram' ) ;
95+
96+ const tableData = await visualBuilder . getViewTable ( ) ;
97+ expect ( tableData ) . to . be ( EXPECTED ) ;
98+ } ) ;
99+
100+ it ( 'should display correct values for sum aggregation with entire time range mode' , async ( ) => {
101+ const EXPECTED =
102+ 'OS Sum of memory\nwin 8 1,121,160\nwin xp 1,182,800\nwin 7 1,443,600\nios 971,360\nosx 858,480' ;
103+ await visualBuilder . selectAggType ( 'Sum' ) ;
104+ await visualBuilder . setFieldForAggregation ( 'memory' ) ;
105+ await visualBuilder . clickPanelOptions ( 'table' ) ;
106+ await visualBuilder . setMetricsDataTimerangeMode ( 'Entire time range' ) ;
107+
108+ const tableData = await visualBuilder . getViewTable ( ) ;
109+ expect ( tableData ) . to . be ( EXPECTED ) ;
110+ } ) ;
111+
112+ it ( 'should display correct values for math aggregation' , async ( ) => {
113+ const EXPECTED = 'OS Math\nwin 8 2,937\nwin xp 460\nwin 7 2,997\nios 1,095\nosx 1,724' ;
114+ await visualBuilder . selectAggType ( 'Min' ) ;
115+ await visualBuilder . setFieldForAggregation ( 'bytes' ) ;
116+ await visualBuilder . createNewAgg ( ) ;
117+ await visualBuilder . selectAggType ( 'math' , 1 ) ;
118+ await visualBuilder . fillInVariable ( 'test' , 'Min' ) ;
119+ await visualBuilder . fillInExpression ( 'params.test + 1' ) ;
120+
121+ const tableData = await visualBuilder . getViewTable ( ) ;
122+ expect ( tableData ) . to . be ( EXPECTED ) ;
123+ } ) ;
66124 } ) ;
67125 } ) ;
68126}
0 commit comments