Update SmartChargingTest.ts
updated test results
MODIFY
test/api/SmartChargingTest.ts
test/api/SmartChargingTest.ts
@@ -171,16 +171,16 @@ describe('Smart Charging Service', function() {
const transactionResponse = await testData.chargingStationContext.startTransaction(connectorId, tagId, meterStart, startDate);
await testData.chargingStationContext.setConnectorStatus(chargingStationConnector1Charging);
const chargingProfiles = await smartChargingIntegration.buildChargingProfiles(testData.siteAreaContext.siteArea);
- console.log(JSON.stringify(chargingProfiles, null, ' '));
expect(chargingProfiles).containSubset([{
'chargingStationID': 'cs-16-ut-site-withSmartChargingThreePhased',
- 'connectorID': 1,
+ 'connectorID': chargingStationConnector1Charging.connectorId,
'chargePointID': 1,
'profile': {
'chargingProfileId': 1,
'chargingProfileKind': 'Absolute',
'chargingProfilePurpose': 'TxProfile',
'stackLevel': 2,
+ 'transactionId': transactionResponse.transactionId,
'chargingSchedule': {
'chargingRateUnit': 'A',
'duration': chargingProfiles[0].profile.chargingSchedule.chargingSchedulePeriod.length * 15 * 60
@@ -228,50 +228,6 @@ describe('Smart Charging Service', function() {
'startPeriod': 8100,
'limit': 96
},
- {
- 'startPeriod': 9000,
- 'limit': 96
- },
- {
- 'startPeriod': 9900,
- 'limit': 96
- },
- {
- 'startPeriod': 10800,
- 'limit': 96
- },
- {
- 'startPeriod': 11700,
- 'limit': 96
- },
- {
- 'startPeriod': 12600,
- 'limit': 96
- },
- {
- 'startPeriod': 13500,
- 'limit': 96
- },
- {
- 'startPeriod': 14400,
- 'limit': 96
- },
- {
- 'startPeriod': 15300,
- 'limit': 96
- },
- {
- 'startPeriod': 16200,
- 'limit': 96
- },
- {
- 'startPeriod': 17100,
- 'limit': 96
- },
- {
- 'startPeriod': 18000,
- 'limit': 96
- },
]);
});
@@ -283,10 +239,9 @@ describe('Smart Charging Service', function() {
const transactionResponse = await testData.chargingStationContext.startTransaction(connectorId, tagId, meterStart, startDate);
await testData.chargingStationContext.setConnectorStatus(chargingStationConnector2Charging);
const chargingProfiles = await smartChargingIntegration.buildChargingProfiles(testData.siteAreaContext.siteArea);
- console.log(JSON.stringify(chargingProfiles, null, ' '));
expect(chargingProfiles[0]).containSubset({
'chargingStationID': 'cs-16-ut-site-withSmartChargingThreePhased',
- 'connectorID': 1,
+ 'connectorID': chargingStationConnector1Charging.connectorId,
'chargePointID': 1,
'profile': {
'chargingProfileId': 1,
@@ -340,56 +295,13 @@ describe('Smart Charging Service', function() {
'startPeriod': 8100,
'limit': 96
},
- {
- 'startPeriod': 9000,
- 'limit': 96
- },
- {
- 'startPeriod': 9900,
- 'limit': 96
- },
- {
- 'startPeriod': 10800,
- 'limit': 96
- },
- {
- 'startPeriod': 11700,
- 'limit': 96
- },
- {
- 'startPeriod': 12600,
- 'limit': 96
- },
- {
- 'startPeriod': 13500,
- 'limit': 96
- },
- {
- 'startPeriod': 14400,
- 'limit': 96
- },
- {
- 'startPeriod': 15300,
- 'limit': 96
- },
- {
- 'startPeriod': 16200,
- 'limit': 96
- },
- {
- 'startPeriod': 17100,
- 'limit': 96
- },
- {
- 'startPeriod': 18000,
- 'limit': 96
- },
]);
expect(chargingProfiles[1]).containSubset({
'chargingStationID': 'cs-16-ut-site-withSmartChargingThreePhased',
- 'connectorID': 2,
+ 'connectorID': chargingStationConnector2Charging.connectorId,
'chargePointID': 1,
'profile': {
+ 'transactionId': transactionResponse.transactionId,
'chargingProfileId': 2,
'chargingProfileKind': 'Absolute',
'chargingProfilePurpose': 'TxProfile',
@@ -441,59 +353,14 @@ describe('Smart Charging Service', function() {
'startPeriod': 8100,
'limit': 96
},
- {
- 'startPeriod': 9000,
- 'limit': 96
- },
- {
- 'startPeriod': 9900,
- 'limit': 96
- },
- {
- 'startPeriod': 10800,
- 'limit': 96
- },
- {
- 'startPeriod': 11700,
- 'limit': 96
- },
- {
- 'startPeriod': 12600,
- 'limit': 96
- },
- {
- 'startPeriod': 13500,
- 'limit': 96
- },
- {
- 'startPeriod': 14400,
- 'limit': 96
- },
- {
- 'startPeriod': 15300,
- 'limit': 96
- },
- {
- 'startPeriod': 16200,
- 'limit': 96
- },
- {
- 'startPeriod': 17100,
- 'limit': 96
- },
- {
- 'startPeriod': 18000,
- 'limit': 96
- },
]);
});
it('Test for two cars charging with lower site area limit', async () => {
testData.siteAreaContext.siteArea.maximumPower = 30000;
const chargingProfiles = await smartChargingIntegration.buildChargingProfiles(testData.siteAreaContext.siteArea);
- console.log(JSON.stringify(chargingProfiles, null, ' '));
expect(chargingProfiles[0]).containSubset({
'chargingStationID': 'cs-16-ut-site-withSmartChargingThreePhased',
- 'connectorID': 1,
+ 'connectorID': chargingStationConnector1Charging.connectorId,
'chargePointID': 1,
'profile': {
'chargingProfileId': 1,
@@ -522,7 +389,7 @@ describe('Smart Charging Service', function() {
});
expect(chargingProfiles[1]).containSubset({
'chargingStationID': 'cs-16-ut-site-withSmartChargingThreePhased',
- 'connectorID': 2,
+ 'connectorID': chargingStationConnector2Charging.connectorId,
'chargePointID': 1,
'profile': {
'chargingProfileId': 2,
@@ -576,50 +443,6 @@ describe('Smart Charging Service', function() {
'startPeriod': 8100,
'limit': 96
},
- {
- 'startPeriod': 9000,
- 'limit': 96
- },
- {
- 'startPeriod': 9900,
- 'limit': 96
- },
- {
- 'startPeriod': 10800,
- 'limit': 96
- },
- {
- 'startPeriod': 11700,
- 'limit': 96
- },
- {
- 'startPeriod': 12600,
- 'limit': 96
- },
- {
- 'startPeriod': 13500,
- 'limit': 96
- },
- {
- 'startPeriod': 14400,
- 'limit': 96
- },
- {
- 'startPeriod': 15300,
- 'limit': 96
- },
- {
- 'startPeriod': 16200,
- 'limit': 96
- },
- {
- 'startPeriod': 17100,
- 'limit': 96
- },
- {
- 'startPeriod': 18000,
- 'limit': 96
- },
]);
});
});
@@ -632,6 +455,11 @@ describe('Smart Charging Service', function() {
testData.siteAreaContext.siteArea.numberOfPhases = 1;
});
+ after(async () => {
+ await testData.chargingStationContext.setConnectorStatus(chargingStationConnector1Available);
+ await testData.chargingStationContext.setConnectorStatus(chargingStationConnector2Available);
+ });
+
it('Test for one car charging', async () => {
const connectorId = 1;
@@ -644,16 +472,21 @@ describe('Smart Charging Service', function() {
console.log(JSON.stringify(chargingProfiles, null, ' '));
expect(chargingProfiles).containSubset([{
'chargingStationID': 'cs-16-ut-site-withSmartChargingSinglePhased',
- 'connectorID': 1,
+ 'connectorID': chargingStationConnector1Charging.connectorId,
'chargePointID': 1,
'profile': {
+ 'transactionId': transactionResponse.transactionId,
'chargingProfileId': 1,
'chargingProfileKind': 'Absolute',
'chargingProfilePurpose': 'TxProfile',
'stackLevel': 2,
'chargingSchedule': {
'chargingRateUnit': 'A',
- 'chargingSchedulePeriod': [
+ 'duration': chargingProfiles[0].profile.chargingSchedule.chargingSchedulePeriod.length * 15 * 60
+ }
+ }
+ }]);
+ expect(chargingProfiles[0].profile.chargingSchedule.chargingSchedulePeriod).containSubset([
{
'startPeriod': 0,
'limit': 32
@@ -665,12 +498,36 @@ describe('Smart Charging Service', function() {
{
'startPeriod': 1800,
'limit': 32
- }
- ],
- 'duration': 2700
- }
- }
- }]);
+ },
+ {
+ 'startPeriod': 2700,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 3600,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 4500,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 5400,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 6300,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 7200,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 8100,
+ 'limit': 32
+ },
+ ]);
});
it('Test for two cars charging', async () => {
@@ -707,10 +564,52 @@ describe('Smart Charging Service', function() {
'limit': 32
}
],
- 'duration': 2700
+ 'duration': chargingProfiles[0].profile.chargingSchedule.chargingSchedulePeriod.length * 15 * 60
}
}
});
+ expect(chargingProfiles[0].profile.chargingSchedule.chargingSchedulePeriod).containSubset([
+ {
+ 'startPeriod': 0,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 900,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 1800,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 2700,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 3600,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 4500,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 5400,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 6300,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 7200,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 8100,
+ 'limit': 32
+ },
+ ]);
expect(chargingProfiles[1]).containSubset({
'chargingStationID': 'cs-16-ut-site-withSmartChargingSinglePhased',
'connectorID': 2,
@@ -722,7 +621,11 @@ describe('Smart Charging Service', function() {
'stackLevel': 2,
'chargingSchedule': {
'chargingRateUnit': 'A',
- 'chargingSchedulePeriod': [
+ 'duration': chargingProfiles[0].profile.chargingSchedule.chargingSchedulePeriod.length * 15 * 60
+ }
+ }
+ });
+ expect(chargingProfiles[1].profile.chargingSchedule.chargingSchedulePeriod).containSubset([
{
'startPeriod': 0,
'limit': 32
@@ -734,12 +637,36 @@ describe('Smart Charging Service', function() {
{
'startPeriod': 1800,
'limit': 32
- }
- ],
- 'duration': 2700
- }
- }
- });
+ },
+ {
+ 'startPeriod': 2700,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 3600,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 4500,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 5400,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 6300,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 7200,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 8100,
+ 'limit': 32
+ },
+ ]);
});
it('Test for two cars charging with lower site area limit', async () => {
testData.siteAreaContext.siteArea.maximumPower = 10000;
@@ -759,18 +686,18 @@ describe('Smart Charging Service', function() {
'chargingSchedulePeriod': [
{
'startPeriod': 0,
- 'limit': 11
+ 'limit': 0
},
{
'startPeriod': 900,
- 'limit': 11
+ 'limit': 0
},
{
'startPeriod': 1800,
- 'limit': 11
+ 'limit': 0
}
],
- 'duration': 2700
+ 'duration': chargingProfiles[0].profile.chargingSchedule.chargingSchedulePeriod.length * 15 * 60
}
}
});
@@ -785,7 +712,11 @@ describe('Smart Charging Service', function() {
'stackLevel': 2,
'chargingSchedule': {
'chargingRateUnit': 'A',
- 'chargingSchedulePeriod': [
+ 'duration': chargingProfiles[1].profile.chargingSchedule.chargingSchedulePeriod.length * 15 * 60
+ }
+ }
+ });
+ expect(chargingProfiles[1].profile.chargingSchedule.chargingSchedulePeriod).containSubset([
{
'startPeriod': 0,
'limit': 32
@@ -797,12 +728,36 @@ describe('Smart Charging Service', function() {
{
'startPeriod': 1800,
'limit': 32
- }
- ],
- 'duration': 2700
- }
- }
- });
+ },
+ {
+ 'startPeriod': 2700,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 3600,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 4500,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 5400,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 6300,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 7200,
+ 'limit': 32
+ },
+ {
+ 'startPeriod': 8100,
+ 'limit': 32
+ },
+ ]);
});
});
});

Update SmartChargingTest.ts

updated test results