@@ -26,55 +26,94 @@ describe("FEATURE: Endpoint details", () => {
26
26
} ) ;
27
27
describe ( "RULE: Endpoint detail metric data should be updated immediately after changing the history period" , ( ) => {
28
28
test ( `EXAMPLE: As history periods are selected the graph data values should update immediately` , async ( { driver } ) => {
29
+ console . log ( "TEST START: Beginning test execution" ) ;
30
+
29
31
//Arrange
32
+ console . log ( "ARRANGE: Setting up serviceControlWithMonitoring" ) ;
30
33
await driver . setUp ( precondition . serviceControlWithMonitoring ) ;
31
34
35
+ console . log ( "ARRANGE: Creating endpoint details clone" ) ;
32
36
const endpointDetails = structuredClone ( monitoredEndpointDetails ) ;
37
+ console . log ( "ARRANGE: Setting up hasMonitoredEndpointDetails" ) ;
33
38
await driver . setUp ( precondition . hasMonitoredEndpointDetails ( endpointDetails ) ) ;
34
39
35
40
//Act
41
+ console . log ( "ACT: Navigating to /monitoring/endpoint/Endpoint1" ) ;
36
42
await driver . goTo ( `/monitoring/endpoint/Endpoint1` ) ;
37
43
38
44
// Assert
45
+ console . log ( "ASSERT: Waiting for default graph values" ) ;
39
46
// Wait for the default values of the page to be updated after the page is loaded
40
- await waitFor ( async ( ) => expect ( await endpointDetailsGraphsCurrentValues ( ) ) . toEqual ( [ "2" , "0" , "0" , "0" , "0" ] ) ) ;
47
+ await waitFor ( async ( ) => {
48
+ const currentValues = await endpointDetailsGraphsCurrentValues ( ) ;
49
+ console . log ( "ASSERT: Current graph values:" , currentValues ) ;
50
+ expect ( currentValues ) . toEqual ( [ "2" , "0" , "0" , "0" , "0" ] ) ;
51
+ } ) ;
52
+
53
+ console . log ( "ASSERT: Checking average values" ) ;
41
54
expect ( await endpointDetailsGraphsAverageValues ( ) ) . toEqual ( [ "2" , "1.97" , "0" , "74" , "239" ] ) ;
42
55
56
+ console . log ( "STEP 1: Setting up metric values for period 5" ) ;
43
57
await driver . setUp ( precondition . hasEndpointWithMetricValues ( 2 , 2 , 8 , 9.56 , 13.24 , 10 , 81 , 78 , 215 , 220 ) ) ;
58
+ console . log ( "STEP 1: Selecting history period 5" ) ;
44
59
await selectHistoryPeriod ( 5 ) ;
45
60
61
+ console . log ( "STEP 1: Checking current values" ) ;
46
62
expect ( await endpointDetailsGraphsCurrentValues ( ) ) . toEqual ( [ "2" , "8" , "13.24" , "81" , "215" ] ) ;
63
+ console . log ( "STEP 1: Checking average values" ) ;
47
64
expect ( await endpointDetailsGraphsAverageValues ( ) ) . toEqual ( [ "2" , "9.56" , "10" , "78" , "220" ] ) ;
48
65
66
+ console . log ( "STEP 2: Setting up metric values for period 10" ) ;
49
67
await driver . setUp ( precondition . hasEndpointWithMetricValues ( 5 , 3.1 , 12 , 7.4 , 2.2 , 1 , 124 , 105.7 , 201 , 198 ) ) ;
68
+ console . log ( "STEP 2: Selecting history period 10" ) ;
50
69
await selectHistoryPeriod ( 10 ) ;
51
70
71
+ console . log ( "STEP 2: Checking current values" ) ;
52
72
expect ( await endpointDetailsGraphsCurrentValues ( ) ) . toEqual ( [ "5" , "12" , "2.2" , "124" , "201" ] ) ;
73
+ console . log ( "STEP 2: Checking average values" ) ;
53
74
expect ( await endpointDetailsGraphsAverageValues ( ) ) . toEqual ( [ "3.1" , "7.4" , "1" , "105" , "198" ] ) ;
54
75
76
+ console . log ( "STEP 3: Setting up metric values for period 15" ) ;
55
77
await driver . setUp ( precondition . hasEndpointWithMetricValues ( 8 , 6.5 , 15 , 12.6 , 3.1 , 2.4 , 278 , 255.3 , 403 , 387.8 ) ) ;
78
+ console . log ( "STEP 3: Selecting history period 15" ) ;
56
79
await selectHistoryPeriod ( 15 ) ;
57
80
81
+ console . log ( "STEP 3: Checking current values" ) ;
58
82
expect ( await endpointDetailsGraphsCurrentValues ( ) ) . toEqual ( [ "8" , "15" , "3.1" , "278" , "403" ] ) ;
83
+ console . log ( "STEP 3: Checking average values" ) ;
59
84
expect ( await endpointDetailsGraphsAverageValues ( ) ) . toEqual ( [ "6.5" , "12.6" , "2.4" , "255" , "387" ] ) ;
60
85
86
+ console . log ( "STEP 4: Setting up metric values for period 30" ) ;
61
87
await driver . setUp ( precondition . hasEndpointWithMetricValues ( 1.1 , 2.2 , 3.3 , 4.4 , 5.5 , 6.6 , 777.7 , 888.8 , 999.9 , 800.8 ) ) ;
88
+ console . log ( "STEP 4: Selecting history period 30" ) ;
62
89
await selectHistoryPeriod ( 30 ) ;
63
90
91
+ console . log ( "STEP 4: Checking current values" ) ;
64
92
expect ( await endpointDetailsGraphsCurrentValues ( ) ) . toEqual ( [ "1.1" , "3.3" , "5.5" , "777" , "999" ] ) ;
93
+ console . log ( "STEP 4: Checking average values" ) ;
65
94
expect ( await endpointDetailsGraphsAverageValues ( ) ) . toEqual ( [ "2.2" , "4.4" , "6.6" , "888" , "800" ] ) ;
66
95
96
+ console . log ( "STEP 5: Setting up metric values for period 60" ) ;
67
97
await driver . setUp ( precondition . hasEndpointWithMetricValues ( 9.999 , 8.888 , 7.777 , 6.666 , 5.555 , 4.444 , 333.333 , 222.222 , 111.111 , 100.123 ) ) ;
98
+ console . log ( "STEP 5: Selecting history period 60" ) ;
68
99
await selectHistoryPeriod ( 60 ) ;
69
100
101
+ console . log ( "STEP 5: Checking current values" ) ;
70
102
expect ( await endpointDetailsGraphsCurrentValues ( ) ) . toEqual ( [ "10" , "7.78" , "5.55" , "333" , "111" ] ) ;
103
+ console . log ( "STEP 5: Checking average values" ) ;
71
104
expect ( await endpointDetailsGraphsAverageValues ( ) ) . toEqual ( [ "8.89" , "6.67" , "4.44" , "222" , "100" ] ) ;
72
105
106
+ console . log ( "STEP 6: Setting up metric values for period 1" ) ;
73
107
await driver . setUp ( precondition . hasEndpointWithMetricValues ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ) ) ;
108
+ console . log ( "STEP 6: Selecting history period 1" ) ;
74
109
await selectHistoryPeriod ( 1 ) ;
75
110
111
+ console . log ( "STEP 6: Checking current values" ) ;
76
112
expect ( await endpointDetailsGraphsCurrentValues ( ) ) . toEqual ( [ "1" , "3" , "5" , "7" , "9" ] ) ;
113
+ console . log ( "STEP 6: Checking average values" ) ;
77
114
expect ( await endpointDetailsGraphsAverageValues ( ) ) . toEqual ( [ "2" , "4" , "6" , "8" , "10" ] ) ;
115
+
116
+ console . log ( "TEST END: Test completed successfully" ) ;
78
117
} ) ;
79
118
} ) ;
80
119
describe ( "RULE: Endpoint detail metric data should be updated at the interval selected by the history period" , ( ) => {
0 commit comments