Skip to content

Commit 6dcde88

Browse files
author
Dennis Labordus
committed
Added some basic tests for SCL Auto Alignment
Signed-off-by: Dennis Labordus <[email protected]>
1 parent 54e9d2b commit 6dcde88

File tree

2 files changed

+60
-5
lines changed

2 files changed

+60
-5
lines changed

integration-testing/TestSuite004-auto-alignment.robot

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,58 @@ Resource ./include/general-compas.robot
99
Test Setup Initialize and Start OpenSCD
1010
Test Teardown Make screenshot and Stop OpenSCD
1111

12+
*** Variables ***
13+
${substation1VoltageLevel} _af9a4ae3-ba2e-4c34-8e47-5af894ee20f4>S1 110kV
14+
${substation3VoltageLevel} _974565b1-ac55-4901-9f48-afc7ef5486df>S3 110kV
15+
16+
*** Keywords ***
17+
Execute SCL Auto Alignment
18+
[Arguments] @{substationNames}
19+
Open Menu Auto Align SLD
20+
FOR ${substationName} IN @{substationNames}
21+
Check Checkbox ${dialog-selector} compas-auto-alignment section#substationsToAlign > mwc-list > mwc-check-list-item:has-text("${substationName}") input[type="checkbox"]
22+
END
23+
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
24+
Wait for dialog is closed
25+
Close Menu
26+
27+
Check X/Y Coordinates
28+
[Arguments] ${id} ${x} ${y}
29+
Get Attribute single-line-diagram-plugin svg > g[id="${id}"] sxy:x == ${x}
30+
Get Attribute single-line-diagram-plugin svg > g[id="${id}"] sxy:y == ${y}
31+
1232
*** Test Cases ***
1333
TestCase004-01
14-
[Documentation] Execute the SCL Auto Alignment.
34+
[Documentation] Execute the SCL Auto Alignment for a single Substation.
1535
Set Test Variable ${sclname} MiniGrid
1636
Set Test Variable ${scltype} SCD
1737

38+
Enable Extension Single Line Diagram
39+
Enable Extension Auto Align SLD
40+
1841
Open Menu Open project
1942
Open local file ${sclname} ${scltype}
2043

21-
Open Menu Auto Align SLD
22-
Check Checkbox ${dialog-selector} compas-auto-alignment section#substationsToAlign > mwc-list > mwc-check-list-item:nth-child(1) mwc-checkbox input[type="checkbox"]
23-
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
24-
Wait for dialog is closed
44+
Execute SCL Auto Alignment Sub1
45+
46+
Select Tab Single Line Diagram
47+
Check X/Y Coordinates ${substation1VoltageLevel} 36 10
48+
Check X/Y Coordinates ${substation3VoltageLevel} 0 0
49+
50+
TestCase004-02
51+
[Documentation] Execute the SCL Auto Alignment for a multiple Substation.
52+
Set Test Variable ${sclname} MiniGrid
53+
Set Test Variable ${scltype} SCD
54+
55+
Enable Extension Single Line Diagram
56+
Enable Extension Auto Align SLD
57+
58+
Open Menu Open project
59+
Open local file ${sclname} ${scltype}
60+
61+
Execute SCL Auto Alignment Sub1 Sub3
62+
63+
Select Tab Single Line Diagram
64+
Check X/Y Coordinates ${substation1VoltageLevel} 36 10
65+
Check X/Y Coordinates ${substation3VoltageLevel} 12 8
66+

integration-testing/include/general-openscd.robot

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@ Close Menu
5252
# To make the editors visible again we need to close the menu.
5353
# We click outside the menu somewhere in the browser.
5454
Mouse Button click x=350 y=350
55+
Sleep 100 milliseconds
56+
57+
Enable Extension
58+
[Arguments] ${extensionName}
59+
Open Menu Extensions
60+
${checkboxState}= Get Element State mwc-list#pluginList > mwc-check-list-item:has-text("${extensionName}") input[type="checkbox"] Checked
61+
IF ${checkboxState} == False
62+
Check Checkbox mwc-list#pluginList > mwc-check-list-item:has-text("${extensionName}") input[type="checkbox"]
63+
END
64+
# Press the escape key to close the dialog.
65+
Keyboard Key press Escape
66+
Sleep 100 milliseconds
67+
Close Menu
5568

5669
Select Tab
5770
[Arguments] ${tabname}

0 commit comments

Comments
 (0)