@@ -252,6 +252,15 @@ class TestMachinesCreate(machineslib.VirtualMachinesCase):
252
252
253
253
dialog .cancel ()
254
254
255
+ # Check the details in the middle page after the VM creation
256
+ runner .checkMiddlePageWhenCreatingTest (TestMachinesCreate .VmDialog (self , sourceType = "file" , location = config .NOVELL_MOCKUP_ISO_PATH ))
257
+
258
+ runner .checkMiddlePageWhenCreatingTest (TestMachinesCreate .VmDialog (self , sourceType = "disk_image" , location = config .NOVELL_MOCKUP_ISO_PATH ))
259
+
260
+ runner .checkMiddlePageWhenCreatingTest (TestMachinesCreate .VmDialog (self , sourceType = "file" , location = config .NOVELL_MOCKUP_ISO_PATH , create_and_run = True ))
261
+
262
+ runner .checkMiddlePageWhenCreatingTest (TestMachinesCreate .VmDialog (self , sourceType = "disk_image" , location = config .NOVELL_MOCKUP_ISO_PATH , create_and_run = True ))
263
+
255
264
def testCreateNameGeneration (self ):
256
265
config = TestMachinesCreate .TestCreateConfig
257
266
runner = TestMachinesCreate .CreateVmRunner (self )
@@ -1168,6 +1177,79 @@ vnc_password= "{vnc_passwd}"
1168
1177
1169
1178
return self
1170
1179
1180
+ def checkMiddlePageWhenCreating (self ):
1181
+ b = self .browser
1182
+
1183
+ buttonSelector = "#create-and-run" if self .create_and_run else "#create-and-edit"
1184
+ b .click (buttonSelector )
1185
+
1186
+ if not self .create_and_run :
1187
+ b .wait_visible (f"h1:contains(\" Creating VM { self .name } \" )" )
1188
+ b .click ("button:contains(\" Go to VMs list\" )" )
1189
+ b .wait_visible ("#virtual-machines-listing" )
1190
+ b .wait_in_text (f"#vm-{ self .name } -system-state" , "Creating VM" )
1191
+
1192
+ b .click (f"#vm-{ self .name } -system-name" )
1193
+ b .wait_visible (f"h1:contains(\" Creating VM { self .name } \" )" )
1194
+ b .click ("button:contains(\" Go to VMs list\" )" )
1195
+ b .wait_visible ("#virtual-machines-listing" )
1196
+ b .wait_in_text (
1197
+ f"#vm-{ self .name } -system-state" ,
1198
+ "Running" if self .create_and_run else "Shut off" )
1199
+
1200
+ b .click (f"#vm-{ self .name } -system-name" )
1201
+ b .wait_visible ("#vm-details" )
1202
+ b .wait_in_text ("h2.vm-name" , self .name )
1203
+ # debug
1204
+ print ("---------Start for the first removing---------" )
1205
+ b .eval_js ('window.debugging = "machines"' )
1206
+ # time.sleep(5)
1207
+ b .reload ()
1208
+ b .enter_page ('/machines' )
1209
+
1210
+ b .click (f"#vm-{ self .name } -system-action-kebab" )
1211
+ b .wait_visible (f"#vm-{ self .name } -system-action-kebab + .pf-v5-c-menu" )
1212
+ b .click (f"#vm-{ self .name } -system-delete" )
1213
+ b .wait_visible (f"#vm-{ self .name } -delete-modal-dialog" )
1214
+ b .set_checked (f"#vm-{ self .name } -delete-modal-dialog input[name=check-action-vda]" , False )
1215
+ b .click (f"#vm-{ self .name } -delete-modal-dialog button:contains(\" Delete\" )" )
1216
+ print ("---------End for the first removing---------" )
1217
+ b .wait_not_present (f"#vm-{ self .name } -delete-modal-dialog" )
1218
+ b .wait_visible ("#virtual-machines-listing" )
1219
+ b .wait_not_present (f"#vm-{ self .name } -system-name" )
1220
+
1221
+ self .open ().fill ()
1222
+ b .click (buttonSelector )
1223
+
1224
+ if not self .create_and_run :
1225
+ b .wait_visible (f"h1:contains(\" Creating VM { self .name } \" )" )
1226
+ b .wait_visible ("button:contains(\" Go to VMs list\" )" )
1227
+ else :
1228
+ b .wait_in_text (f"#vm-{ self .name } -system-state" , "Creating VM" )
1229
+ testlib .wait (lambda : "Running" in b .text (f"#vm-{ self .name } -system-state" ))
1230
+ b .click (f"#vm-{ self .name } -system-name" )
1231
+ b .wait_visible ("#vm-details" )
1232
+ b .wait_in_text ("h2.vm-name" , self .name )
1233
+
1234
+ # debug
1235
+ # It seems that the difference between removing success and failure is doUsagePolling and reducer "UPDATE_VM" action.
1236
+ # Thus, try to reload the page to trigger these event manually to see whether it could resolve the problem
1237
+ b .reload ()
1238
+ b .enter_page ('/machines' )
1239
+ print ("---------Start for the second removing---------" )
1240
+ b .click (f"#vm-{ self .name } -system-action-kebab" )
1241
+ b .wait_visible (f"#vm-{ self .name } -system-action-kebab + .pf-v5-c-menu" )
1242
+ b .click (f"#vm-{ self .name } -system-delete" )
1243
+ b .wait_visible (f"#vm-{ self .name } -delete-modal-dialog" )
1244
+ b .set_checked (f"#vm-{ self .name } -delete-modal-dialog input[name=check-action-vda]" , False )
1245
+ b .click (f"#vm-{ self .name } -delete-modal-dialog button:contains(\" Delete\" )" )
1246
+ print ("---------End for the second removing---------" )
1247
+ b .wait_not_present (f"#vm-{ self .name } -delete-modal-dialog" )
1248
+ b .wait_visible ("#virtual-machines-listing" )
1249
+ b .wait_not_present (f"#vm-{ self .name } -system-name" )
1250
+
1251
+ return self
1252
+
1171
1253
def checkOsFiltered (self , present = False ):
1172
1254
b = self .browser
1173
1255
@@ -1913,6 +1995,11 @@ vnc_password= "{vnc_passwd}"
1913
1995
1914
1996
self ._assertScriptFinished ().checkEnvIsEmpty ()
1915
1997
1998
+ def checkMiddlePageWhenCreatingTest (self , dialog ):
1999
+ dialog .open ().fill ().checkMiddlePageWhenCreating ()
2000
+
2001
+ self ._assertScriptFinished ().checkEnvIsEmpty ()
2002
+
1916
2003
# Many of testCreate* tests use these helpers - let's keep them here to avoid repetition
1917
2004
def checkDialogFormValidationTest (self , dialog , errors , create = True , is_warning = False ):
1918
2005
dialog .open () \
0 commit comments