Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Disinfection.java =================================================================== diff -u -r19482 -r19507 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Disinfection.java (.../Disinfection.java) (revision 19482) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Disinfection.java (.../Disinfection.java) (revision 19507) @@ -991,7 +991,7 @@ * 外部代理灭菌没有申请人 * */ @Test - public void disinfection_agent_outside() { + public void disinfection_agent_outside_no() { try { Utils.refresh(); Utils.retryingFindAndClick(By.id("enterpriseView")); @@ -1058,10 +1058,10 @@ } /** - * 省医外部代理灭菌 + * 外部代理灭菌 * */ @Test - public void disinfection_gdsy_agent_outside() { + public void disinfection_agent_outside() { try { Utils.refresh(); Utils.retryingFindAndClick(By.id("enterpriseView")); @@ -1108,12 +1108,12 @@ Utils.retryingFindAndClick(By .xpath("//div/div/div[contains(text(), '" + name + "')]")); Utils.retryingFindAndSendKeys(By.id("count1"), "3" + "\n"); + if (Utils.isFind(Utils.retryingFindAssure(By.id("maker")))){ + Utils.retryingFindAndSendKeys(By.id("maker"), Utils.settings + .getJSONObject("一级供应室配包人").getString("姓名")); - Utils.retryingFindAndSendKeys(By.id("maker"), Utils.settings - .getJSONObject("一级供应室配包人").getString("姓名")); - - Utils.retryingFindAndSendKeys(By.id("maker"), "\n"); - + Utils.retryingFindAndSendKeys(By.id("maker"), "\n"); + } Utils.retryingFindAndClick(By .xpath("//button[contains(text(), '装配并打印标签')]")); Index: ssts-web/src/test/resources/test/forgon/disinfectsystem/selenium/config/all/settings.json =================================================================== diff -u -r18707 -r19507 --- ssts-web/src/test/resources/test/forgon/disinfectsystem/selenium/config/all/settings.json (.../settings.json) (revision 18707) +++ ssts-web/src/test/resources/test/forgon/disinfectsystem/selenium/config/all/settings.json (.../settings.json) (revision 19507) @@ -1,8 +1,8 @@ { - "seleniumBrowserApplicationName": "win7_IE11_thinkpad_E450C", + "seleniumBrowserApplicationName": "win10_IE11_19_server", "seleniumBrowserVersion": "11.0", - "seleniumHubURL": "http://192.168.2.18:4444/wd/hub", - "服务器地址": "http://192.168.2.18:8082/gdsy", + "seleniumHubURL": "http://192.168.2.18:4444/wd/hub", + "服务器地址": "http://192.168.2.18:8082/gdsy", "触摸屏清洗服务地址": "/logon.jsp?logonType=washform", "一级供应室用户": { "工号": "cssduser1", @@ -112,10 +112,14 @@ "名称": "动脉采血器", "类型": "一次性物品" }, - "一级供应室外部代理灭菌包": { + "一级供应室外部代理灭菌包1": { "固定条码": "", "名称": "4#压力蒸汽灭菌包" }, + "一级供应室外部代理灭菌包2": { + "固定条码": "", + "名称": "test121#压力蒸汽灭菌包" + }, "一级供应室材料": { "拼音码": "qz", "名称": "Test钳子" Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java =================================================================== diff -u -r19410 -r19507 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java (.../ALL.java) (revision 19410) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java (.../ALL.java) (revision 19507) @@ -91,9 +91,11 @@ login.login_secondSupplyRoom(true); Utils.retryingFindAndClick(By.id("enterpriseView")); Utils.retryingFindAndSwitchToFrame(By.id("iframe_enterpriseView")); - Utils.retryingFindAndClick(By.xpath("//div/span[contains(text(), '后台监控管理')]")); + Utils.retryingFindAndClick(By + .xpath("//div/span[contains(text(), '后台监控管理')]")); - Utils.retryingFindAndClick(By.xpath("//div/a/span[contains(text(), '一次性物品管理')]")); + Utils.retryingFindAndClick(By + .xpath("//div/a/span[contains(text(), '一次性物品管理')]")); one.One_use_Entry_success(); one.after(); @@ -119,21 +121,33 @@ /** 二级供应室回收 */ /** 二级供应室自定义入筐回收 */ recyle.recyle_custom(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); /** 二级供应室判断消毒物品申请单是否存在 */ Utils.retryingFind(By.tagName("body")); - WebElement element = Utils.retryingFindForthCellOfTable(By.id("awaitForRecycleTable")); + WebElement element = Utils.retryingFindForthCellOfTable(By + .id("awaitForRecycleTable")); if (Utils.isFind(element)) { recyle.recyle_SecondSupplyRoom(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); Utils.retryingFindAndClick(By.id("return")); - Utils.waitUntilUrlChange(SERVER_URL + "/homepage/portalPage.jsp", 8); + Utils.waitUntilUrlChange(SERVER_URL + + "/homepage/portalPage.jsp", 8); Utils.tryToCloseWarningWindow(); } else { - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); Utils.retryingFindAndClick(By.id("return")); - Utils.waitUntilUrlChange(SERVER_URL + "/homepage/portalPage.jsp", 8); + Utils.waitUntilUrlChange(SERVER_URL + + "/homepage/portalPage.jsp", 8); Utils.tryToCloseWarningWindow(); } /** 二级供应室清洗成功 */ @@ -143,44 +157,73 @@ recyle.init(); /** 一级供应室回收带标识牌的回收单 */ recyle.recyle_recyleSignboardAndDropAndScrap(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); logger.info("一级供应室回收带标识牌的回收单完成"); /** 一级供应室回收单确认 */ recyle.recyle_confirm_new(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); logger.info("一级供应室回收单确认"); /** 一级供应室回收部分终止的单 */ recyle.recyle_oneSupplyRoom(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.jsp?resolution=1980", + 8); logger.info("一级供应室回收部分终止的单完成"); /** 切换篮筐并丢失材料 */ recyle.recyle_changeBasket(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); logger.info("切换篮筐并丢失材料完成"); /** 一级供应室回收单确认 */ recyle.recyle_confirm_new(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); logger.info("一级供应室回收单确认完成"); /** 一级供应室回收申请单 */ recyle.recyle_oneSupplyRoomSignboard(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); logger.info("一级供应室回收申请单完成"); /** 一级供应室回收外来器械 */ recyle.recyle_Foreign_edit(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); recyle.recyle_Foreign(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); logger.info("一级供应室回收外来器械完成"); /** 判断自定义器械包申请单是否存在 */ Utils.retryingFind(By.tagName("body")); - element = Utils.retryingFindForthCellOfTable(By.id("awaitForRecycleTable")); + element = Utils.retryingFindForthCellOfTable(By + .id("awaitForRecycleTable")); if (Utils.isFind(element)) { recyle.recyle_customSet(); - Utils.waitUntilUrlChange(SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); + Utils.waitUntilUrlChange( + SERVER_URL + + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", + 8); } /** 判断消毒物品申请单是否存在 */ Utils.retryingFind(By.tagName("body")); - element = Utils.retryingFindForthCellOfTable(By.id("awaitForRecycleTable")); + element = Utils.retryingFindForthCellOfTable(By + .id("awaitForRecycleTable")); if (Utils.isFind(element)) { recyle.recyle_customSet(); recyle.after(); @@ -197,19 +240,22 @@ // 一级供应室清洗并清洗添加材料 wash.wash_oneSupplyRoom(); // 清洗删除篮筐再添加篮筐,扫描不同的责任人 - Utils.retryingFindAndClick(By.xpath("//button[contains(text(), '添加')]")); + Utils.retryingFindAndClick(By + .xpath("//button[contains(text(), '添加')]")); Utils.driver.switchTo().defaultContent(); String currentwindowhandle = Utils.driver.getWindowHandle(); Utils.driver.switchTo().window(currentwindowhandle); wash.wash_washChangeBasket(); - Utils.retryingFindAndClick(By.xpath("//button[contains(text(), '添加')]")); + Utils.retryingFindAndClick(By + .xpath("//button[contains(text(), '添加')]")); Utils.driver.switchTo().defaultContent(); currentwindowhandle = Utils.driver.getWindowHandle(); Utils.driver.switchTo().window(currentwindowhandle); // 清洗失败,重新清洗,清洗完成,清洗机需要设置为清洗确认 wash.wash_fail_reWash_Finish(); Utils.driver.switchTo().defaultContent(); - Utils.retryingFindAndClick(By.xpath("//span[contains(text(), '个人桌面')]")); + Utils.retryingFindAndClick(By + .xpath("//span[contains(text(), '个人桌面')]")); /*** 材料入库报损丢失的材料 ***/ System.out.print("报损补充开始:"); Utils.DateTime(); @@ -226,17 +272,23 @@ System.out.print("审核开始:"); Utils.DateTime(); Utils.driver.switchTo().defaultContent(); - Utils.retryingFindAndClick(By.xpath("//span[contains(text(), '个人桌面')]")); + Utils.retryingFindAndClick(By + .xpath("//span[contains(text(), '个人桌面')]")); Actions moveover = new Actions(Utils.driver); - moveover.moveToElement(Utils.retryingFind(By.id("reviewPacking"))).perform(); - Utils.retryingFindAndClick(By.linkText(Utils.settings.getJSONObject("一级供应室装配组").getString("名称3"))); + moveover.moveToElement(Utils.retryingFind(By.id("reviewPacking"))) + .perform(); + Utils.retryingFindAndClick(By.linkText(Utils.settings + .getJSONObject("一级供应室装配组").getString("名称3"))); Utils.retryingFindAndSwitchToFrame(By.id("iframe_reviewPacking")); - element = Utils.retryingFind(By.xpath("//button[contains(text(), '进入审核列表')]")); + element = Utils.retryingFind(By + .xpath("//button[contains(text(), '进入审核列表')]")); handleReview(element, review); Utils.refresh(); moveover = new Actions(Utils.driver); - moveover.moveToElement(Utils.retryingFind(By.id("packing"))).perform(); - Utils.retryingFindAndClick(By.linkText(Utils.settings.getJSONObject("一级供应室装配组").getString("名称2"))); + moveover.moveToElement(Utils.retryingFind(By.id("packing"))) + .perform(); + Utils.retryingFindAndClick(By.linkText(Utils.settings + .getJSONObject("一级供应室装配组").getString("名称2"))); Utils.retryingFindAndSwitchToFrame(By.id("iframe_packing")); /*** 一级供应室补充丢失的材料 ***/ assemble.assemble_supplementLoss(); @@ -272,17 +324,32 @@ /*** 一级供应室修改历史装配 ***/ Utils.refresh(); ph.assemble_modifyTousse(); + /*** 一级供应室代临床申请外部代理灭菌 ***/ + disinfection.disinfection_agent_outside(); Utils.refresh(); /*** 一级供应室审核器械包、敷料包 ***/ moveover = new Actions(Utils.driver); - moveover.moveToElement(Utils.retryingFind(By.id("reviewPacking"))).perform(); - Utils.retryingFindAndClick(By.linkText(Utils.settings.getJSONObject("一级供应室装配组").getString("名称2"))); + moveover.moveToElement(Utils.retryingFind(By.id("reviewPacking"))) + .perform(); + Utils.retryingFindAndClick(By.linkText(Utils.settings + .getJSONObject("一级供应室装配组").getString("名称1"))); Utils.retryingFindAndSwitchToFrame(By.id("iframe_reviewPacking")); - element = Utils.retryingFind(By.xpath("//button[contains(text(), '进入审核列表')]")); + element = Utils.retryingFind(By + .xpath("//button[contains(text(), '进入审核列表')]")); handleReview(element, review); + /*** 一级供应室审核器械包、敷料包 ***/ + Utils.refresh(); + moveover = new Actions(Utils.driver); + moveover.moveToElement(Utils.retryingFind(By.id("reviewPacking"))) + .perform(); + Utils.retryingFindAndClick(By.linkText(Utils.settings + .getJSONObject("一级供应室装配组").getString("名称2"))); + Utils.retryingFindAndSwitchToFrame(By.id("iframe_reviewPacking")); + element = Utils.retryingFind(By + .xpath("//button[contains(text(), '进入审核列表')]")); + handleReview(element, review); /*** 一级供应室灭菌装载删除 ***/ disinfection.disinfection_loading(); - // 一级供应室灭菌 SterilizationTest.sterilizationSeriesOperationsOfFristSupplyRoom(); @@ -305,7 +372,8 @@ System.out.print("归还借物开始:"); Utils.DateTime(); Utils.driver.switchTo().defaultContent(); - Utils.retryingFindAndClick(By.xpath("//span[contains(text(), '个人桌面')]")); + Utils.retryingFindAndClick(By + .xpath("//span[contains(text(), '个人桌面')]")); apply.apply_borrow_return(); apply.after(); } catch (Exception e) { @@ -332,20 +400,23 @@ if (Utils.driver instanceof RemoteWebDriver) { session = ((RemoteWebDriver) Utils.driver).getSessionId(); } else if (Utils.driver instanceof InternetExplorerDriver) { - session = ((InternetExplorerDriver) Utils.driver).getSessionId(); + session = ((InternetExplorerDriver) Utils.driver) + .getSessionId(); } if (session != null) { String webAppRootPath = PathUtils.getWebAppRootPath(); - String buildTempPath = webAppRootPath.replaceAll("/src/main/webapp", "/build/tmp"); + String buildTempPath = webAppRootPath.replaceAll( + "/src/main/webapp", "/build/tmp"); // 删除之前产生的png文件 final File folder = new File(buildTempPath); final File[] files = folder.listFiles(new FilenameFilter() { public boolean accept(final File dir, final String name) { - return name.endsWith(".png") && name.startsWith("screenshot"); + return name.endsWith(".png") + && name.startsWith("screenshot"); } }); for (final File file : files) { @@ -355,10 +426,13 @@ } // 截图 - File scrFile = ((TakesScreenshot) Utils.driver).getScreenshotAs(OutputType.FILE); + File scrFile = ((TakesScreenshot) Utils.driver) + .getScreenshotAs(OutputType.FILE); - String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH.mm.ss").format(new java.util.Date()); - FileUtils.copyFile(scrFile, new File(buildTempPath + "/screenshot-" + timeStamp + ".png")); + String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH.mm.ss") + .format(new java.util.Date()); + FileUtils.copyFile(scrFile, new File(buildTempPath + + "/screenshot-" + timeStamp + ".png")); } } catch (Exception e) { e.printStackTrace();