Skip to content

Commit 5b0bb76

Browse files
author
Dennis Labordus
committed
Added tests for CoMPAS Versions Tab (Compare versions).
Signed-off-by: Dennis Labordus <[email protected]>
1 parent ed71313 commit 5b0bb76

File tree

3 files changed

+147
-119
lines changed

3 files changed

+147
-119
lines changed

.github/workflows/run-integration-tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
name: Run integration tests
66

7-
on: push
7+
on:
8+
push:
9+
branches:
10+
- '**'
11+
- '!main'
12+
pull_request:
13+
branches:
14+
- 'main'
815

916
jobs:
1017
integration-tests:

integration-testing/TestSuite002-versions-compas.robot

Lines changed: 138 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,8 @@ Upload new version
2222
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
2323
Wait for dialog is closed
2424

25-
*** Test Cases ***
26-
TestCase002-01
27-
[Documentation] Check no versions on tab CoMPAS Versions
28-
Set Test Variable ${sclname} MiniGrid
29-
Set Test Variable ${scltype} SCD
30-
31-
Open Menu Open project
32-
Open local file ${sclname} ${scltype}
33-
34-
Select Tab CoMPAS Versions
35-
Get Text ${compas-versions-editor-selector} mwc-list > mwc-list-item > span:has-text("No versions found")
36-
37-
TestCase002-02
38-
[Documentation] Check one versions on tab CoMPAS Versions
39-
Set Test Variable ${sclname} MiniGrid
40-
Set Test Variable ${scltype} SCD
41-
42-
Open Menu Open project
43-
Open local file ${sclname} ${scltype}
44-
45-
Set Test Variable ${sclname} ${TEST NAME}
46-
Set Test Variable ${scltype} CID
47-
48-
Open Menu Save project
49-
Add to CoMPAS ${sclname} ${scltype} 1.0.0
50-
51-
Select Tab CoMPAS Versions
52-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
53-
54-
TestCase002-03
55-
[Documentation] Check every save created a new version on tab CoMPAS Versions
25+
Initialize Versions
26+
[Arguments] ${create-multiple-versions}
5627
Set Test Variable ${sclname} MiniGrid
5728
Set Test Variable ${scltype} SCD
5829

@@ -68,69 +39,74 @@ TestCase002-03
6839
Select Tab CoMPAS Versions
6940
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
7041

42+
IF ${create-multiple-versions} == True
7143
Open Menu Save project
7244
Update in CoMPAS MAJOR ${sclname} ${scltype} 2.0.0
73-
74-
Select Tab CoMPAS Versions
7545
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
46+
END
7647

77-
Open Menu Save project
78-
Update in CoMPAS MINOR ${sclname} ${scltype} 2.1.0
48+
Delete first substation
49+
Select Tab Substation
50+
# Got to the Substation tab and remove the first substation (Sub1), next the first substation should be Sub2.
51+
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
52+
Click ${substation-editor-selector} > abbr[title="Remove"] > mwc-icon-button[icon="delete"]
53+
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub2")
7954

80-
Select Tab CoMPAS Versions
81-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 3
82-
83-
Open Menu Save project
84-
Update in CoMPAS PATCH ${sclname} ${scltype} 2.1.1
85-
86-
Select Tab CoMPAS Versions
87-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 4
8855

89-
TestCase002-04
90-
[Documentation] Added a new version from a local file
56+
*** Test Cases ***
57+
TestCase002-01
58+
[Documentation] Check no versions on tab CoMPAS Versions
9159
Set Test Variable ${sclname} MiniGrid
9260
Set Test Variable ${scltype} SCD
9361

9462
Open Menu Open project
9563
Open local file ${sclname} ${scltype}
9664

97-
Set Test Variable ${sclname} ${TEST NAME}
98-
Set Test Variable ${scltype} CID
65+
Select Tab CoMPAS Versions
66+
Get Text ${compas-versions-editor-selector} mwc-list > mwc-list-item > span:has-text("No versions found")
9967

100-
Open Menu Save project
101-
Add to CoMPAS ${sclname} ${scltype} 1.0.0
68+
TestCase002-02
69+
[Documentation] Check one versions on tab CoMPAS Versions
70+
Initialize Versions False
10271

103-
Select Tab CoMPAS Versions
104-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
72+
Select Tab CoMPAS Versions
73+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
10574

106-
Upload new version MAJOR MiniGrid SCD
75+
TestCase002-03
76+
[Documentation] Check every save created a new version on tab CoMPAS Versions
77+
Initialize Versions False
10778

108-
Select Tab CoMPAS Versions
109-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
110-
Get Text ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:last-child *= ${sclname}-${current-date} (2.0.0)
79+
Open Menu Save project
80+
Update in CoMPAS MAJOR ${sclname} ${scltype} 2.0.0
11181

112-
TestCase002-05
113-
[Documentation] Restore first version from the list of versions
114-
Set Test Variable ${sclname} MiniGrid
115-
Set Test Variable ${scltype} SCD
82+
Select Tab CoMPAS Versions
83+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
11684

117-
Open Menu Open project
118-
Open local file ${sclname} ${scltype}
85+
Open Menu Save project
86+
Update in CoMPAS MINOR ${sclname} ${scltype} 2.1.0
11987

120-
Set Test Variable ${sclname} ${TEST NAME}
121-
Set Test Variable ${scltype} CID
88+
Select Tab CoMPAS Versions
89+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 3
12290

123-
Open Menu Save project
124-
Add to CoMPAS ${sclname} ${scltype} 1.0.0
91+
Open Menu Save project
92+
Update in CoMPAS PATCH ${sclname} ${scltype} 2.1.1
12593

126-
Select Tab CoMPAS Versions
127-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
94+
Select Tab CoMPAS Versions
95+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 4
12896

129-
Open Menu Save project
130-
Update in CoMPAS MAJOR ${sclname} ${scltype} 2.0.0
97+
TestCase002-10
98+
[Documentation] Added a new version from a local file
99+
Initialize Versions False
131100

132-
Select Tab CoMPAS Versions
133-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
101+
Upload new version MAJOR MiniGrid SCD
102+
103+
Select Tab CoMPAS Versions
104+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
105+
Get Text ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:last-child *= ${sclname}-${current-date} (2.0.0)
106+
107+
TestCase002-11
108+
[Documentation] Restore first version from the list of versions
109+
Initialize Versions True
134110

135111
# First check that the cancel is working form the dialog.
136112
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:first-child mwc-icon:first-child
@@ -143,28 +119,9 @@ TestCase002-05
143119
Wait for dialog is closed
144120
Check Title Filename ${sclname}-${current-date}-1.0.0 ${scltype}
145121

146-
TestCase002-06
147-
[Documentation] Delete first version from the list of versions
148-
Set Test Variable ${sclname} MiniGrid
149-
Set Test Variable ${scltype} SCD
150-
151-
Open Menu Open project
152-
Open local file ${sclname} ${scltype}
153-
154-
Set Test Variable ${sclname} ${TEST NAME}
155-
Set Test Variable ${scltype} CID
156-
157-
Open Menu Save project
158-
Add to CoMPAS ${sclname} ${scltype} 1.0.0
159-
160-
Select Tab CoMPAS Versions
161-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
162-
163-
Open Menu Save project
164-
Update in CoMPAS MAJOR ${sclname} ${scltype} 2.0.0
165-
166-
Select Tab CoMPAS Versions
167-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
122+
TestCase002-20
123+
[Documentation] Delete first version from the list of versions
124+
Initialize Versions True
168125

169126
# First check that the cancel is working form the dialog.
170127
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:first-child mwc-icon:nth-child(2)
@@ -177,36 +134,100 @@ TestCase002-06
177134
Wait for dialog is closed
178135
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
179136

180-
TestCase002-07
181-
[Documentation] Delete all versions from CoMPAS
182-
Set Test Variable ${sclname} MiniGrid
183-
Set Test Variable ${scltype} SCD
137+
TestCase002-21
138+
[Documentation] Delete all versions from CoMPAS
139+
Initialize Versions True
184140

185-
Open Menu Open project
186-
Open local file ${sclname} ${scltype}
141+
# First check that the cancel is working form the dialog.
142+
Click ${compas-versions-editor-selector} mwc-icon-button[icon="delete_forever"] > button
143+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
144+
Wait for dialog is closed
145+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
146+
# Next delete all versions.
147+
Click ${compas-versions-editor-selector} mwc-icon-button[icon="delete_forever"] > button
148+
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
149+
Wait for dialog is closed
150+
Get Text ${compas-versions-editor-selector} mwc-list > mwc-list-item > span:has-text("No versions found")
187151

188-
Set Test Variable ${sclname} ${TEST NAME}
189-
Set Test Variable ${scltype} CID
152+
TestCase002-30
153+
[Documentation] Compare current version from CoMPAS
154+
Initialize Versions False
190155

191-
Open Menu Save project
192-
Add to CoMPAS ${sclname} ${scltype} 1.0.0
156+
Delete first substation
193157

194-
Select Tab CoMPAS Versions
195-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
158+
Select Tab CoMPAS Versions
159+
# Next select the first version from the list and compare this to the current open edited version.
160+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(1) mwc-checkbox
161+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare version (current)"] > button
162+
Get Text ${dialog-selector} \#wizard-content > mwc-list > mwc-list-item:nth-child(5) >> text=Substation
163+
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
164+
Wait for dialog is closed
196165

197-
Open Menu Save project
198-
Update in CoMPAS MAJOR ${sclname} ${scltype} 2.0.0
166+
TestCase002-31
167+
[Documentation] Compare current version from CoMPAS not selecting correct number of versions
168+
Initialize Versions True
199169

200-
Select Tab CoMPAS Versions
201-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
170+
Open Menu Save project
171+
Update in CoMPAS MAJOR ${sclname} ${scltype} 3.0.0
202172

203-
# First check that the cancel is working form the dialog.
204-
Click ${compas-versions-editor-selector} mwc-icon-button[icon="delete_forever"] > button
205-
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
173+
Select Tab CoMPAS Versions
174+
# Now select no versions and try to compare, should show a error dialog.
175+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare version (current)"] > button
176+
Get Text ${dialog-selector} \#wizard-content:has-text("Select maximum one version to compare the current project against.")
177+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
206178
Wait for dialog is closed
207-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
208-
# Next delete all versions.
209-
Click ${compas-versions-editor-selector} mwc-icon-button[icon="delete_forever"] > button
210-
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
179+
180+
# Now select two versions and try to compare, should show a error dialog.
181+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(1) mwc-checkbox
182+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(2) mwc-checkbox
183+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare version (current)"] > button
184+
Get Text ${dialog-selector} \#wizard-content:has-text("Select maximum one version to compare the current project against.")
185+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
186+
Wait for dialog is closed
187+
188+
TestCase002-32
189+
[Documentation] Compare current version from CoMPAS
190+
Initialize Versions False
191+
192+
Delete first substation
193+
Open Menu Save project
194+
Update in CoMPAS MAJOR ${sclname} ${scltype} 2.0.0
195+
196+
Select Tab CoMPAS Versions
197+
# Next select the first and second version from the list and compare this to the current open edited version.
198+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(1) mwc-checkbox
199+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(2) mwc-checkbox
200+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare versions"] > button
201+
Get Text ${dialog-selector} \#wizard-content > mwc-list > mwc-list-item:nth-child(4) >> text=Substation
202+
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
203+
Wait for dialog is closed
204+
205+
206+
TestCase002-33
207+
[Documentation] Compare versions from CoMPAS not selecting correct number of versions
208+
Initialize Versions True
209+
210+
Open Menu Save project
211+
Update in CoMPAS MAJOR ${sclname} ${scltype} 3.0.0
212+
213+
Select Tab CoMPAS Versions
214+
# Now select no versions and try to compare, should show a error dialog.
215+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare versions"] > button
216+
Get Text ${dialog-selector} \#wizard-content:has-text("Select maximum two versions to compare with each other.")
217+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
218+
Wait for dialog is closed
219+
220+
# Now select one versions and try to compare, should show a error dialog.
221+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(1) mwc-checkbox
222+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare versions"] > button
223+
Get Text ${dialog-selector} \#wizard-content:has-text("Select maximum two versions to compare with each other.")
224+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
225+
Wait for dialog is closed
226+
227+
# Now select three versions (first is already selected) and try to compare, should show a error dialog.
228+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(2) mwc-checkbox
229+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(3) mwc-checkbox
230+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare versions"] > button
231+
Get Text ${dialog-selector} \#wizard-content:has-text("Select maximum two versions to compare with each other.")
232+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
211233
Wait for dialog is closed
212-
Get Text ${compas-versions-editor-selector} mwc-list > mwc-list-item > span:has-text("No versions found")

integration-testing/include/general-openscd.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Resource ./general-config.robot
1010
# Variables of Selectors commonly used.
1111
${menu-selector} mwc-drawer[id="menu"]
1212
${dialog-selector} wizard-dialog
13-
${substation-editor-selector} substation-editor:nth-child(1) > editor-container
13+
${substation-editor-selector} substation-editor:first-child > editor-container
1414

1515
*** Keywords ***
1616
Initialize and Start OpenSCD

0 commit comments

Comments
 (0)