@@ -9,74 +9,222 @@ Resource ./include/general-compas.robot
9
9
Test Setup Initialize and Start OpenSCD
10
10
Test Teardown Make screenshot and Stop OpenSCD
11
11
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() } "]
17
17
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 }
21
21
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
24
24
25
- TestCase002-02
26
- [Documentation ] Check one versions on tab CoMPAS Versions
25
+ Initialize Versions
26
+ [Arguments ] ${ create-multiple-versions }
27
27
Set Test Variable ${sclname } MiniGrid
28
28
Set Test Variable ${scltype } SCD
29
29
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 }
33
32
34
33
Set Test Variable ${sclname } ${TEST NAME }
35
34
Set Test Variable ${scltype } CID
36
35
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
40
38
41
39
Select Tab CoMPAS Versions
42
40
Get Element Count ${compas-versions-editor-selector } mwc-list > mwc-check-list-item == 1
43
41
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
52
47
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")
55
54
56
- Open Menu Save project
57
- Add to CoMPAS ${sclname } ${scltype }
58
- Check Title Filename ${sclname } -${current-date } -1.0.0 ${scltype }
59
55
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
62
61
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 }
66
64
67
65
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")
69
67
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
76
71
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
80
74
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