Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java =================================================================== diff -u -r20396 -r20492 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java (.../ALL.java) (revision 20396) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java (.../ALL.java) (revision 20492) @@ -173,7 +173,7 @@ /** 二级供应室装配后做代理灭菌 */ login.login_oneSupplyRoom(); disinfection.disinfection_agent(); - disinfection.after(); + afterMethod(); recyle.init(); /** 一级供应室回收带标识牌的回收单 */ recyle.recyle_recyleSignboardAndDropAndScrap(); @@ -246,16 +246,16 @@ .id("awaitForRecycleTable")); if (Utils.isFind(element)) { recyle.recyle_customSet(); - recyle.after(); + afterMethod(); } else { - recyle.after(); + afterMethod(); } /*** 一级供应室清洗 ***/ System.out.print("清洗开始:"); Utils.DateTime(); // 触摸屏清洗 wash.wash_touch(); - wash.after(); + afterMethod(); wash.init(); // 一级供应室清洗并清洗添加材料 wash.wash_oneSupplyRoom(); @@ -490,15 +490,20 @@ regular_Monitor.Regular_Monitor_Qualified(); Utils.refresh(); regular_Monitor.Regular_Monitor_Unqualified(); - regular_Monitor.after(); - /*** 供应室二次回收外来器械 ***/ + afterMethod(); recyle.init(); - recyle.recyle_Foreign_Twice(); + /*** 供应室回收还物单 ***/ + recyle.recyle_return(); Utils.waitUntilUrlChange( SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); - recyle.recyle_return(); + /*** 供应室回收终止 ***/ + recyle.recyle_terminate(); + afterMethod(); + recyle.init(); + /*** 供应室二次回收外来器械 ***/ + recyle.recyle_Foreign_Twice(); Utils.waitUntilUrlChange( SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", @@ -517,7 +522,7 @@ recall.Recall_One_use(); Utils.refresh(); recall.Recall_Set(); - recall.after(); + afterMethod(); } catch (Exception e) { logger.error(e, e); e.printStackTrace(); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Recyle.java =================================================================== diff -u -r20400 -r20492 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Recyle.java (.../Recyle.java) (revision 20400) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Recyle.java (.../Recyle.java) (revision 20492) @@ -6,6 +6,7 @@ import static org.testng.AssertJUnit.assertTrue; import java.util.List; +import java.util.Set; import java.util.function.Function; import net.sf.json.JSONObject; @@ -407,6 +408,47 @@ } /** + * 一级供应室回收终止 + * */ + @Test + public void recyle_terminate() { + try { + if (Utils.isFind(Utils.retryingFind(By + .cssSelector("div[class='his_item']")))) { + Utils.retryingFindClickFirstCellOfTable(By + .id("recyclingRecordTable")); + JSWaiter.waitUntilJQueryReady(); + Utils.isFind(Utils.retryingFindAssure(By.id("tousseItemTable"))); + waitUrlChange(); + Utils.switchToDefaultContent(); + // 获得当前窗口 + String mainWindow = Utils.driver.getWindowHandle(); + // 直接调用webElement的click,避免js打开模态窗口后代码阻塞的问题 + if (Utils.isFind(Utils.retryingFind(By.id("btn-terminate")))) { + Utils.retryingFindAndClickBySeleniumAPI(By + .id("btn-terminate")); + Utils.waitForWindowAmountEquals(2, 8000); + // 获取所有窗口 + Set handles = Utils.driver.getWindowHandles(); + // 删除当前窗口 + handles.remove(mainWindow); + for (String windowHandle : handles) { + Utils.driver.switchTo().window(windowHandle); + } + if (Utils.isFind(Utils.retryingFind(By.id("other")))) { + Utils.retryingFindAndClick(By.id("other")); + Utils.retryingFindAndSendKeys(By.id("tem"), "回收终止"); + Utils.retryingFindAndClick(By.id("confirm")); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + AssertJUnit.fail(e.getMessage()); + } + } + + /** * 一级供应室通过添加回收单回收、丢失、报损 * */ @Test