def test_flash_imm(self): print("####################") print("Now begin to test flash IMM") print("####################") driver = self.driver login.login(self) print("Now login web gui") try: driver.find_element_by_id("dijit_MenuBarItem_0_text") finally: time.sleep(5) print("Web is ready now") driver.find_element_by_id("dijit_PopupMenuBarItem_2_text").click() driver.find_element_by_css_selector( "#dijit_MenuItem_9_text > table > tbody > tr > td").click() driver.find_element_by_id("btnUpdateFwDlg_label").click() time.sleep(5) # .find_element_by_css_selector("input.dijitOffScreen").click() # driver.find_element_by_name("uploadedfile").clear() driver.find_element_by_name("uploadedfile").send_keys(immImage) try: driver.find_element_by_id( "updateServerFirmwareWizardbtnNext_label").click() finally: time.sleep(10) print("Now upload imm image") driver.find_element_by_id( "updateServerFirmwareWizardbtnNext_label").click() time.sleep(200) try: driver.find_element_by_id( "updateServerFirmwareWizardbtnNext_label").click() finally: time.sleep(15) print("Wait to flash imm image finished,need 2 min 37 sec") driver.find_element_by_id( "updateServerFirmwareWizardbtnNext_label").click() time.sleep(5) driver.find_element_by_id( "updateServerFirmwareWizardbtnNext_label").click() time.sleep(160) # driver.find_element_by_xpath("(//input[@value=''])[5]").click() if driver.find_element_by_id("restartIMMId_label"): driver.find_element_by_id("restartIMMId_label").click() time.sleep(5) else: time.sleep(30) driver.find_element_by_id("restartIMMId_label").click() time.sleep(5) driver.find_element_by_id("commonPopupOk_label").click() print("Reatart imm,wait about 5 min") time.sleep(720) print("Finish test to flash imm fw")
def test_flash_dsa(self): print("####################") print("Now begin to test flash DSA") print("####################") driver = self.driver login.login(self) print("Now login web gui") try: driver.find_element_by_id("dijit_MenuBarItem_0_text") finally: time.sleep(5) print("Web is ready now") driver.find_element_by_id("dijit_PopupMenuBarItem_2_text").click() driver.find_element_by_css_selector("#dijit_MenuItem_9_text > table > tbody > tr > td").click() time.sleep(5) driver.find_element_by_id("btnUpdateFwDlg_label").click() time.sleep(5) # .find_element_by_css_selector("input.dijitOffScreen").click() # driver.find_element_by_name("uploadedfile").clear() driver.find_element_by_name("uploadedfile").send_keys(dsaImage) if driver.find_element_by_id("updateServerFirmwareWizardbtnNext_label"): driver.find_element_by_id("updateServerFirmwareWizardbtnNext_label").click() print("1.Now upload DSA image,need about 250s") else: time.sleep(10) print("2.Now upload DSA image,need about 250s") driver.find_element_by_id("updateServerFirmwareWizardbtnNext_label").click() time.sleep(420) if driver.find_element_by_id("updateServerFirmwareWizardbtnNext_label"): print("1.wait to flash dsa") driver.find_element_by_id("updateServerFirmwareWizardbtnNext_label").click() else: time.sleep(30) print("2.wait to flash dsa") driver.find_element_by_id("updateServerFirmwareWizardbtnNext_label").click() driver.find_element_by_id("updateServerFirmwareWizardbtnNext_label").click() print("Wait to flash DSA image finished,need 120 sec") time.sleep(5) driver.find_element_by_id("updateServerFirmwareWizardbtnNext_label").click() time.sleep(5) driver.find_element_by_id("updateServerFirmwareWizardbtnNext_label").click() time.sleep(5) driver.find_element_by_id("updateServerFirmwareWizardbtnNext_label").click() time.sleep(200) print("Finish test to flash DSA fw")
def test_flash_uefi(self): print("####################") print("Now begin to test flash UEFI") print("####################") driver = self.driver login.login(self) print("Now login web gui") try: driver.find_element_by_id("dijit_MenuBarItem_0_text") finally: time.sleep(5) print("Web is ready now") driver.find_element_by_id("dijit_PopupMenuBarItem_2_text").click() driver.find_element_by_css_selector( "#dijit_MenuItem_9_text > table > tbody > tr > td").click() time.sleep(5) driver.find_element_by_id("btnUpdateFwDlg_label").click() time.sleep(5) # .find_element_by_css_selector("input.dijitOffScreen").click() # driver.find_element_by_name("uploadedfile").clear() driver.find_element_by_name("uploadedfile").send_keys(uefiImage) try: driver.find_element_by_id( "updateServerFirmwareWizardbtnNext_label").click() finally: time.sleep(10) print("Now upload UEFI image") driver.find_element_by_id( "updateServerFirmwareWizardbtnNext_label").click() time.sleep(20) try: driver.find_element_by_id( "updateServerFirmwareWizardbtnNext_label").click() finally: time.sleep(15) driver.find_element_by_id( "updateServerFirmwareWizardbtnNext_label").click() print("Wait to flash UEFI image finished,need 1 min 37 sec") time.sleep(5) driver.find_element_by_id( "updateServerFirmwareWizardbtnNext_label").click() time.sleep(110) # driver.find_element_by_xpath("(//input[@value=''])[4]").click() if driver.find_element_by_id("restartOSId_label"): print("Restart OS") time.sleep(10) driver.find_element_by_id("restartOSId_label").click() else: print(" ") time.sleep(10) driver.find_element_by_id("restartOSId_label").click() time.sleep(5) driver.find_element_by_id("commonPopupOk_label").click() time.sleep(5) driver.find_element_by_id("commonPopupClose_label").click() time.sleep(10) driver.find_element_by_id("dijit_MenuBarItem_0_text").click() time.sleep(5) driver.find_element_by_id( "btnserverActionsListHealthSumm_label").click() time.sleep(5) driver.find_element_by_id("serverActionsListHealthSumm63_text").click() time.sleep(5) driver.find_element_by_id("commonPopupOk_label").click() time.sleep(5) driver.find_element_by_id("commonPopupClose_label").click() print("Reatart os,wait about 5 min") time.sleep(300) print("Finish test to flash UEFI fw")