@@ -12,6 +12,7 @@ import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
12
12
import { RecommendationsActions } from '../../../../common-actions/recommendations-actions' ;
13
13
import { Common } from '../../../../helpers/common' ;
14
14
import { APIKeyRequests } from '../../../../helpers/api/api-keys' ;
15
+ import { Telemetry } from '../../../../helpers' ;
15
16
16
17
const memoryEfficiencyPage = new MemoryEfficiencyPage ( ) ;
17
18
const myRedisDatabasePage = new MyRedisDatabasePage ( ) ;
@@ -21,6 +22,16 @@ const workbenchPage = new WorkbenchPage();
21
22
const databaseHelper = new DatabaseHelper ( ) ;
22
23
const databaseAPIRequests = new DatabaseAPIRequests ( ) ;
23
24
const apiKeyRequests = new APIKeyRequests ( ) ;
25
+ const telemetry = new Telemetry ( ) ;
26
+
27
+ const logger = telemetry . createLogger ( ) ;
28
+
29
+ const telemetryEvent = 'DATABASE_ANALYSIS_TIPS_COLLAPSED' ;
30
+ const expectedProperties = [
31
+ 'databaseId' ,
32
+ 'provider' ,
33
+ 'recommendation'
34
+ ] ;
24
35
25
36
// const externalPageLink = 'https://docs.redis.com/latest/ri/memory-optimizations/';
26
37
let keyName = `recomKey-${ Common . generateWord ( 10 ) } ` ;
@@ -46,6 +57,7 @@ fixture `Memory Efficiency Recommendations`
46
57
await databaseAPIRequests . deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
47
58
} ) ;
48
59
test
60
+ . requestHooks ( logger )
49
61
. before ( async t => {
50
62
await databaseHelper . acceptLicenseTermsAndAddDatabaseApi ( ossStandaloneBigConfig ) ;
51
63
// Go to Analysis Tools page
82
94
// Verify that user can expand/collapse recommendation
83
95
const expandedTextContaiterSize = await memoryEfficiencyPage . getRecommendationByName ( luaScriptRecommendation ) . offsetHeight ;
84
96
await t . click ( memoryEfficiencyPage . getRecommendationButtonByName ( luaScriptRecommendation ) ) ;
97
+
98
+ //Verify telemetry event
99
+ await telemetry . verifyEventHasProperties ( telemetryEvent , expectedProperties , logger ) ;
100
+
85
101
await t . expect ( memoryEfficiencyPage . getRecommendationByName ( luaScriptRecommendation ) . offsetHeight )
86
102
. lt ( expandedTextContaiterSize , 'Lua script recommendation not collapsed' ) ;
87
103
await t . click ( memoryEfficiencyPage . getRecommendationButtonByName ( luaScriptRecommendation ) ) ;
0 commit comments