Skip to content

Commit 21f7349

Browse files
author
Rob Tjalma
authored
Merge pull request #34 from com-pas/robot-test-versions-editor
Added more test for the CoMPAS Version Editor
2 parents 6f4bdb6 + 12fc261 commit 21f7349

File tree

8 files changed

+277
-127
lines changed

8 files changed

+277
-127
lines changed

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

Lines changed: 9 additions & 2 deletions
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:
@@ -61,7 +68,7 @@ jobs:
6168
# ppodgorsek/robot-framework:latest
6269

6370
- name: Archive Robot Framework Reports
64-
if: always()
71+
if: failure()
6572
uses: actions/upload-artifact@v2
6673
with:
6774
name: robot-framework-reports

integration-testing/TestSuite001-basic-compas.robot

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,75 +15,67 @@ TestCase001-01
1515
Set Test Variable ${sclname} MiniGrid
1616
Set Test Variable ${scltype} SCD
1717

18-
Open Menu Open project
19-
Open local file ${sclname} ${scltype}
20-
Check Title Filename ${sclname} ${scltype}
18+
Open Menu Open project
19+
Open local file ${sclname} ${scltype}
2120

22-
Select Tab Substation
23-
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
21+
Select Tab Substation
22+
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
2423

2524
TestCase001-02
2625
[Documentation] Open project from Local File and Add to CoMPAS
2726
Set Test Variable ${sclname} MiniGrid
2827
Set Test Variable ${scltype} SCD
2928

30-
Open Menu Open project
31-
Open local file ${sclname} ${scltype}
32-
Check Title Filename ${sclname} ${scltype}
29+
Open Menu Open project
30+
Open local file ${sclname} ${scltype}
3331

3432
Set Test Variable ${sclname} ${TEST NAME}
3533
Set Test Variable ${scltype} CID
3634

37-
Open Menu Save project
38-
Add to CoMPAS ${sclname} ${scltype}
39-
Check Title Filename ${sclname}-${current-date}-1.0.0 ${scltype}
35+
Open Menu Save project
36+
Add to CoMPAS ${sclname} ${scltype} 1.0.0
4037

41-
Select Tab Substation
42-
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
38+
Select Tab Substation
39+
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
4340

4441
TestCase001-03
4542
[Documentation] Open project from CoMPAS
4643
# First we need to add a project to CoMPAS to be able to open it from CoMPAS.
4744
Set Test Variable ${sclname} MiniGrid
4845
Set Test Variable ${scltype} SCD
4946

50-
Open Menu Open project
51-
Open local file ${sclname} ${scltype}
52-
Check Title Filename ${sclname} ${scltype}
47+
Open Menu Open project
48+
Open local file ${sclname} ${scltype}
5349

5450
Set Test Variable ${sclname} ${TEST NAME}
5551
Set Test Variable ${scltype} CID
5652

57-
Open Menu Save project
58-
Add to CoMPAS ${sclname} ${scltype}
59-
Check Title Filename ${sclname}-${current-date}-1.0.0 ${scltype}
53+
Open Menu Save project
54+
Add to CoMPAS ${sclname} ${scltype} 1.0.0
6055

6156
Close OpenSCD
6257
Open OpenSCD and Login
6358

64-
Open Menu Open project
65-
Open from CoMPAS ${sclname} ${scltype}
66-
Check Title Filename ${sclname}-${current-date}-1.0.0 ${scltype}
59+
Open Menu Open project
60+
Open from CoMPAS ${sclname} ${scltype} 1.0.0
6761

68-
Select Tab Substation
69-
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
62+
Select Tab Substation
63+
Get Text ${substation-editor-selector} div#header > h1:has-text("Sub1")
7064

7165
TestCase001-04
7266
[Documentation] Open project from CoMPAS and Save to Local File
7367
# First we need to add a project to CoMPAS to be able to open it from CoMPAS.
7468
Set Test Variable ${sclname} MiniGrid
7569
Set Test Variable ${scltype} SCD
7670

77-
Open Menu Open project
78-
Open local file ${sclname} ${scltype}
79-
Check Title Filename ${sclname} ${scltype}
71+
Open Menu Open project
72+
Open local file ${sclname} ${scltype}
8073

8174
Set Test Variable ${sclname} ${TEST NAME}
8275
Set Test Variable ${scltype} CID
8376

84-
Open Menu Save project
85-
Add to CoMPAS ${sclname} ${scltype}
86-
Check Title Filename ${sclname}-${current-date}-1.0.0 ${scltype}
77+
Open Menu Save project
78+
Add to CoMPAS ${sclname} ${scltype} 1.0.0
8779

8880
Open Menu Save project
8981
Save to local file ${sclname} ${scltype}

integration-testing/TestSuite002-versions-compas.robot

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

12-
*** Test Cases ***
13-
TestCase002-01
14-
[Documentation] Check no versions on tab CoMPAS Versions
15-
Set Test Variable ${sclname} MiniGrid
16-
Set Test Variable ${scltype} SCD
12+
*** Keywords ***
13+
Upload new version
14+
[Arguments] ${changeType} ${name} ${type}
15+
Click ${compas-versions-editor-selector} mwc-icon-button[icon="playlist_add"] > button
16+
Click ${dialog-selector} compas-upload-version compas-changeset-radiogroup > mwc-list > mwc-radio-list-item[value="${changeType.upper()}"]
1717

18-
Open Menu Open project
19-
Open local file ${sclname} ${scltype}
20-
Check Title Filename ${sclname} ${scltype}
18+
${promise}= Promise To Upload File ${CURDIR}/test-files/${name}.${type.lower()}
19+
Click ${dialog-selector} compas-upload-version mwc-button[label="Select file..."] button
20+
${upload_result}= Wait For ${promise}
2121

22-
Select Tab CoMPAS Versions
23-
Get Text ${compas-versions-editor-selector} mwc-list > mwc-list-item > span:has-text("No versions found")
22+
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
23+
Wait for dialog is closed
2424

25-
TestCase002-02
26-
[Documentation] Check one versions on tab CoMPAS Versions
25+
Initialize Versions
26+
[Arguments] ${create-multiple-versions}
2727
Set Test Variable ${sclname} MiniGrid
2828
Set Test Variable ${scltype} SCD
2929

30-
Open Menu Open project
31-
Open local file ${sclname} ${scltype}
32-
Check Title Filename ${sclname} ${scltype}
30+
Open Menu Open project
31+
Open local file ${sclname} ${scltype}
3332

3433
Set Test Variable ${sclname} ${TEST NAME}
3534
Set Test Variable ${scltype} CID
3635

37-
Open Menu Save project
38-
Add to CoMPAS ${sclname} ${scltype}
39-
Check Title Filename ${sclname}-${current-date}-1.0.0 ${scltype}
36+
Open Menu Save project
37+
Add to CoMPAS ${sclname} ${scltype} 1.0.0
4038

4139
Select Tab CoMPAS Versions
4240
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
4341

44-
TestCase002-03
45-
[Documentation] Check every save created a new version on tab CoMPAS Versions
46-
Set Test Variable ${sclname} MiniGrid
47-
Set Test Variable ${scltype} SCD
48-
49-
Open Menu Open project
50-
Open local file ${sclname} ${scltype}
51-
Check Title Filename ${sclname} ${scltype}
42+
IF ${create-multiple-versions} == True
43+
Open Menu Save project
44+
Update in CoMPAS MAJOR ${sclname} ${scltype} 2.0.0
45+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
46+
END
5247

53-
Set Test Variable ${sclname} ${TEST NAME}
54-
Set Test Variable ${scltype} CID
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")
5554

56-
Open Menu Save project
57-
Add to CoMPAS ${sclname} ${scltype}
58-
Check Title Filename ${sclname}-${current-date}-1.0.0 ${scltype}
5955

60-
Select Tab CoMPAS Versions
61-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
56+
*** Test Cases ***
57+
TestCase002-01
58+
[Documentation] Check no versions on tab CoMPAS Versions
59+
Set Test Variable ${sclname} MiniGrid
60+
Set Test Variable ${scltype} SCD
6261

63-
Open Menu Save project
64-
Update in CoMPAS MAJOR
65-
Check Title Filename ${sclname}-${current-date}-2.0.0 ${scltype}
62+
Open Menu Open project
63+
Open local file ${sclname} ${scltype}
6664

6765
Select Tab CoMPAS Versions
68-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
66+
Get Text ${compas-versions-editor-selector} mwc-list > mwc-list-item > span:has-text("No versions found")
6967

70-
Open Menu Save project
71-
Update in CoMPAS MINOR
72-
Check Title Filename ${sclname}-${current-date}-2.1.0 ${scltype}
73-
74-
Select Tab CoMPAS Versions
75-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 3
68+
TestCase002-02
69+
[Documentation] Check one versions on tab CoMPAS Versions
70+
Initialize Versions False
7671

77-
Open Menu Save project
78-
Update in CoMPAS PATCH
79-
Check Title Filename ${sclname}-${current-date}-2.1.1 ${scltype}
72+
Select Tab CoMPAS Versions
73+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
8074

81-
Select Tab CoMPAS Versions
82-
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 4
75+
TestCase002-03
76+
[Documentation] Check every save created a new version on tab CoMPAS Versions
77+
Initialize Versions False
78+
79+
Open Menu Save project
80+
Update in CoMPAS MAJOR ${sclname} ${scltype} 2.0.0
81+
82+
Select Tab CoMPAS Versions
83+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
84+
85+
Open Menu Save project
86+
Update in CoMPAS MINOR ${sclname} ${scltype} 2.1.0
87+
88+
Select Tab CoMPAS Versions
89+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 3
90+
91+
Open Menu Save project
92+
Update in CoMPAS PATCH ${sclname} ${scltype} 2.1.1
93+
94+
Select Tab CoMPAS Versions
95+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 4
96+
97+
TestCase002-10
98+
[Documentation] Added a new version from a local file
99+
Initialize Versions False
100+
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
110+
111+
# First check that the cancel is working form the dialog.
112+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:first-child mwc-icon:first-child
113+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
114+
Wait for dialog is closed
115+
Check Title Filename ${sclname}-${current-date}-2.0.0 ${scltype}
116+
# Next restore the first version, title should reflect this.
117+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:first-child mwc-icon:first-child
118+
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
119+
Wait for dialog is closed
120+
Check Title Filename ${sclname}-${current-date}-1.0.0 ${scltype}
121+
122+
TestCase002-20
123+
[Documentation] Delete first version from the list of versions
124+
Initialize Versions True
125+
126+
# First check that the cancel is working form the dialog.
127+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:first-child mwc-icon:nth-child(2)
128+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
129+
Wait for dialog is closed
130+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 2
131+
# Next delete the first version, number of items should reflect this.
132+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:first-child mwc-icon:nth-child(2)
133+
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
134+
Wait for dialog is closed
135+
Get Element Count ${compas-versions-editor-selector} mwc-list > mwc-check-list-item == 1
136+
137+
TestCase002-21
138+
[Documentation] Delete all versions from CoMPAS
139+
Initialize Versions True
140+
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")
151+
152+
TestCase002-30
153+
[Documentation] Compare current version from CoMPAS
154+
Initialize Versions False
155+
156+
Delete first substation
157+
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
165+
166+
TestCase002-31
167+
[Documentation] Compare current version from CoMPAS not selecting correct number of versions
168+
Initialize Versions True
169+
170+
Select Tab CoMPAS Versions
171+
# Now select no versions and try to compare, should show a error dialog.
172+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare version (current)"] > button
173+
Get Text ${dialog-selector} \#wizard-content:has-text("Select maximum one version to compare the current project against.")
174+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
175+
Wait for dialog is closed
176+
177+
# Now select two versions and try to compare, should show a error dialog.
178+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(1) mwc-checkbox
179+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(2) mwc-checkbox
180+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare version (current)"] > button
181+
Get Text ${dialog-selector} \#wizard-content:has-text("Select maximum one version to compare the current project against.")
182+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
183+
Wait for dialog is closed
184+
185+
TestCase002-32
186+
[Documentation] Compare two versions from CoMPAS
187+
Initialize Versions False
188+
189+
Delete first substation
190+
Open Menu Save project
191+
Update in CoMPAS MAJOR ${sclname} ${scltype} 2.0.0
192+
193+
Select Tab CoMPAS Versions
194+
# Next select the first and second version from the list and compare this to the current open edited version.
195+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(1) mwc-checkbox
196+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(2) mwc-checkbox
197+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare versions"] > button
198+
Get Text ${dialog-selector} \#wizard-content > mwc-list > mwc-list-item:nth-child(4) >> text=Substation
199+
Click ${dialog-selector} mwc-button[slot="primaryAction"] > button
200+
Wait for dialog is closed
201+
202+
203+
TestCase002-33
204+
[Documentation] Compare versions from CoMPAS not selecting correct number of versions
205+
Initialize Versions True
206+
207+
Open Menu Save project
208+
Update in CoMPAS MAJOR ${sclname} ${scltype} 3.0.0
209+
210+
Select Tab CoMPAS Versions
211+
# Now select no versions and try to compare, should show a error dialog.
212+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare versions"] > button
213+
Get Text ${dialog-selector} \#wizard-content:has-text("Select maximum two versions to compare with each other.")
214+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
215+
Wait for dialog is closed
216+
217+
# Now select one versions and try to compare, should show a error dialog.
218+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(1) mwc-checkbox
219+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare versions"] > button
220+
Get Text ${dialog-selector} \#wizard-content:has-text("Select maximum two versions to compare with each other.")
221+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
222+
Wait for dialog is closed
223+
224+
# Now select three versions (first is already selected) and try to compare, should show a error dialog.
225+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(2) mwc-checkbox
226+
Click ${compas-versions-editor-selector} mwc-list > mwc-check-list-item:nth-child(3) mwc-checkbox
227+
Click ${compas-versions-editor-selector} mwc-fab[label="Compare versions"] > button
228+
Get Text ${dialog-selector} \#wizard-content:has-text("Select maximum two versions to compare with each other.")
229+
Click ${dialog-selector} mwc-button[slot="secondaryAction"] > button
230+
Wait for dialog is closed

0 commit comments

Comments
 (0)