Skip to content

Commit fbf33b2

Browse files
author
Rob Tjalma
authored
Merge pull request #43 from com-pas/auto-alignment-test
Added some basic tests for SCL Auto Alignment
2 parents 80bf28d + 7cd6ea3 commit fbf33b2

File tree

3 files changed

+722
-674
lines changed

3 files changed

+722
-674
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
*** Settings ***
6+
Documentation Basic test cases for executing the SCL Auto Alignment Service.
7+
Resource ./include/general-compas.robot
8+
9+
Test Setup Initialize and Start OpenSCD
10+
Test Teardown Make screenshot and Stop OpenSCD
11+
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+
32+
*** Test Cases ***
33+
TestCase004-01
34+
[Documentation] Execute the SCL Auto Alignment for a single Substation.
35+
Set Test Variable ${sclname} MiniGrid
36+
Set Test Variable ${scltype} SCD
37+
38+
Enable Extension Single Line Diagram
39+
Enable Extension Auto Align SLD
40+
41+
Open Menu Open project
42+
Open local file ${sclname} ${scltype}
43+
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)