Skip to content

Commit bc5d838

Browse files
author
Rob Tjalma
authored
Merge pull request #79 from com-pas/extra-robot-tests
Extra Robot Tests for validating Error Messages
2 parents fc29bfa + 7cd2f29 commit bc5d838

File tree

8 files changed

+113
-17
lines changed

8 files changed

+113
-17
lines changed

compas/data/ocl/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ SPDX-License-Identifier: Apache-2.0
66

77
This directory can be used to add custom OCL Files to the validation process.
88

9-
You can use subdirectories like `SemanticConstraints` as RiseClipse is doing.
10-
And there is a special filter that when you create a directory `FileSpecifics`.
11-
In this directory you can create for instance a directory `CID` to put constraints specific for an SCL File Type.
12-
Known types are `SSD`, `IID`, `ICD`, `SCD`, `CID`, `SED`, `ISD`, `STD`.
9+
You can use subdirectories like `SemanticConstraints` as RiseClipse is doing. And there is a special directory
10+
`FileSpecifics`. In this directory mostly file specific rules are added. There are functions that can be used
11+
in the OCL Rules to determine the type of file, like `isInICDFile()`.
1312

1413
For instance,
1514

1615
```
1716
compas/data
1817
└── ocl
1918
├── FileSpecifics
20-
│ └── CID
21-
│ └── Busbar.ocl
19+
│ └── Busbar.ocl
2220
├── README.md
2321
└── SemanticConstraints
2422
└── Busbar.ocl

integration-testing/TestSuite001-basic-compas.robot

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,31 @@ TestCase001-04
7979

8080
Open Menu Save project
8181
Save to local file ${sclname} ${scltype}
82+
83+
TestCase001-05
84+
[Documentation] Trying saving local file to CoMPAS with invalid name
85+
# First we will open the local file to be saved.
86+
Set Test Variable ${sclname} MiniGrid
87+
Set Test Variable ${scltype} SCD
88+
89+
Open Menu Open project
90+
Open local file ${sclname} ${scltype}
91+
92+
# Try saving the file with a invalid name
93+
Set Test Variable ${sclname} invalid/*name
94+
Set Test Variable ${scltype} CID
95+
96+
Open Menu Save project
97+
Get Text ${dialog-selector} compas-save mwc-textfield#name input == MiniGrid.scd
98+
Fill Text ${dialog-selector} compas-save mwc-textfield#name input ${sclname}
99+
Click ${dialog-selector} compas-save compas-scltype-radiogroup mwc-list > mwc-radio-list-item[value="${scltype}"]
100+
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
101+
Wait until executed
102+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
103+
Wait for dialog is closed
104+
Close Menu
105+
106+
# Check if the expected error message is found
107+
Set Test Variable ${secondaryMessage} ApplicationError: Name is not a correct name to be used later as filename. (CORE-8000) (400)
108+
Check CoMPAS Error ${secondaryMessage}
109+

integration-testing/TestSuite003-cim-mapping.robot

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,31 @@ Open Project from CIM
1616
Open Menu Project from CIM
1717
${upload_result}= Wait For ${promise}
1818
Sleep 0.5s Wait until loading file starts.
19-
Check Title Filename ${name} ${scltype}
2019
Close Menu
20+
Check Title Filename ${name} ${scltype}
2121

2222
*** Test Cases ***
2323
TestCase003-01
24-
[Documentation] Create project from CIM File
24+
[Documentation] Create a project from CIM File
2525
Set Test Variable ${sclname} MiniGridTestConfiguration_BC_EQ_v3.0.0
2626
Set Test Variable ${scltype} SSD
2727

2828
Open Project from CIM ${sclname} ${scltype}
2929

3030
Select Tab Substation
3131
Get Text ${substation-editor-selector} section > h1:has-text("Sub1")
32+
33+
TestCase003-02
34+
[Documentation] Trying to create a project from Invalid CIM Filename
35+
Set Test Variable ${sclname} MiniGridTestConfiguration_Invalid_XML
36+
37+
${promise}= Promise To Upload File ${CURDIR}/test-files/${sclname}.xml
38+
Open Menu Project from CIM
39+
${upload_result}= Wait For ${promise}
40+
Sleep 0.5s Wait until loading file starts.
41+
Close Menu
42+
43+
# Check if the expected error message is found
44+
Set Test Variable ${secondaryMessage} ApplicationError: Invalid name used for this cim data file. (CORE-8000) (400)
45+
Check CoMPAS Error ${secondaryMessage}
46+

integration-testing/TestSuite004-auto-alignment.robot

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,19 @@ TestCase004-02
7777
Select SLD Substation ${substation3}
7878
Check X/Y Coordinates ${substation3VoltageLevel} 12 10
7979

80+
TestCase004-03
81+
[Documentation] Failing SCL Auto Alignment with incompleet configuration
82+
Set Test Variable ${sclname} Incompleet_Substation
83+
Set Test Variable ${scltype} SCD
84+
85+
Enable Extension Single Line Diagram
86+
Enable Extension Auto Align SLD
87+
88+
Open Menu Open project
89+
Open local file ${sclname} ${scltype}
90+
91+
Execute SCL Auto Alignment Substation 1
92+
93+
# Check if the expected error message is found
94+
Set Test Variable ${secondaryMessage} ServerError: Unknown exception occurred. (CORE-9999) (500)
95+
Check CoMPAS Error ${secondaryMessage}

integration-testing/include/general-compas.robot

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Open from CoMPAS
1717
Click ${dialog-selector} compas-open compas-scltype-list > mwc-list > mwc-list-item >> span:has-text("${type.upper()}")
1818
Click ${dialog-selector} compas-open compas-scl-list > mwc-list > mwc-list-item:has-text("${name}-${current-date}")
1919
Wait for dialog is closed
20-
# check if the title (filename) changed to the new expected one. This way we know we can close the menu.
21-
Check Title Filename ${sclname}-${current-date}-${expectedVersion} ${scltype}
2220
Close Menu
21+
# check if the title (filename) changed to the new expected one.
22+
Check Title Filename ${name}-${current-date}-${expectedVersion} ${type}
2323

2424
Add to CoMPAS
2525
[Arguments] ${initialValue} ${name} ${type} ${expectedVersion}
@@ -29,18 +29,18 @@ Add to CoMPAS
2929
Click ${dialog-selector} compas-save compas-scltype-radiogroup mwc-list > mwc-radio-list-item[value="${type.upper()}"]
3030
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
3131
Wait for dialog is closed
32-
# check if the title (filename) changed to the new expected one. This way we know we can close the menu.
33-
Check Title Filename ${sclname}-${current-date}-${expectedVersion} ${scltype}
3432
Close Menu
33+
# check if the title (filename) changed to the new expected one.
34+
Check Title Filename ${name}-${current-date}-${expectedVersion} ${type}
3535

3636
Update in CoMPAS
3737
[Arguments] ${changeType} ${name} ${type} ${expectedVersion}
3838
Click ${dialog-selector} compas-save compas-changeset-radiogroup mwc-list > mwc-radio-list-item[value="${changeType.upper()}"]
3939
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
4040
Wait for dialog is closed
41-
# check if the title (filename) changed to the new expected one. This way we know we can close the menu.
42-
Check Title Filename ${sclname}-${current-date}-${expectedVersion} ${scltype}
4341
Close Menu
42+
# check if the title (filename) changed to the new expected one.
43+
Check Title Filename ${name}-${current-date}-${expectedVersion} ${type}
4444

4545
Change Websockets setting
4646
[Arguments] ${checked}
@@ -53,3 +53,8 @@ Change Websockets setting
5353
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
5454
Wait for dialog is closed
5555
Close Menu
56+
57+
Check CoMPAS Error
58+
[Arguments] ${secondaryMessage}
59+
Set Test Variable ${primaryMessage} Error communicating with CoMPAS Ecosystem
60+
Check Log ${primaryMessage} ${secondaryMessage}

integration-testing/include/general-openscd.robot

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ Open local file
7777
${upload_result}= Wait For ${promise}
7878
Sleep 0.5s Wait until loading file starts.
7979
Wait for dialog is closed
80-
# check if the title (filename) changed to the new expected one. This way we know we can close the menu.
81-
Check Title Filename ${name} ${scltype}
8280
Close Menu
81+
# check if the title (filename) changed to the new expected one.
82+
Check Title Filename ${name} ${type}
8383

8484
Save to local file
8585
[Arguments] ${name} ${type}
@@ -103,6 +103,15 @@ Wait until executed
103103

104104
Close Issues Snackbar
105105
${snackbarVisible}= Get Element States mwc-snackbar#issue > mwc-icon-button[slot="dismiss"] > button *= visible
106-
IF ${snackbarVisible} == 'visible'
106+
IF ${snackbarVisible} == True
107107
Click mwc-snackbar#issue > mwc-icon-button[slot="dismiss"] > button
108108
END
109+
110+
Check Log
111+
[Arguments] ${primaryMessage} ${secondaryMessage}
112+
Open Menu View log
113+
Get Text mwc-dialog#log abbr[title="${primaryMessage}"]
114+
Get Text mwc-dialog#log abbr[title="${primaryMessage}"] span[slot="secondary"]:has-text("${secondaryMessage}")
115+
Click mwc-dialog#log mwc-button[slot="primaryAction"] > button
116+
Wait for dialog is closed
117+
Close Menu
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
SPDX-FileCopyrightText: 2021 Alliander N.V.
4+
5+
SPDX-License-Identifier: Apache-2.0
6+
-->
7+
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" version="2007" revision="B" release="4">
8+
<Header id="project"/>
9+
<Substation name="Substation 1">
10+
<VoltageLevel name="Voltage 110kV" nomFreq="50" numPhases="3">
11+
<Voltage unit="V" multiplier="k">110</Voltage>
12+
<Bay name="Bay 1">
13+
<ConductingEquipment name="CB1" type="CBR"/>
14+
</Bay>
15+
</VoltageLevel>
16+
</Substation>
17+
</SCL>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
SPDX-FileCopyrightText: 2022 Alliander N.V.
4+
5+
SPDX-License-Identifier: Apache-2.0
6+
-->
7+
<rdf:RDFs xmlns:cim="http://iec.ch/TC57/2013/CIM-schema-cim16#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
8+
</rdf:RDFs>

0 commit comments

Comments
 (0)