Skip to content

Commit c1a217a

Browse files
committed
Adding debug logging
1 parent 1576079 commit c1a217a

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

src/Frontend/test/specs/monitoring/endpoint-details.spec.ts

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,55 +26,94 @@ describe("FEATURE: Endpoint details", () => {
2626
});
2727
describe("RULE: Endpoint detail metric data should be updated immediately after changing the history period", () => {
2828
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+
2931
//Arrange
32+
console.log("ARRANGE: Setting up serviceControlWithMonitoring");
3033
await driver.setUp(precondition.serviceControlWithMonitoring);
3134

35+
console.log("ARRANGE: Creating endpoint details clone");
3236
const endpointDetails = structuredClone(monitoredEndpointDetails);
37+
console.log("ARRANGE: Setting up hasMonitoredEndpointDetails");
3338
await driver.setUp(precondition.hasMonitoredEndpointDetails(endpointDetails));
3439

3540
//Act
41+
console.log("ACT: Navigating to /monitoring/endpoint/Endpoint1");
3642
await driver.goTo(`/monitoring/endpoint/Endpoint1`);
3743

3844
// Assert
45+
console.log("ASSERT: Waiting for default graph values");
3946
// 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");
4154
expect(await endpointDetailsGraphsAverageValues()).toEqual(["2", "1.97", "0", "74", "239"]);
4255

56+
console.log("STEP 1: Setting up metric values for period 5");
4357
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");
4459
await selectHistoryPeriod(5);
4560

61+
console.log("STEP 1: Checking current values");
4662
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["2", "8", "13.24", "81", "215"]);
63+
console.log("STEP 1: Checking average values");
4764
expect(await endpointDetailsGraphsAverageValues()).toEqual(["2", "9.56", "10", "78", "220"]);
4865

66+
console.log("STEP 2: Setting up metric values for period 10");
4967
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");
5069
await selectHistoryPeriod(10);
5170

71+
console.log("STEP 2: Checking current values");
5272
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["5", "12", "2.2", "124", "201"]);
73+
console.log("STEP 2: Checking average values");
5374
expect(await endpointDetailsGraphsAverageValues()).toEqual(["3.1", "7.4", "1", "105", "198"]);
5475

76+
console.log("STEP 3: Setting up metric values for period 15");
5577
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");
5679
await selectHistoryPeriod(15);
5780

81+
console.log("STEP 3: Checking current values");
5882
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["8", "15", "3.1", "278", "403"]);
83+
console.log("STEP 3: Checking average values");
5984
expect(await endpointDetailsGraphsAverageValues()).toEqual(["6.5", "12.6", "2.4", "255", "387"]);
6085

86+
console.log("STEP 4: Setting up metric values for period 30");
6187
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");
6289
await selectHistoryPeriod(30);
6390

91+
console.log("STEP 4: Checking current values");
6492
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["1.1", "3.3", "5.5", "777", "999"]);
93+
console.log("STEP 4: Checking average values");
6594
expect(await endpointDetailsGraphsAverageValues()).toEqual(["2.2", "4.4", "6.6", "888", "800"]);
6695

96+
console.log("STEP 5: Setting up metric values for period 60");
6797
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");
6899
await selectHistoryPeriod(60);
69100

101+
console.log("STEP 5: Checking current values");
70102
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["10", "7.78", "5.55", "333", "111"]);
103+
console.log("STEP 5: Checking average values");
71104
expect(await endpointDetailsGraphsAverageValues()).toEqual(["8.89", "6.67", "4.44", "222", "100"]);
72105

106+
console.log("STEP 6: Setting up metric values for period 1");
73107
await driver.setUp(precondition.hasEndpointWithMetricValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
108+
console.log("STEP 6: Selecting history period 1");
74109
await selectHistoryPeriod(1);
75110

111+
console.log("STEP 6: Checking current values");
76112
expect(await endpointDetailsGraphsCurrentValues()).toEqual(["1", "3", "5", "7", "9"]);
113+
console.log("STEP 6: Checking average values");
77114
expect(await endpointDetailsGraphsAverageValues()).toEqual(["2", "4", "6", "8", "10"]);
115+
116+
console.log("TEST END: Test completed successfully");
78117
});
79118
});
80119
describe("RULE: Endpoint detail metric data should be updated at the interval selected by the history period", () => {

0 commit comments

Comments
 (0)