@@ -9,6 +9,19 @@ 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
+ *** 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
+
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
+
22
+ Click ${dialog-selector } mwc-button[slot="primaryAction"] > button
23
+ Wait for dialog is closed
24
+
12
25
*** Test Cases ***
13
26
TestCase002-01
14
27
[Documentation] Check no versions on tab CoMPAS Versions
@@ -72,3 +85,128 @@ TestCase002-03
72
85
73
86
Select Tab CoMPAS Versions
74
87
Get Element Count ${compas-versions-editor-selector } mwc-list > mwc-check-list-item == 4
88
+
89
+ TestCase002-04
90
+ [Documentation] Added a new version from a local file
91
+ Set Test Variable ${sclname } MiniGrid
92
+ Set Test Variable ${scltype } SCD
93
+
94
+ Open Menu Open project
95
+ Open local file ${sclname } ${scltype }
96
+
97
+ Set Test Variable ${sclname } ${TEST NAME }
98
+ Set Test Variable ${scltype } CID
99
+
100
+ Open Menu Save project
101
+ Add to CoMPAS ${sclname } ${scltype } 1.0.0
102
+
103
+ Select Tab CoMPAS Versions
104
+ Get Element Count ${compas-versions-editor-selector } mwc-list > mwc-check-list-item == 1
105
+
106
+ Upload new version MAJOR MiniGrid SCD
107
+
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 )
111
+
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
116
+
117
+ Open Menu Open project
118
+ Open local file ${sclname } ${scltype }
119
+
120
+ Set Test Variable ${sclname } ${TEST NAME }
121
+ Set Test Variable ${scltype } CID
122
+
123
+ Open Menu Save project
124
+ Add to CoMPAS ${sclname } ${scltype } 1.0.0
125
+
126
+ Select Tab CoMPAS Versions
127
+ Get Element Count ${compas-versions-editor-selector } mwc-list > mwc-check-list-item == 1
128
+
129
+ Open Menu Save project
130
+ Update in CoMPAS MAJOR ${sclname } ${scltype } 2.0.0
131
+
132
+ Select Tab CoMPAS Versions
133
+ Get Element Count ${compas-versions-editor-selector } mwc-list > mwc-check-list-item == 2
134
+
135
+ # First check that the cancel is working form the dialog.
136
+ Click ${compas-versions-editor-selector } mwc-list > mwc-check-list-item:first-child mwc-icon:first-child
137
+ Click ${dialog-selector } mwc-button[slot="secondaryAction"] > button
138
+ Wait for dialog is closed
139
+ Check Title Filename ${sclname } -${current-date } -2.0.0 ${scltype }
140
+ # Next restore the first version, title should reflect this.
141
+ Click ${compas-versions-editor-selector } mwc-list > mwc-check-list-item:first-child mwc-icon:first-child
142
+ Click ${dialog-selector } mwc-button[slot="primaryAction"] > button
143
+ Wait for dialog is closed
144
+ Check Title Filename ${sclname } -${current-date } -1.0.0 ${scltype }
145
+
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
168
+
169
+ # First check that the cancel is working form the dialog.
170
+ Click ${compas-versions-editor-selector } mwc-list > mwc-check-list-item:first-child mwc-icon:nth-child(2)
171
+ Click ${dialog-selector } mwc-button[slot="secondaryAction"] > button
172
+ Wait for dialog is closed
173
+ Get Element Count ${compas-versions-editor-selector } mwc-list > mwc-check-list-item == 2
174
+ # Next delete the first version, number of items should reflect this.
175
+ Click ${compas-versions-editor-selector } mwc-list > mwc-check-list-item:first-child mwc-icon:nth-child(2)
176
+ Click ${dialog-selector } mwc-button[slot="primaryAction"] > button
177
+ Wait for dialog is closed
178
+ Get Element Count ${compas-versions-editor-selector } mwc-list > mwc-check-list-item == 1
179
+
180
+ TestCase002-07
181
+ [Documentation] Delete all versions from CoMPAS
182
+ Set Test Variable ${sclname } MiniGrid
183
+ Set Test Variable ${scltype } SCD
184
+
185
+ Open Menu Open project
186
+ Open local file ${sclname } ${scltype }
187
+
188
+ Set Test Variable ${sclname } ${TEST NAME }
189
+ Set Test Variable ${scltype } CID
190
+
191
+ Open Menu Save project
192
+ Add to CoMPAS ${sclname } ${scltype } 1.0.0
193
+
194
+ Select Tab CoMPAS Versions
195
+ Get Element Count ${compas-versions-editor-selector } mwc-list > mwc-check-list-item == 1
196
+
197
+ Open Menu Save project
198
+ Update in CoMPAS MAJOR ${sclname } ${scltype } 2.0.0
199
+
200
+ Select Tab CoMPAS Versions
201
+ Get Element Count ${compas-versions-editor-selector } mwc-list > mwc-check-list-item == 2
202
+
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
206
+ 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
211
+ Wait for dialog is closed
212
+ Get Text ${compas-versions-editor-selector } mwc-list > mwc-list-item > span:has-text("No versions found")
0 commit comments