Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Recyle.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Recyle.java (.../Recyle.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Recyle.java (.../Recyle.java) (revision 26427) @@ -1091,10 +1091,10 @@ .cssSelector("option[value='(待接收)外来器械包申请单']")); // 因为上面的代码click后,选项还是没确认,所以输入回车符,对上面选中的选项进行确认。 - Utils.retryingFindAndSendKeys(By.id("appTypeSelect"), "\n"); +// Utils.retryingFindAndSendKeys(By.id("appTypeSelect"), "\n"); // 因为输入了回车符,目前的代码认为是进行了条码扫描,会出现“条码长度不符合规范”的提示警告框,因此接受该警告框 - assemble.isAlertPresent(); +// assemble.isAlertPresent(); String barcode = Utils.settings.getJSONObject("临床科室").getString( "条码"); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/TestDemo.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/TestDemo.java (.../TestDemo.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/TestDemo.java (.../TestDemo.java) (revision 26427) @@ -5,6 +5,7 @@ import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.io.IOException; +import java.util.List; import org.monte.media.Format; import org.monte.media.FormatKeys.MediaType; @@ -18,6 +19,8 @@ import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.WebDriverWait; +import bsh.StringUtil; +import test.forgon.disinfectsystem.selenium.sterilization.helper.SterilizationHelper; import test.forgon.disinfectsystem.selenium.tools.Utils; import test.forgon.disinfectsystem.selenium2.tools.JSWaiter; import static org.monte.media.FormatKeys.EncodingKey; @@ -35,7 +38,7 @@ public static ScreenRecorder screenRecorder; public static void main(String[] args) throws IOException, AWTException { - + try { Runtime.getRuntime().exec("Taskkill /F /IM IEDriverServer.exe *32"); Runtime.getRuntime().exec("Taskkill /F /IM IEDriverServer.exe"); @@ -46,43 +49,106 @@ // TODO Auto-generated catch block e1.printStackTrace(); } - + System.setProperty("webdriver.ie.driver","C:/yuandongxiao/tools/selenium/3.141.59/IEDriverServer_Win32_3.141.59/IEDriverServer.exe"); - - /** - * 视频录制 - */ - GraphicsConfiguration gconfig = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration(); - screenRecorder = new ScreenRecorder(gconfig, new Format(MediaTypeKey, - MediaType.FILE, MimeTypeKey, MIME_AVI), new Format( - MediaTypeKey, MediaType.VIDEO, EncodingKey, - ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE, CompressorNameKey, - ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE, DepthKey, (int) 24, - FrameRateKey, Rational.valueOf(15), QualityKey, 1.0f, - KeyFrameIntervalKey, (int) (15 * 60)), new Format(MediaTypeKey, - MediaType.VIDEO, EncodingKey, "black", FrameRateKey, - Rational.valueOf(30)), null); - + + // /** + // * 视频录制 + // */ + // GraphicsConfiguration gconfig = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration(); + // screenRecorder = new ScreenRecorder(gconfig, new Format(MediaTypeKey, + // MediaType.FILE, MimeTypeKey, MIME_AVI), new Format( + // MediaTypeKey, MediaType.VIDEO, EncodingKey, + // ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE, CompressorNameKey, + // ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE, DepthKey, (int) 24, + // FrameRateKey, Rational.valueOf(15), QualityKey, 1.0f, + // KeyFrameIntervalKey, (int) (15 * 60)), new Format(MediaTypeKey, + // MediaType.VIDEO, EncodingKey, "black", FrameRateKey, + // Rational.valueOf(30)), null); + WebDriver driver = new InternetExplorerDriver(); - - screenRecorder.start(); - driver.get("http://192.168.2.117:8080/js/a.html"); - WebElement button = driver.findElement(By.id("test")); - String onclickScript = button.getAttribute("onclick"); - JavascriptExecutor js = (JavascriptExecutor) driver; - js.executeScript(onclickScript); - System.out.println("窗口数量:"+driver.getWindowHandles().size()); - Boolean flag = new WebDriverWait(driver, 30) { - }.until(new ExpectedCondition() { - public Boolean apply(WebDriver driver) { - return driver.getWindowHandles().size()==2; - } - }); - - JSWaiter.sleep(1000); - System.out.println("窗口打开完成:"+flag); - screenRecorder.stop(); - } + // screenRecorder.start(); + driver.get("http://localhost:8076/js/a.html"); + // WebElement button = driver.findElement(By.id("test")); + // String onclickScript = button.getAttribute("onclick"); + // JavascriptExecutor js = (JavascriptExecutor) driver; + // js.executeScript(onclickScript); + // System.out.println("窗口数量:"+driver.getWindowHandles().size()); + // Boolean flag = new WebDriverWait(driver, 30) { + // }.until(new ExpectedCondition() { + // public Boolean apply(WebDriver driver) { + // return driver.getWindowHandles().size()==2; + // } + // }); + // + // JSWaiter.sleep(1000); + // System.out.println("窗口打开完成:"+flag); + // screenRecorder.stop(); + + // List tables = driver.findElements(By.xpath("//*[@id='div1']//table")); + // for(WebElement table : tables){ + // List trs= table.findElements(By.tagName("tr")); + // for(int i=0;i tds = trs.get(i).findElements(By.tagName("td")); + // WebElement div = tds.get(0).findElement(By.tagName("div")); + // System.out.println(div.getText()); + // } + // } + + // WebElement w = driver.findElement(By.id("table2")); + // System.out.println(w.getText()); + +// int i = 0; +// while(i<3){ +// i = deleteTousse(i); +// } + List tousseRows = driver.findElements(By.xpath("//*[@id='table1']//tr")); + if(tousseRows.size()>0){ + for(WebElement row:tousseRows){ + List cols = row.findElements(By.tagName("td")); + if(cols.size()>0){ + if("Test治疗巾".equals(cols.get(0).getText())){ + cols.get(1).clear(); + break; + } + } + } + } + + } + + /** + * 移除器械包明细表中的器械包 + * @param i + * @return + */ + public static int deleteTousse(int i){ + //器械包明细表 + List tables = Utils.driver.findElements(By.xpath("//*[@id='tousseGrid']/div[2]/div[1]/div[1]/div[1]/div[2]//tbody")); + if(tables.size()>0){ + for(WebElement table:tables){ + //取器械包明细表的第一行 + WebElement tr= table.findElement(By.tagName("tr")); + List tds = tr.findElements(By.tagName("td")); + //条码在第二列 + String barcodeText = tds.get(1).getText(); + if(barcodeText!=null&&(!barcodeText.equals(""))){ + JSWaiter.waitUntilJSReady(); + JSWaiter.waitUntilJQueryReady(); + //把将要移出的条形码保存在未入筐条码集合中 + SterilizationHelper.notEntryBasketTousseBarcods.add(barcodeText); + //点击移除图标,移除图标在第五列 + WebElement imgDiv = tds.get(4).findElement(By.tagName("div")); + WebElement img = imgDiv.findElement(By.tagName("img")); + img.click(); + i++; + break; + } + } + + } + return i; + } } Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Disinfection.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Disinfection.java (.../Disinfection.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Disinfection.java (.../Disinfection.java) (revision 26427) @@ -12,6 +12,7 @@ import java.io.IOException; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.function.Function; @@ -21,11 +22,15 @@ import org.apache.log4j.Logger; import org.openqa.selenium.Alert; import org.openqa.selenium.By; +import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.support.ui.ExpectedCondition; +import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.Wait; +import org.openqa.selenium.support.ui.WebDriverWait; import test.forgon.disinfectsystem.selenium.factory.WaitFactory; import test.forgon.disinfectsystem.selenium.sterilization.helper.SterilizationHelper; @@ -131,55 +136,99 @@ Utils.retryingFindAndClick(By .xpath("//button[contains(text(), '是')]")); } + //灭菌装载删除 disinfection_loading_load(); - String b = null; - for (int i = 0; i < 6; i++) { + + //选取篮筐中的前三个条码不为空的器械包移出篮筐 + int i = 0; + List tables = new ArrayList(); + while(i<3){ + JSWaiter.waitUntilJSReady(); JSWaiter.waitUntilJQueryReady(); - List allRows = Utils.driver.findElements(By - .cssSelector("table[class='x-grid3-row-table']")); - logger.debug("rows size = " + allRows.size()); - if (allRows.size() > 0) { + //器械包明细表 + tables = Utils.driver.findElements(By.xpath("//*[@id='tousseGrid']/div[2]/div[1]/div[1]/div[1]/div[2]//tbody")); + logger.debug("rows size = " + tables.size()); + if(tables.size()>0){ + //页面发生变化后,需要重新获取该元素 + JSWaiter.waitUntilJSReady(); JSWaiter.waitUntilJQueryReady(); - allRows = Utils.driver.findElements(By - .cssSelector("table[class='x-grid3-row-table']")); - for (WebElement row : allRows) { - b = row.getText(); - b = b.trim(); - String regEx = "[^0-9]"; - Pattern p = Pattern.compile(regEx); - Matcher m = p.matcher(b); - b = m.replaceAll("").trim(); - logger.debug("row text = " + b); - if (b.length() >= 9) { - if (b.length() == 9) { - b = b.substring(b.indexOf("0"), - b.indexOf("0") + 9); - } else { - b = b.substring(b.indexOf("0"), - b.indexOf("0") + 10); - } - int a = Integer.valueOf(b).intValue(); - if (a % 2 != 0) { - JSWaiter.waitUntilJQueryReady(); - row.findElement(By.tagName("img")).click(); - SterilizationHelper.notEntryBasketTousseBarcods - .add("0" + a); - break; - } - } else { - continue; + tables = Utils.driver.findElements(By.xpath("//*[@id='tousseGrid']/div[2]/div[1]/div[1]/div[1]/div[2]//tbody")); + for(WebElement table:tables){ + //取器械包明细表的第一行 + WebElement tr= table.findElement(By.tagName("tr")); + List tds = tr.findElements(By.tagName("td")); + //条码在第二列 + String barcodeText = tds.get(1).getText(); + if(barcodeText!=null&&(!barcodeText.equals(""))&&Integer.parseInt(barcodeText)%2!=0){ + JSWaiter.waitUntilJSReady(); + JSWaiter.waitUntilJQueryReady(); + //点击移除图标,移除图标在第五列 + WebElement imgDiv = tds.get(4).findElement(By.tagName("div")); + WebElement img = imgDiv.findElement(By.tagName("img")); + Actions action = new Actions(Utils.driver); + action.moveToElement(img); + action.click().perform(); + //把将要移出的条形码保存在未入筐条码集合中 + SterilizationHelper.notEntryBasketTousseBarcods.add(barcodeText); + logger.info("移除的条码为:"+barcodeText); + i++; + break; } } - } else { + }else{ break; } } + +// String b = null; +// for (int i = 0; i < 6; i++) { +// JSWaiter.waitUntilJQueryReady(); +// List allRows = Utils.driver.findElements(By +// .cssSelector("table[class='x-grid3-row-table']")); +// logger.debug("rows size = " + allRows.size()); +// if (allRows.size() > 0) { +// JSWaiter.waitUntilJQueryReady(); +// allRows = Utils.driver.findElements(By +// .cssSelector("table[class='x-grid3-row-table']")); +// for (WebElement row : allRows) { +// b = row.getText(); +// b = b.trim(); +// String regEx = "[^0-9]"; +// Pattern p = Pattern.compile(regEx); +// Matcher m = p.matcher(b); +// b = m.replaceAll("").trim(); +// logger.debug("row text = " + b); +// if (b.length() >= 9) { +// if (b.length() == 9) { +// b = b.substring(b.indexOf("0"), +// b.indexOf("0") + 9); +// } else { +// b = b.substring(b.indexOf("0"), +// b.indexOf("0") + 10); +// } +// int a = Integer.valueOf(b).intValue(); +// if (a % 2 != 0) { +// JSWaiter.waitUntilJQueryReady(); +// row.findElement(By.tagName("img")).click(); +// SterilizationHelper.notEntryBasketTousseBarcods +// .add("0" + a); +// break; +// } +// } else { +// continue; +// } +// } +// } else { +// break; +// } +// } } catch (Exception e) { e.printStackTrace(); AssertJUnit.fail(e.getMessage()); } } + /** * 外部代理灭菌装载 * */ @@ -1191,12 +1240,26 @@ Utils.driver.switchTo().window(currentwindowhandle); Utils.retryingFindAndSendKeys(By.id("package1"), Utils.settings .getJSONObject("灭菌篮筐01").getString("条码") + "\n"); - if (Utils.reBarcodes.isEmpty()) { + if (Utils.oneSupplyReBarcodes.isEmpty()) { } else { - for (int i = 0; i < Utils.reBarcodes.size(); i++) { + //将4个包留下来不作为代理灭菌,留给二级供应室处理,否则一级供应室回收二级供应室转化的申请单的时候将会无器械包可回收 + for (int i = 0; i < Utils.oneSupplyReBarcodes.size()-4; i++) { Utils.retryingFindAndSendKeys(By.id("package1"), - Utils.reBarcodes.get(i) + "\n"); + Utils.oneSupplyReBarcodes.get(i) + "\n"); } + logger.info("代理灭菌器械包扫描成功"); + + //将此4个包放进Utils.secondSupplyReBarcodes,待二级供应室处理 + List tempBarcodes = new ArrayList(); + for(int i=Utils.oneSupplyReBarcodes.size()-1;i>=Utils.oneSupplyReBarcodes.size()-4;i--){ + tempBarcodes.add(Utils.oneSupplyReBarcodes.get(i)); + } + Utils.secondSupplyReBarcodes.addAll(tempBarcodes); + logger.info("保留4个包给二级供应室成功"); + + //Utils.oneSupplyReBarcodes移除此4个包 + Utils.oneSupplyReBarcodes.removeAll(tempBarcodes); + logger.info("一级供应室移除4个包成功"); Utils.retryingFindAndClick(By .xpath("//button[contains(text(), '放入容器')]")); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Sign.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Sign.java (.../Sign.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Sign.java (.../Sign.java) (revision 26427) @@ -40,12 +40,12 @@ Utils.retryingFindAndClick(By.id("awaitForRecycleTable")); if (Utils.isFind(Utils.retryingFind(By.id("awaitForRecycleTable")))) { // 器械包签收 - for (int i = 0; i < Utils.reBarcodes.size(); i++) { - int a = Integer.valueOf(Utils.reBarcodes.get(i)).intValue(); + for (int i = 0; i < Utils.oneSupplyReBarcodes.size(); i++) { + int a = Integer.valueOf(Utils.oneSupplyReBarcodes.get(i)).intValue(); if (a % 2 != 0) { Utils.retryingFindAndSendKeys( By.id("awaitForRecycleTable"), - Utils.reBarcodes.get(i) + "\n"); + Utils.oneSupplyReBarcodes.get(i) + "\n"); if (Utils .isFind(Utils.retryingFind(By.id("idBoxClose")))) { Utils.retryingFindAndSendKeys(By.id("idBoxClose"), Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Wash.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Wash.java (.../Wash.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Wash.java (.../Wash.java) (revision 26427) @@ -75,7 +75,7 @@ public void wash_touch() { try { // 调试时需要打开 - // Utils.init(); +// Utils.init(); Login login = new Login(); String serverAddress = Utils.settings.get("服务器地址").toString(); @@ -98,7 +98,7 @@ Utils.settings.getJSONObject("一级供应室清洗机") .getString("清洗程序条码") + "\n"); - Utils.retryingFindAndSendKeys(By.id("recyclingRecordForm"), + Utils.retryingFindAndSendKeys(By.className("add-form"), "888888888" + "\n"); Utils.retryingFindAndSendKeys(By.id("personInCharge"), @@ -113,23 +113,23 @@ Utils.settings.getJSONObject("一级供应室清洗机") .getString("清洗程序条码") + "\n"); - Utils.retryingFindAndSendKeys(By.id("recyclingRecordForm"), + Utils.retryingFindAndSendKeys(By.className("add-form"), Utils.settings.getJSONObject("一级供应室清洗篮筐1").getString("条码") + "\n"); dialogWindowClose(); - Utils.retryingFindAndSendKeys(By.id("recyclingRecordForm"), + Utils.retryingFindAndSendKeys(By.className("add-form"), Utils.settings.getJSONObject("一级供应室清洗篮筐2").getString("条码") + "\n"); dialogWindowClose(); - Utils.retryingFindAndSendKeys(By.id("recyclingRecordForm"), + Utils.retryingFindAndSendKeys(By.className("add-form"), Utils.settings.getJSONObject("一级供应室清洗篮筐3").getString("条码") + "\n"); dialogWindowClose(); - Utils.retryingFindAndSendKeys(By.id("recyclingRecordForm"), + Utils.retryingFindAndSendKeys(By.className("add-form"), Utils.settings.getJSONObject("一级供应室清洗篮筐4").getString("条码") + "\n"); dialogWindowClose(); - Utils.retryingFindAndSendKeys(By.id("recyclingRecordForm"), + Utils.retryingFindAndSendKeys(By.className("add-form"), "999999999" + "\n"); } catch (Exception e) { @@ -167,9 +167,9 @@ // Utils.retryingFindAndSendKeys(By.id("inputText"), // Utils.settings.getJSONObject("一级供应室清洗篮筐3").getString("条码") // + "\n"); - // Utils.retryingFindAndSendKeys(By.id("inputText"), - // Utils.settings.getJSONObject("一级供应室清洗篮筐4").getString("条码") - // + "\n"); +// Utils.retryingFindAndSendKeys(By.id("inputText"), +// Utils.settings.getJSONObject("一级供应室清洗篮筐4").getString("条码") +// + "\n"); wash_washAddMaterial(); // Date now = new Date(); // logger.infoln(now); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Assemble.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Assemble.java (.../Assemble.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Assemble.java (.../Assemble.java) (revision 26427) @@ -101,9 +101,9 @@ choice(); Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); JSWaiter.waitUntilJQueryReady(); } catch (Exception e) { e.printStackTrace(); @@ -136,9 +136,9 @@ Utils.retryingFindAndClick(By.id("save_print")); JSWaiter.waitUntilJQueryReady(); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); @@ -187,9 +187,9 @@ isAlertPresent(); Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); @@ -266,9 +266,9 @@ isAlertPresent(); Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); JSWaiter.waitUntilJQueryReady(); } catch (Exception e) { e.printStackTrace(); @@ -477,9 +477,9 @@ } Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); // currentwindowhandle = Utils.driver.getWindowHandle(); // Utils.driver.switchTo().window(currentwindowhandle); Utils.switchToDefaultContent(); @@ -508,9 +508,9 @@ } Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); } // currentwindowhandle = Utils.driver.getWindowHandle(); // Utils.driver.switchTo().window(currentwindowhandle); @@ -539,9 +539,9 @@ } Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); Utils.switchToDefaultContent(); Utils.retryingFindAndSwitchToFrame(By.id("iframe_packing")); @@ -565,9 +565,9 @@ choice(); Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); JSWaiter.waitUntilJQueryReady(); } } @@ -699,9 +699,9 @@ choice(); Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); @@ -761,9 +761,9 @@ // 必须加上如下的切换代码,否则获取装配的器械包的条码的javascript语句执行会报异常错误 Utils.retryingFindAndSwitchToFrame(By.id("iframe_packing")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); @@ -856,9 +856,9 @@ // 必须加上如下的切换代码,否则获取装配的器械包的条码的javascript语句执行会报异常错误 Utils.retryingFindAndSwitchToFrame(By.id("iframe_packing")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); } } else { JSWaiter.waitUntilJQueryReady(); @@ -885,9 +885,9 @@ Utils.retryingFindAndClick(By.id("save_print")); JSWaiter.waitUntilJQueryReady(); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); } if (Utils.isFind(Utils.retryingFind(By.id("foreignTousseWin")))) { logger.info("外来器械拆包窗口未消失"); @@ -1004,9 +1004,10 @@ Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ JSWaiter.waitUntilJQueryReady(); - Utils.barcodes = Utils.getToussesBarcodes(); + //本次装配产生的条码用于一级供应室做代理灭菌,所以将条码保存在oneSupplyReBarcodes中 + Utils.barcodes = Utils.getToussesBarcodes("one"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.oneSupplyReBarcodes); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); @@ -1100,9 +1101,11 @@ } Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + JSWaiter.waitUntilJSReady(); + JSWaiter.waitUntilJQueryReady(); + Utils.barcodes = Utils.getToussesBarcodes("second"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.secondSupplyReBarcodes); JSWaiter.waitUntilJQueryReady(); } catch (Exception e) { e.printStackTrace(); @@ -1194,9 +1197,9 @@ isAlertPresent(); Utils.retryingFindAndClick(By.id("save_print")); /** 获取装配成功后的条码 **/ - Utils.barcodes = Utils.getToussesBarcodes(); + Utils.barcodes = Utils.getToussesBarcodes("second"); logger.info("本次装配条码:" + Utils.barcodes); - logger.info("所有装配条码:" + Utils.reBarcodes); + logger.info("所有装配条码:" + Utils.secondSupplyReBarcodes); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Review.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Review.java (.../Review.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Review.java (.../Review.java) (revision 26427) @@ -69,16 +69,22 @@ * 扫描条码审核成功 * */ @Test - public void Review_single(String basket) { + public void Review_single(String basket,String supply) { try { Actions click = new Actions(Utils.driver); WebElement element = null; + List reBarcodes = new ArrayList(); + if(supply.equals("one")){ + reBarcodes = Utils.oneSupplyReBarcodes; + }else if(supply.equals("second")){ + reBarcodes = Utils.secondSupplyReBarcodes; + } if (Utils.barcodes.size() > 0) { for (int i = 0; i < Utils.barcodes.size(); i++) { if (Utils.isFind(Utils.retryingFind(By.id("barcode")))) { Utils.retryingFindAndClick(By.id("barcode")); Utils.retryingFindAndSendKeys(By.id("barcode"), - Utils.reBarcodes.get(i) + "\n"); + reBarcodes.get(i) + "\n"); } } if (Utils.isFind(Utils.retryingFind(By.id("barcode")))) { @@ -124,8 +130,13 @@ b = b.trim(); b = b.substring(b.indexOf("0"), b.indexOf("0") + 9); - Utils.reBarcodes.add(b); - logger.info("所有装配的条码:" + Utils.reBarcodes); + if(supply.equals("one")){ + Utils.oneSupplyReBarcodes.add(b); + logger.info("所有装配的条码:" + Utils.oneSupplyReBarcodes); + }else if(supply.equals("second")){ + Utils.secondSupplyReBarcodes.add(b); + logger.info("所有装配的条码:" + Utils.secondSupplyReBarcodes); + } if (Utils.isFind(Utils.retryingFind(By .id("barcode")))) { Utils.retryingFindAndClick(By.id("barcode")); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/sterilization/SterilizationTest.java =================================================================== diff -u -r26085 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/sterilization/SterilizationTest.java (.../SterilizationTest.java) (revision 26085) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/sterilization/SterilizationTest.java (.../SterilizationTest.java) (revision 26427) @@ -14,14 +14,12 @@ import test.forgon.disinfectsystem.selenium.sterilization.helper.SterilizationHelper; import test.forgon.disinfectsystem.selenium.tools.JSWaiter; import test.forgon.disinfectsystem.selenium.tools.Utils; -import test.forgon.disinfectsystem.selenium.tools.Utils.ActionExecuteMethod; import org.apache.commons.lang3.StringUtils; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.Wait; @@ -49,6 +47,7 @@ Utils.retryingFindAndClick(By.id("addBtn")); + JSWaiter.waitUntilJQueryReady(); Utils.driver.switchTo().defaultContent(); Utils.driver.switchTo().window(Utils.driver.getWindowHandle()); @@ -65,36 +64,43 @@ .id("sterilizationUser")); String tempBarcode = null; - // 扫描灭菌炉条码=》灭菌程序条码=》用户条码=》灭菌目的选择“器械包灭菌”=》篮筐或者器械包条码 + /** + * 扫描灭菌炉条码=》灭菌程序条码=》用户条码=》灭菌目的选择“器械包灭菌”=》篮筐或者器械包条码 + */ + //灭菌炉 Utils.retryingFindAndSendKeys(By.id("inputBarcode"), sterilizerBarcode + "\n"); + //灭菌程序 Utils.retryingFindAndSendKeys(By.id("inputBarcode"), sterilizationProcedureBarcode + "\n"); if (StringUtils.isBlank(text)) { // 有的医院不需要扫描灭菌员 Utils.retryingFindAndSendKeys(By.id("inputBarcode"), cssduser1Barcode + "\n"); } + //灭菌目的 Utils.retryingFindAndSendKeys(By.id("sterilizationPurpose"), Keys.DOWN); Utils.retryingFindAndClick(By .xpath("//div[contains(text(), '器械包灭菌')]")); // 扫描物品或者审核篮筐 String basketBarcode = Utils.settings.getJSONObject("灭菌篮筐01") .getString("条码"); + //未入筐的器械包 List notEntryBasketTousseBarcods = SterilizationHelper.notEntryBasketTousseBarcods; if (notEntryBasketTousseBarcods.size() > 0) { tempBarcode = notEntryBasketTousseBarcods.get(1); Utils.retryingFindAndSendKeys(By.id("inputBarcode"), basketBarcode + "\n"); - // int length = notEntryBasketTousseBarcods.size(); + //未入筐的器械包有3个,先扫描条码让2个先入炉,剩下1个通过点击“一键入炉”入炉 for (int i = 0; i < 2; i++) { Utils.retryingFindAndSendKeys(By.id("inputBarcode"), notEntryBasketTousseBarcods.get(i) + "\n"); } } else { System.out.print("无未入筐物品"); } - Utils.retryingFindAndClick(By.id("btnBatchAddTousse")); // 一键入炉 + // 一键入炉 + Utils.retryingFindAndClick(By.id("btnBatchAddTousse")); if (Utils.isFind(Utils.retryingFind(By .cssSelector("a[class='x-tree-node-anchor']")))) { // 确认保存按钮被点击 @@ -109,7 +115,9 @@ } SterilizationHelper.炉次_1号高温蒸汽灭菌炉++; - // 灭菌中断 + /** + * 灭菌中断,中断后添加质量监测 + */ Utils.retryingFindAndSwitchToFrame(By .id("iframe_sterilizationRecord")); // 等待表单提交成功 @@ -118,39 +126,49 @@ Utils.retryingFind(By.id("formSubmitResult")), "value", "1")); } + //选择一条灭菌记录 choiceSterilizationRecord(); Utils.retryingFindAndClick(By.id("sterilizationInterruptBtn")); Utils.driver.switchTo().window(Utils.driver.getWindowHandle()); Utils.retryingFindAndClick(By .xpath("//button[contains(text(), '是')]")); // 灭菌中断后添加质量监测 - // Utils.driver.switchTo().window(Utils.driver.getWindowHandle()); JSWaiter.waitUntilJQueryReady(); Utils.retryingFindAndSwitchToFrame(By .id("iframe_sterilizationRecord")); JSWaiter.waitUntilJQueryReady(); if (Utils.isFind(Utils.retryingFind(By.id("formName")))) { Utils.retryingFindAndClick(By.id("formName")); Utils.retryingFindAndSendKeys(By.id("formName"), Keys.DOWN); - // TODO: 下拉框没选择值 + // 下拉框没选择值 JSWaiter.waitUntilJQueryReady(); - if (Utils - .isFind(Utils.retryingFind(By + if (Utils.isFind(Utils.retryingFind(By .xpath("//div/div/div[contains(text(), '灭菌失败事件')]")))) { Utils.retryingFindAndClick(By .xpath("//div/div/div[contains(text(), '灭菌失败事件')]")); } } if (notEntryBasketTousseBarcods.size() > 0) { + //扫描抽检器械包条码 Utils.retryingFindAndSendKeys(By.id("tempBarcode"), notEntryBasketTousseBarcods.get(0) + "\n"); - Utils.retryingFindAndClick(By.id("recycle")); + //点击重新回收或重新装配选框 + if(Utils.driver.findElement(By.id("recycle")).isEnabled()){ + Utils.retryingFindAndClick(By.id("recycle")); + }else{ + Utils.retryingFindAndClick(By.id("repacking")); + } + //质量监测完该包变为“已废弃”状态,因此移除 + Utils.oneSupplyReBarcodes.remove(notEntryBasketTousseBarcods.get(0)); } else { + //若无未入筐的器械包,则通过器械包名字选择器械包进行抽检 Utils.retryingFindAndClick(By.id("tousseName")); Utils.retryingFindAndSendKeys(By.id("tousseName"), Keys.DOWN); JSWaiter.waitUntilJQueryReady(); + Utils.retryingFindAndSendKeys(By.id("tousseName"), + Keys.DOWN); Utils.retryingFindAndSendKeys(By.id("tousseName"), "\n"); } Utils.retryingFindAndClick(By @@ -165,16 +183,12 @@ "value", "1")); } // 继续灭菌 - // Utils.retryingFindAndDoAction(By.id("iframe_sterilizationRecord"), - // Utils.ACTION_SWITCH_TO_FRAME); choiceSterilizationRecord(); Utils.retryingFindAndClick(By .cssSelector("div[class='x-grid3-scroller']")); Utils.retryingFindAndSendKeys( By.cssSelector("div[class='x-grid3-scroller']"), Keys.ARROW_RIGHT); - // Utils.retryingFindAndClick(By.id(sterilizerName + "-" - // + SterilizationHelper.炉次_1号高温蒸汽灭菌炉 + "-interruptionHandle")); if (Utils.isFind(Utils.retryingFind(By .cssSelector("img[title='重新灭菌']")))) { } else { @@ -204,15 +218,13 @@ .xpath("//button[contains(text(), '是')]")); // 灭菌失败后添加质量监测 - // Utils.driver.switchTo().window(Utils.driver.getWindowHandle()); - Utils.retryingFindAndSwitchToFrame(By .id("iframe_sterilizationRecord")); JSWaiter.waitUntilJQueryReady(); if (Utils.isFind(Utils.retryingFind(By.id("formName")))) { Utils.retryingFindAndClick(By.id("formName")); Utils.retryingFindAndSendKeys(By.id("formName"), Keys.DOWN); - // TODO: 下拉框没选择值 + //下拉框没选择值 JSWaiter.waitUntilJQueryReady(); if (Utils .isFind(Utils.retryingFind(By @@ -224,34 +236,35 @@ if (tempBarcode != null) { Utils.retryingFindAndSendKeys(By.id("tempBarcode"), tempBarcode + "\n"); - Utils.retryingFindAndClick(By.id("repacking")); + //点击重新回收或重新装配选框 + if(Utils.driver.findElement(By.id("recycle")).isEnabled()){ + Utils.retryingFindAndClick(By.id("recycle")); + }else{ + Utils.retryingFindAndClick(By.id("repacking")); + } + //质量监测完该包变为“已废弃”状态,因此移除 + Utils.oneSupplyReBarcodes.remove(tempBarcode); + } else { Utils.retryingFindAndClick(By.id("tousseName")); Utils.retryingFindAndSendKeys(By.id("tousseName"), Keys.DOWN); JSWaiter.waitUntilJQueryReady(); + Utils.retryingFindAndSendKeys(By.id("tousseName"), + Keys.DOWN); Utils.retryingFindAndSendKeys(By.id("tousseName"), "\n"); } Utils.retryingFindAndClick(By .xpath("//button[contains(text(), '保存')]")); // 重新灭菌 - // Utils.retryingFindAndDoAction(By.id("iframe_sterilizationRecord"), - // Utils.ACTION_SWITCH_TO_FRAME); JSWaiter.waitUntilJQueryReady(); if (Utils.isFind(Utils.retryingFind(By.id("qmSubmitResult")))) { wait.until(ExpectedConditions.attributeToBe( Utils.retryingFind(By.id("qmSubmitResult")), "value", "1")); } JSWaiter.waitUntilJQueryReady(); - // WebElement element = Utils.retryingFind(By.id(sterilizerName - // + - // "-" - // + SterilizationHelper.炉次_1号高温蒸汽灭菌炉 + "-failureHandle")); - // if (Utils.isFind(element)) { - // element.click(); - // } choiceSterilizationRecord(); Utils.retryingFindAndClick(By .cssSelector("div[class='x-grid3-scroller']")); @@ -264,7 +277,7 @@ Utils.retryingFindAndClick(By.cssSelector("img[title='重新灭菌']")); Utils.driver.switchTo().window(Utils.driver.getWindowHandle()); Utils.retryingFindAndClick(By - .xpath("//button[contains(text(), '重新灭菌')]")); // 他的id是saveBtn + .xpath("//button[contains(text(), '重新灭菌')]")); SterilizationHelper.炉次_1号高温蒸汽灭菌炉++; // 完成灭菌 Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/helper/ApplyHelper.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/helper/ApplyHelper.java (.../ApplyHelper.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/helper/ApplyHelper.java (.../ApplyHelper.java) (revision 26427) @@ -48,7 +48,8 @@ * {@link ApplyGoodBo} */ public static void switchToApplyWindow(ApplyGoodBo applyGoodBo) { - Utils.retryingFindAndClick(By.id(applyGoodBo.getBtn())); +// Utils.retryingFindAndClick(By.id(applyGoodBo.getBtn())); + Utils.retryingFindAndClick(By.xpath("//button[contains(text(),'"+applyGoodBo.getBtnName()+"')]")); Utils.driver.switchTo().window(Utils.driver.getWindowHandle()); JSWaiter.waitUntilJQueryReady(); String waitScript = "return Ext.getCmp('" @@ -313,8 +314,8 @@ WebElement webElement = Utils.driver.switchTo().activeElement(); webElement.clear(); - webElement.sendKeys(amount+"\n"); -// Utils.runJavaScript(completeEdit); + webElement.sendKeys(amount+""); + Utils.runJavaScript(completeEdit); // logger.info("完成编辑!"); // Actions actions = new Actions(Utils.driver); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java (.../ALL.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java (.../ALL.java) (revision 26427) @@ -5,6 +5,7 @@ import java.io.File; import java.io.FilenameFilter; import java.text.SimpleDateFormat; +import java.util.List; import java.util.Set; import org.apache.commons.io.FileUtils; @@ -18,6 +19,7 @@ import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.remote.SessionId; +import org.springframework.beans.factory.annotation.Autowired; import test.forgon.disinfectsystem.AbstractCSSDTest; import test.forgon.disinfectsystem.selenium.apply.applyConstants.DeskIconEnum; @@ -27,6 +29,8 @@ import test.forgon.disinfectsystem.selenium.tools.LoginUtil; import test.forgon.disinfectsystem.selenium.tools.Utils; +import com.forgon.disinfectsystem.basedatamanager.supplyroomconfig.service.SupplyRoomConfigManager; +import com.forgon.disinfectsystem.entity.basedatamanager.supplyroomconfig.SupplyRoomConfig; import com.forgon.tools.util.PathUtils; /** @@ -35,6 +39,9 @@ */ public class ALL extends AbstractCSSDTest { + + @Autowired + private SupplyRoomConfigManager supplyRoomConfigManager; protected Logger logger = Logger.getLogger(this.getClass()); @@ -152,6 +159,14 @@ initCSSDData(); /** + * 将二级供应室自动发货设为“不启用”,否则临床科室录入使用记录时无法录入自动发货的器械包 + */ +// List supplyRoomConfigs = supplyRoomConfigManager.getSupplyRoomList(SupplyRoomConfig.SUPPLYROOM_TYPE_SYSTEM_CONFIG); +// SupplyRoomConfig supplyRoomConfig = supplyRoomConfigs.get(0); +// supplyRoomConfig.setIsSecondSupplyRoomAutoInvoice(SupplyRoomConfig.SECONDSUPPLYROOM_AUTOINVOICE_DISABLE); +// supplyRoomConfigManager.save(supplyRoomConfig); + + /** * 一次性物品入库以及修改消毒物品包定义 * (由于省医增加配置一次性物品没库存无法申请,调整一次性物品入库到申请前) */ @@ -254,7 +269,7 @@ .xpath("//button[contains(text(), '进入审核列表')]")); String basket = Utils.settings.getJSONObject("灭菌篮筐001").getString( "条码"); - handleReview(element, review, basket); + handleReview(element, review, basket,"second"); logger.info("二级供应室审核完成"); /** 二级供应室灭菌 */ @@ -268,8 +283,10 @@ String name = Utils.settings.getJSONObject("临床科室").getString("名称"); delivery.openInvoiceWindow(name); delivery.Delivery_secondSupplyRoom(); +// login.login_Out(); - /** 录入使用记录 */ + /** 二级供应室录入使用记录 */ +// LoginUtil.loginWithClinical(); userrecord.UserRecord_success(); login.login_Out(); Utils.driver.get(Utils.settings.get("服务器地址").toString() @@ -344,12 +361,12 @@ SERVER_URL + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); - Utils.retryingFindAndClick(By.id("appTypeSelect")); - Utils.retryingFindAndClick(By.xpath("//option[contains(text(),'类型')]")); logger.info("一级供应室回收外来器械完成"); /** 判断自定义器械包申请单是否存在 */ - Utils.retryingFind(By.tagName("body")); + Utils.retryingFindAndClick(By.id("appTypeSelect")); + Utils.retryingFindAndClick(By + .cssSelector("option[value='自定义器械包申请单']")); element = Utils.retryingFindForthCellOfTable(By .id("awaitForRecycleTable")); if (Utils.isFind(element)) { @@ -359,8 +376,11 @@ + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980", 8); } + /** 判断消毒物品申请单是否存在 */ - Utils.retryingFind(By.tagName("body")); + Utils.retryingFindAndClick(By.id("appTypeSelect")); + Utils.retryingFindAndClick(By + .cssSelector("option[value='消毒物品申请单']")); element = Utils.retryingFindForthCellOfTable(By .id("awaitForRecycleTable")); if (Utils.isFind(element)) { @@ -372,17 +392,21 @@ JSWaiter.waitUntilJQueryReady(); Utils.driver.get(Utils.settings.get("服务器地址").toString()); } + /*** 一级供应室清洗 ***/ Utils.DateTime(); + /*** 触摸屏清洗 ***/ wash.wash_touch(); JSWaiter.waitUntilJQueryReady(); Utils.driver.manage().deleteAllCookies(); JSWaiter.waitUntilJQueryReady(); Utils.driver.get(Utils.settings.get("服务器地址").toString()); wash.init(); + /*** 一级供应室清洗并清洗添加材料 ***/ wash.wash_oneSupplyRoom(); + /*** 清洗删除篮筐再添加篮筐,扫描不同的责任人 ***/ Utils.retryingFindAndClick(By .xpath("//button[contains(text(), '添加')]")); @@ -395,19 +419,23 @@ Utils.driver.switchTo().defaultContent(); currentwindowhandle = Utils.driver.getWindowHandle(); Utils.driver.switchTo().window(currentwindowhandle); + /*** 清洗失败,重新清洗,清洗完成,清洗机需要设置为清洗确认 ***/ wash.wash_fail_reWash_Finish(); logger.info("一级供应室消洗完成"); Utils.driver.switchTo().defaultContent(); Utils.retryingFindAndClick(By .xpath("//span[contains(text(), '个人桌面')]")); + /*** 材料修改属性 ***/ Utils.DateTime(); materials.Materials_Update(); + /*** 材料入库报损丢失的材料 ***/ Utils.refresh(); materials.Materials_Godown_Entry_choice(); logger.info("材料入库报损丢失的材料 完成"); + /*** 一级供应室装配外来器械 ***/ logger.info("装配开始:"); Utils.DateTime(); @@ -416,6 +444,7 @@ Utils.retryingFindAndSwitchToFrame(By.id("iframe_packing")); assemble.assemble_forgeinSet(); logger.info("一级供应室装配外来器械完成"); + /*** 外来器械干预 ***/ intervene.Intervene_ForgeinSet(); logger.info("外来器械干预 完成"); @@ -428,16 +457,18 @@ Utils.retryingFindAndClick(By.linkText(Utils.settings .getJSONObject("一级供应室装配组").getString("名称3"))); Utils.retryingFindAndSwitchToFrame(By.id("iframe_reviewPacking")); + /** 审核页面修改灭菌程序、包装类型 */ review.Review_edit(); logger.info("一级供应室审核页面修改灭菌程序、包装类型完成"); Utils.driver.switchTo().defaultContent(); Utils.retryingFindAndSwitchToFrame(By.id("iframe_reviewPacking")); + /*** 一级供应室审核外来器械 ***/ element = Utils.retryingFind(By .xpath("//button[contains(text(), '进入审核列表')]")); basket = Utils.settings.getJSONObject("灭菌篮筐01").getString("条码"); - handleReview(element, review, basket); + handleReview(element, review, basket,"one"); logger.info("一级供应室审核外来器械完成"); review.Review_afterDelete(); logger.info("一级供应室审核后删除篮筐中的物品完成"); @@ -446,19 +477,23 @@ Utils.retryingFindAndClick(By.linkText(Utils.settings .getJSONObject("一级供应室装配组").getString("名称2"))); Utils.retryingFindAndSwitchToFrame(By.id("iframe_packing")); + /*** 一级供应室补充丢失的材料 ***/ assemble.assemble_supplementLoss(); logger.info("一级供应室补充丢失的材料完成"); + /*** 一级供应室装配聚合包 ***/ Utils.retryingFindAndSwitchToFrame(By.id("iframe_packing")); assemble.assemble_ComboTousse(); logger.info("一级供应室装配聚合包完成"); + /*** 一级供应室装配消毒物品 ***/ Utils.driver.switchTo().defaultContent(); Utils.retryingFindAndSwitchToFrame(By.id("iframe_packing")); assemble.assemble_success1(); logger.info("一级供应室装配消毒物品完成"); login.login_Out(); + /*** 一级供应室装配敷料包、器械包、自定义器械包 ***/ login.login_oneSupplyRoom(); Utils.retryingFindAndHover(By.id("packing")); @@ -475,25 +510,30 @@ logger.info("一级供应室装配敷料完成"); assemble.assemble_CustomSet(); logger.info("一级供应室装配自定义器械完成"); + /*** 一级供应室自定义装配 ***/ assemble.assemble_custom(); logger.info("一级供应室自定义装配完成"); + /*** 一级供应室修改历史装配 ***/ Utils.refresh(); ph.assemble_modifyTousse(); logger.info("一级供应室修改历史装配完成"); + /*** 一级供应室代临床申请外部代理灭菌 ***/ disinfection.disinfection_agent_outside(); logger.info("一级供应室代临床申请外部代理灭菌完成"); Utils.refresh(); + /*** 一级供应室审核器械包、敷料包 ***/ Utils.retryingFindAndHover(By.id("reviewPacking")); Utils.retryingFindAndClick(By.linkText(Utils.settings .getJSONObject("一级供应室装配组").getString("名称1"))); Utils.retryingFindAndSwitchToFrame(By.id("iframe_reviewPacking")); element = Utils.retryingFind(By .xpath("//button[contains(text(), '进入审核列表')]")); - handleReview(element, review, basket); + handleReview(element, review, basket,"one"); + /*** 一级供应室审核器械包、敷料包 ***/ Utils.refresh(); Utils.retryingFindAndHover(By.id("reviewPacking")); @@ -502,15 +542,18 @@ Utils.retryingFindAndSwitchToFrame(By.id("iframe_reviewPacking")); element = Utils.retryingFind(By .xpath("//button[contains(text(), '进入审核列表')]")); - handleReview(element, review, basket); + handleReview(element, review, basket,"one"); logger.info("一级供应室审核器械包、敷料包完成"); + /*** 一级供应室灭菌装载删除 ***/ disinfection.disinfection_loading(); logger.info("一级供应室灭菌装载删除完成"); + /*** 一级供应室灭菌 ***/ logger.info("灭菌开始:"); SterilizationTest.sterilizationSeriesOperationsOfFristSupplyRoom(); logger.info("一级供应室灭菌完成"); + /*** 一级供应室发货 ***/ logger.info("发货开始:"); Utils.DateTime(); @@ -531,18 +574,21 @@ delivery.Delivery_materials(); logger.info("一级供应室发货材料完成"); JSWaiter.waitUntilJQueryReady(); + /*** 供应室回收质量监测登记的重新回收 ***/ Utils.driver.get(Utils.settings.get("服务器地址").toString() + "/?logonType=1080p"); login.loginAction(); Utils.waitUntilUrlContains("awaitForRecycleList.jsp", 15); + Utils.retryingFindAndClick(By.linkText("申请时间")); recyle.recyle_Monitor(); JSWaiter.waitUntilJQueryReady(); logger.info("供应室回收质量监测登记的重新回收"); JSWaiter.waitUntilJQueryReady(); Utils.driver.manage().deleteAllCookies(); JSWaiter.waitUntilJQueryReady(); Utils.driver.get(Utils.settings.get("服务器地址").toString()); + /*** 临床签收物品 ***/ logger.info("签收物品开始:"); Utils.DateTime(); @@ -552,6 +598,7 @@ Utils.switchToDefaultContent(); Utils.retryingFindAndClick(By .xpath("//span[contains(text(), '个人桌面')]")); + /*** 临床登记使用记录 ***/ logger.info("登记使用记录开始:"); Utils.DateTime(); @@ -584,6 +631,7 @@ } } logger.info("临床登记使用记录完成"); + /*** 临床归还借物 ***/ logger.info("归还借物开始:"); Utils.DateTime(); @@ -593,11 +641,13 @@ apply.apply_borrow_return(); logger.info("临床归还借物完成"); Utils.refresh(); + /*** 临床科室互借 ***/ logger.info("科室互借开始:"); apply.department_borrow(); logger.info("临床科室互借完成"); login.login_Out(); + /*** 供应室退货 ***/ logger.info("退货开始:"); login.login_oneSupplyRoom(); @@ -616,6 +666,7 @@ logger.info("供应室退货一次性物品完成"); reject.Reject_Mateials_success(); logger.info("供应室退货材料完成"); + /*** 供应室干预一次性物品 ***/ logger.info("干预开始:"); Utils.refresh(); @@ -635,6 +686,7 @@ intervene.Intervene_UserRecord(); logger.info("供应室干预使用记录完成"); Utils.refresh(); + /*** 供应室领用 ***/ logger.info("领用开始:"); Utils.retryingFindAndClick(By.id("enterpriseView")); @@ -647,6 +699,7 @@ .xpath("//ul/li/div/a/span[contains(text(), '消毒供应中心物品领用')]")); consume.Consume_success(); logger.info("供应室领用完成"); + /*** 供应室退货后发货 ***/ logger.info("退货后发货开始:"); Utils.refresh(); @@ -663,10 +716,12 @@ .xpath("//div/a/span[contains(text(), '一次性物品管理')]")); one.One_use_cancle_success(); logger.info("供应室一次性物品退库完成"); + /*** 供应室材料退库 ***/ logger.info("材料退库开始:"); materials.Materials_refund(); logger.info("供应室材料退库完成"); + /*** 供应室一次性物品调拨 ***/ logger.info("一次性物品调拨开始:"); Utils.refresh(); @@ -678,6 +733,7 @@ .xpath("//div/a/span[contains(text(), '一次性物品管理')]")); one.One_use_allot_success(); logger.info("供应室一次性物品调拨完成"); + /*** 供应室一次性物品盘点 ***/ logger.info("一次性物品盘点开始:"); Utils.refresh(); @@ -689,11 +745,13 @@ .xpath("//div/a/span[contains(text(), '一次性物品管理')]")); one.One_use_check(); logger.info("供应室一次性物品盘点完成"); + /*** 供应室材料盘点 ***/ logger.info("材料盘点开始:"); materials.Materials_check_add(); materials.Materials_check_lost(); logger.info("供应室材料盘点完成"); + /*** 供应室登记定期监测 ***/ logger.info("登记定期监测开始:"); Utils.refresh(); @@ -708,6 +766,7 @@ + "/?logonType=1080p"); login.loginAction(); Utils.waitUntilUrlContains("awaitForRecycleList.jsp", 15); + /*** 供应室二次回收外来器械 ***/ recyle.recyle_Foreign_Twice(); Utils.waitUntilUrlContains( @@ -718,6 +777,7 @@ Utils.waitUntilUrlChange(SERVER_URL + "/homepage/portalPage.jsp", 8); Utils.tryToCloseWarningWindow(); logger.info("二次回收外来器械完成"); + /*** 供应室提前归还、确认归还外来器械 ***/ apply.advance_Return_ForeignSet(); Utils.refresh(); @@ -726,6 +786,7 @@ Utils.driver.switchTo().defaultContent(); Utils.retryingFindAndClick(By .xpath("//span[contains(text(), '个人桌面')]")); + /*** 供应室召回一次性物品、器械包 ***/ logger.info("召回开始:"); recall.Recall_One_use(); @@ -738,10 +799,12 @@ .get(Utils.settings.get("服务器地址").toString() + "/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp?resolution=1980"); Utils.waitUntilUrlContains("awaitForRecycleList.jsp", 15); + /*** 供应室回收还物单和回收终止 ***/ logger.info("回收还物单开始:"); recyle.recyle_return(); logger.info("供应室回收还物单和回收终止完成"); + afterMethod(); } catch (Exception e) { logger.error(e, e); @@ -750,11 +813,11 @@ } } - private void handleReview(WebElement element, Review review, String basket) { + private void handleReview(WebElement element, Review review, String basket,String supply) { if (Utils.isFind(element)) { review.Review_batch(basket); } else { - review.Review_single(basket); + review.Review_single(basket,supply); } } Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/factory/ApplyGoodBoFactory.java =================================================================== diff -u -r18289 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/factory/ApplyGoodBoFactory.java (.../ApplyGoodBoFactory.java) (revision 18289) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/factory/ApplyGoodBoFactory.java (.../ApplyGoodBoFactory.java) (revision 26427) @@ -69,6 +69,7 @@ applyGoodBo.setDeskId(deskIconEnum.getDeskIconId()); applyGoodBo.setFrameId(deskIconEnum.getFrameId()); applyGoodBo.setBtn(btn.getBtnId()); + applyGoodBo.setBtnName(btn.getBtnName()); applyGoodBo.setHandleRoom(handleRoom); applyGoodBo.setAssertWinId(btn.getAssertWinId()); if (StringUtils.isNotBlank(handleRoom)) { Index: ssts-web/src/main/webapp/disinfectsystem/config/gzs12rmyy/config.js =================================================================== diff -u -r26249 -r26427 --- ssts-web/src/main/webapp/disinfectsystem/config/gzs12rmyy/config.js (.../config.js) (revision 26249) +++ ssts-web/src/main/webapp/disinfectsystem/config/gzs12rmyy/config.js (.../config.js) (revision 26427) @@ -94,6 +94,8 @@ autoReturnTousse : true, //启用器械包的是否发货功能 默认不启用 true:启用 false:不启用 (为0或''等不启用,其它值启用) enableIsInvoice:true, + //是否显示辅助发货按钮 + showAuxiliaryInvoiceBtn: true, //申请界面是否显示器械包或消毒物品的的单位 true : 显示 false : 不显示 showTousseUnitColumn:true, //是否禁用科室同步 true:禁用 false:不禁用 Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/tools/Utils.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/tools/Utils.java (.../Utils.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/tools/Utils.java (.../Utils.java) (revision 26427) @@ -140,10 +140,14 @@ */ public static List resendout; /** - * 所有装配产生的条码 + * 一级供应室所有装配产生的条码 */ - public static List reBarcodes = new ArrayList(); + public static List oneSupplyReBarcodes = new ArrayList(); /** + * 二级供应室所有装配产生的条码 + */ + public static List secondSupplyReBarcodes = new ArrayList(); + /** * 动态产生的数据 */ private static SeleniumRuntimeData seleniumRuntimeData = new SeleniumRuntimeData(); @@ -156,6 +160,11 @@ */ public static List high_Value_Consumables = new ArrayList(); + /** + * 发货的一次性物品条码 + */ + public static List disposableGoodsBatchBarcodesForInvoice = new ArrayList(); + public static SeleniumRuntimeData getSeleniumRuntimeData() { return seleniumRuntimeData; } @@ -347,7 +356,7 @@ * 获取装配时创建的器械包的条码,为集合对象 * */ - public static List getToussesBarcodes() { + public static List getToussesBarcodes(String supply) { JavascriptExecutor js = (JavascriptExecutor) driver; Object toussesStr = js .executeScript("return JSON.stringify(packingToussesArray)"); @@ -363,7 +372,13 @@ } seleniumRuntimeData.addPackingTousseInfo(array); } - Utils.reBarcodes.addAll(barcodes); + + //若是一级供应室产生的装配条码则往oneSupplyReBarcodes添加,二级供应室的则往secondSupplyReBarcodes添加 + if("one".equals(supply)){ + Utils.oneSupplyReBarcodes.addAll(barcodes); + }else if("second".equals(supply)){ + Utils.secondSupplyReBarcodes.addAll(barcodes); + } return barcodes; } Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Delivery.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Delivery.java (.../Delivery.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Delivery.java (.../Delivery.java) (revision 26427) @@ -140,9 +140,14 @@ String name = Utils.settings.getJSONObject("临床科室").getString("名称"); openInvoiceWindow(name); + //发货员 Utils.retryingFindAndSendKeys(By.id("senderBarcode"), Utils.settings.getJSONObject("一级供应室用户").getString("条码") + "\n"); + //核对员 + Utils.retryingFindAndSendKeys(By.id("assistantSenderBarcode"), + Utils.settings.getJSONObject("一级供应室用户").getString("条码") + + "\n"); Utils.retryingFind(By.id("scanText")).clear(); String barcode = Utils.getSeleniumRuntimeData() @@ -157,11 +162,11 @@ // 外来器械包条码 Delivery_Foreign(); // 器械包奇数发货 - for (int i = 0; i < Utils.reBarcodes.size(); i++) { - int a = Integer.valueOf(Utils.reBarcodes.get(i)).intValue(); + for (int i = 0; i < Utils.oneSupplyReBarcodes.size(); i++) { + int a = Integer.valueOf(Utils.oneSupplyReBarcodes.get(i)).intValue(); if (a % 2 != 0) { Utils.retryingFindAndSendKeys(By.id("scanText"), - Utils.reBarcodes.get(i) + "\n"); + Utils.oneSupplyReBarcodes.get(i) + "\n"); } } @@ -286,10 +291,14 @@ @Test public void Delivery_oneSupplyRoom() { try { + //发货员 Utils.retryingFindAndSendKeys(By.id("senderBarcode"), Utils.settings.getJSONObject("一级供应室用户").getString("条码") + "\n"); - + //核对员 + Utils.retryingFindAndSendKeys(By.id("assistantSenderBarcode"), + Utils.settings.getJSONObject("一级供应室用户").getString("条码") + + "\n"); // // 整筐发货 // Utils.retryingFindAndSendKeys(By.id("scanText"), // Utils.settings.getJSONObject("灭菌筐02").getString("条码") @@ -308,6 +317,24 @@ + "\n"); } } + + //取发货物品表格的第一列(即条码列),若为一次性物品条码,则将其放进Utils.disposableGoodsBatchBarcodesForInvoice中 + List sendOutGoodsTables = Utils.driver.findElements(By.xpath("//*[@id='sendOutGoods']/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]//tbody")); + if(sendOutGoodsTables!=null){ + Utils.disposableGoodsBatchBarcodesForInvoice.clear(); + for(WebElement table : sendOutGoodsTables){ + List trs= table.findElements(By.tagName("tr")); + for(int i=0;i tds = trs.get(i).findElements(By.tagName("td")); + WebElement barcodeDiv = tds.get(0).findElement(By.tagName("div")); + if(Utils.disposableGoodsBatchBarcodesAfterEntry.contains(barcodeDiv.getText())){ + Utils.disposableGoodsBatchBarcodesForInvoice.add(barcodeDiv.getText()); + logger.info("发货的一次性物品条码为:"+barcodeDiv.getText()); + } + } + } + } + Delivery_FixedBarcodeDisinfection(); Delivery_Disinfection(); Utils.retryingFindAndClick(By @@ -338,16 +365,15 @@ // 代理灭菌发货 if (Utils.isFind(Utils.retryingFind(By .id("recyclingApplicationWin")))) { - Utils.retryingFindAndSendKeys( - By.id("senderBarcode"), - Utils.settings.getJSONObject("一级供应室用户").getString( - "条码") + //发货员 + Utils.retryingFindAndSendKeys(By.id("senderBarcode"), + Utils.settings.getJSONObject("一级供应室用户").getString("条码")+ "\n"); + //核对员 + Utils.retryingFindAndSendKeys(By.id("assistantSenderBarcode"), + Utils.settings.getJSONObject("一级供应室用户").getString("条码") + "\n"); - Utils.retryingFindAndSendKeys( - By.id("scanText"), - Utils.settings.getJSONObject("灭菌篮筐01").getString( - "条码") - + "\n"); + Utils.retryingFindAndSendKeys(By.id("scanText"), + Utils.settings.getJSONObject("灭菌篮筐01").getString("条码")+ "\n"); Utils.retryingFindAndClick(By .xpath("//button[contains(text(), '保存')]")); } @@ -365,15 +391,30 @@ @Test public void Delivery_secondSupplyRoom() { try { - + //发货员 Utils.retryingFindAndSendKeys(By.id("senderBarcode"), Utils.settings.getJSONObject("二级供应室用户").getString("条码") + "\n"); + //核对员 + Utils.retryingFindAndSendKeys(By.id("assistantSenderBarcode"), + Utils.settings.getJSONObject("二级供应室用户").getString("条码") + + "\n"); // 整筐发货 Utils.retryingFindAndSendKeys(By.id("scanText"), Utils.settings .getJSONObject("灭菌篮筐001").getString("条码") + "\n"); Delivery_FixedBarcodeDisinfection(); Delivery_Disinfection(); + + //器械包发货 +// if (CollectionUtils +// .isNotEmpty(Utils.secondSupplyReBarcodes)) { +// for (String barcode : Utils.secondSupplyReBarcodes) { +// Utils.retryingFindAndClear(By.id("scanText")); +// Utils.retryingFindAndSendKeys(By.id("scanText"), barcode +// + "\n"); +// } +// } + // 一次性物品发货 if (CollectionUtils .isNotEmpty(Utils.disposableGoodsBatchBarcodesAfterEntry)) { @@ -383,8 +424,25 @@ + "\n"); } } - Utils.retryingFindAndClick(By - .xpath("//button[contains(text(), '保存')]")); + + //取发货物品表格的第一列(即条码列),若为一次性物品条码,则将其放进Utils.disposableGoodsBatchBarcodesForInvoice中 + List sendOutGoodsTables = Utils.driver.findElements(By.xpath("//*[@id='sendOutGoods']/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]//tbody")); + if(sendOutGoodsTables!=null){ + Utils.disposableGoodsBatchBarcodesForInvoice.clear(); + for(WebElement table : sendOutGoodsTables){ + List trs= table.findElements(By.tagName("tr")); + for(int i=0;i tds = trs.get(i).findElements(By.tagName("td")); + WebElement barcodeDiv = tds.get(0).findElement(By.tagName("div")); + if(Utils.disposableGoodsBatchBarcodesAfterEntry.contains(barcodeDiv.getText())){ + Utils.disposableGoodsBatchBarcodesForInvoice.add(barcodeDiv.getText()); + logger.info("发货的一次性物品条码为:"+barcodeDiv.getText()); + } + } + } + } + + Utils.retryingFindAndClick(By.xpath("//button[contains(text(), '保存')]")); JSWaiter.waitUntilJQueryReady(); } catch (Exception e) { e.printStackTrace(); @@ -433,11 +491,11 @@ Utils.settings.getJSONObject("一级供应室用户").getString("条码") + "\n"); - for (int i = 0; i < Utils.reBarcodes.size(); i++) { - int a = Integer.valueOf(Utils.reBarcodes.get(i)).intValue(); + for (int i = 0; i < Utils.oneSupplyReBarcodes.size(); i++) { + int a = Integer.valueOf(Utils.oneSupplyReBarcodes.get(i)).intValue(); if (a % 2 == 0) { Utils.retryingFindAndSendKeys(By.id("scanText"), - Utils.reBarcodes.get(i) + "\n"); + Utils.oneSupplyReBarcodes.get(i) + "\n"); } } @@ -539,19 +597,20 @@ // 等待仓库加载 Utils.retryingFind(By .xpath("//input[contains(@value, '测试供应室仓库')]")); - + //科室条码 Utils.retryingFindAndSendKeys(By.id("departBarcode"), Utils.settings.getJSONObject("临床科室").getString("条码") + "\n"); - Utils.retryingFindAndSendKeys(By.id("senderBarcode"), + //核对员 + Utils.retryingFindAndSendKeys(By.id("assistantSenderBarcode"), Utils.settings.getJSONObject("一级供应室用户").getString("条码") + "\n"); // 器械包奇数发货 - for (int i = 0; i < Utils.reBarcodes.size(); i++) { - int a = Integer.valueOf(Utils.reBarcodes.get(i)).intValue(); + for (int i = 0; i < Utils.oneSupplyReBarcodes.size(); i++) { + int a = Integer.valueOf(Utils.oneSupplyReBarcodes.get(i)).intValue(); if (a % 2 != 0) { Utils.retryingFindAndSendKeys(By.id("scanText"), - Utils.reBarcodes.get(i) + "\n"); + Utils.oneSupplyReBarcodes.get(i) + "\n"); } } @@ -582,7 +641,11 @@ String name = Utils.settings.getJSONObject("临床科室").getString("名称"); if (Utils.isFind(Utils.retryingFind(By.id(name)))) { openInvoiceWindow(name); - + //核对员 + Utils.retryingFindAndSendKeys(By.id("assistantSenderBarcode"), + Utils.settings.getJSONObject("一级供应室用户").getString("条码") + + "\n"); + Utils.retryingFindAndClick(By .xpath("//button[contains(text(), '辅助发货')]")); String currentwindowhandle = Utils.driver.getWindowHandle(); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/CSSDTestDataProcess.java =================================================================== diff -u -r26396 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/CSSDTestDataProcess.java (.../CSSDTestDataProcess.java) (revision 26396) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/CSSDTestDataProcess.java (.../CSSDTestDataProcess.java) (revision 26427) @@ -2422,6 +2422,8 @@ tousseDefinition7.setIsCustomPacking(TousseDefinition.STR_YES); //是否追朔 tousseDefinition7.setIsTraceable(TousseDefinition.STR_NO); + //是否回收 + tousseDefinition7.setIsRecycling(TousseDefinition.STR_NO); //包装类型 tousseDefinition7.setPackageType("纸塑"); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/helper/ApplyActionHelper.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/helper/ApplyActionHelper.java (.../ApplyActionHelper.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/helper/ApplyActionHelper.java (.../ApplyActionHelper.java) (revision 26427) @@ -2,6 +2,7 @@ import org.openqa.selenium.By; import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -15,6 +16,7 @@ import test.forgon.disinfectsystem.selenium.tools.LoginUtil; import test.forgon.disinfectsystem.selenium.tools.Utils; +import java.util.List; import java.util.Set; import static org.junit.Assert.*; @@ -47,6 +49,7 @@ Utils.switchToFrame(applyGoodBo.getFrameId()); applyGoodBo.setBtn(ApplyBtnEnum.DELETE.getBtnId()); ApplyActionHelper.deleteApplyForm(applyGoodBo); + } /** @@ -100,15 +103,37 @@ /** * 返回修改后临床用户重新修改提交,将右边第一个物品的数量修改成1 - * + * 并将Test治疗巾数量改为0(因为该申请单提交后要执行删除操作, + * 而治疗巾会处于待装配状态,使该申请单无法删除,因此在此处将治疗巾 + * 数量置为0,即不申请) * @param applyGoodBo * {@link ApplyGoodBo} */ private static void clinicalReModifySubmit(ApplyGoodBo applyGoodBo) { LoginUtil.loginWithClinical(); ApplyHelper.openDeskTopIcon(applyGoodBo); + //打开右边表格第一行并设置申请数量 openTheFirstRow(); ApplyHelper.editTemplateGoodAmount(ApplyEnum.DISPOSABLEGRID, 0, 1); + //找到Test治疗巾申请数量所在位置,并清空 +// List tousseRows = Utils.driver.findElements(By.xpath("//*[@id='tousseTreeGrid-body']//tr")); +// if(tousseRows.size()>0){ +// for(WebElement row:tousseRows){ +// List cols = row.findElements(By.tagName("td")); +// if(cols.size()>0){ +// if("Test治疗巾".equals(cols.get(0).getText())){ +// Actions action = new Actions(Utils.driver); +// action.moveToElement(cols.get(1)); +// action.doubleClick().perform(); +// WebElement webElement = Utils.driver.switchTo().activeElement(); +// webElement.clear(); +// webElement.sendKeys("\n"); +// break; +// } +// } +// } +// } + ApplyHelper.doSubmitForm(By.id("commitBtn")); logger.info("修改返回的申请单成功"); } Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/UserRecord.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/UserRecord.java (.../UserRecord.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/UserRecord.java (.../UserRecord.java) (revision 26427) @@ -50,7 +50,7 @@ } /** - * 临床登记使用记录成功 + * 二级供应室登记使用记录成功 * */ @Test public void UserRecord_success() { @@ -77,20 +77,18 @@ + "\n"); // 器械包登记使用记录 - for (int i = 0; i < Utils.reBarcodes.size(); i++) { + for (int i = 0; i < Utils.secondSupplyReBarcodes.size(); i++) { Utils.retryingFindAndSendKeys(By.id("tempBarcode"), - Utils.reBarcodes.get(i) + "\n"); + Utils.secondSupplyReBarcodes.get(i) + "\n"); } // 一次性物品登记使用记录 - if (CollectionUtils - .isNotEmpty(Utils.disposableGoodsBatchBarcodesAfterEntry)) { - for (String barcode : Utils.disposableGoodsBatchBarcodesAfterEntry) { - Utils.retryingFindAndSendKeys(By.id("tempBarcode"), - barcode + "\n"); - } - } +// if (CollectionUtils.isNotEmpty(Utils.disposableGoodsBatchBarcodesForInvoice)) { +// for (String barcode : Utils.disposableGoodsBatchBarcodesForInvoice) { +// Utils.retryingFindAndSendKeys(By.id("tempBarcode"),barcode + "\n"); +// } +// } Save(); } JSWaiter.waitUntilJQueryReady(); @@ -119,19 +117,20 @@ + "\n"); Utils.retryingFindAndSendKeys(By.id("operationRoom"), "03" + "\n"); - if (CollectionUtils - .isNotEmpty(Utils.disposableGoodsBatchBarcodesAfterEntry)) { - for (String barcode : Utils.disposableGoodsBatchBarcodesAfterEntry) { + + //一次性物品登记使用记录 + if (CollectionUtils.isNotEmpty(Utils.disposableGoodsBatchBarcodesForInvoice)) { + for (String barcode : Utils.disposableGoodsBatchBarcodesForInvoice) { Utils.retryingFindAndSendKeys(By.id("tempBarcode"), barcode + "\n"); } } // 器械包登记使用记录 - for (int i = 0; i < Utils.reBarcodes.size(); i++) { - int a = Integer.valueOf(Utils.reBarcodes.get(i)).intValue(); + for (int i = 0; i < Utils.oneSupplyReBarcodes.size(); i++) { + int a = Integer.valueOf(Utils.oneSupplyReBarcodes.get(i)).intValue(); if (a % 2 != 0) { Utils.retryingFindAndSendKeys(By.id("tempBarcode"), - Utils.reBarcodes.get(i) + "\n"); + Utils.oneSupplyReBarcodes.get(i) + "\n"); } } Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Apply.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Apply.java (.../Apply.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Apply.java (.../Apply.java) (revision 26427) @@ -837,17 +837,17 @@ .getString("科室名称") + "')]")); if (Utils.isFind(Utils.retryingFind(By.id("barcode")))) { Utils.retryingFindAndClick(By.id("barcode")); - if (Utils.reBarcodes.size() > 0) { - if (Utils.reBarcodes.size() > 6) { + if (Utils.oneSupplyReBarcodes.size() > 0) { + if (Utils.oneSupplyReBarcodes.size() > 6) { Utils.retryingFindAndSendKeys(By.id("barcode"), - Utils.reBarcodes.get(4) + "\n"); + Utils.oneSupplyReBarcodes.get(4) + "\n"); Utils.retryingFindAndSendKeys(By.id("barcode"), - Utils.reBarcodes.get(5) + "\n"); - } else if (Utils.reBarcodes.size() > 2) { + Utils.oneSupplyReBarcodes.get(5) + "\n"); + } else if (Utils.secondSupplyReBarcodes.size() > 2) { Utils.retryingFindAndSendKeys(By.id("barcode"), - Utils.reBarcodes.get(0) + "\n"); + Utils.oneSupplyReBarcodes.get(0) + "\n"); Utils.retryingFindAndSendKeys(By.id("barcode"), - Utils.reBarcodes.get(1) + "\n"); + Utils.oneSupplyReBarcodes.get(1) + "\n"); } Utils.retryingFindAndClick(By .xpath("//button[contains(text(), '保存')]")); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Reject.java =================================================================== diff -u -r26347 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Reject.java (.../Reject.java) (revision 26347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Reject.java (.../Reject.java) (revision 26427) @@ -178,9 +178,9 @@ .xpath("//button[contains(text(), '器械包退货')]")); String currentwindowhandle = Utils.driver.getWindowHandle(); Utils.driver.switchTo().window(currentwindowhandle); - for (int i = 0; i < Utils.reBarcodes.size(); i++) { + for (int i = 0; i < Utils.oneSupplyReBarcodes.size(); i++) { Utils.retryingFindAndSendKeys(By.id("barcode"), - Utils.reBarcodes.get(i) + "\n"); + Utils.oneSupplyReBarcodes.get(i) + "\n"); } String name = Utils.settings.getJSONObject("一级供应室器械包3").getString( "名称"); @@ -212,11 +212,11 @@ .xpath("//button[contains(text(), '器械包退货')]")); String currentwindowhandle = Utils.driver.getWindowHandle(); Utils.driver.switchTo().window(currentwindowhandle); - for (int i = 0; i < Utils.reBarcodes.size(); i++) { - int a = Integer.valueOf(Utils.reBarcodes.get(i)).intValue(); + for (int i = 0; i < Utils.oneSupplyReBarcodes.size(); i++) { + int a = Integer.valueOf(Utils.oneSupplyReBarcodes.get(i)).intValue(); if (a % 2 == 0) { Utils.retryingFindAndSendKeys(By.id("barcode"), - Utils.reBarcodes.get(i) + "\n"); + Utils.oneSupplyReBarcodes.get(i) + "\n"); } } String name = Utils.settings.getJSONObject("一级供应室器械包3").getString( Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/bo/ApplyGoodBo.java =================================================================== diff -u -r18289 -r26427 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/bo/ApplyGoodBo.java (.../ApplyGoodBo.java) (revision 18289) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/apply/bo/ApplyGoodBo.java (.../ApplyGoodBo.java) (revision 26427) @@ -20,9 +20,14 @@ private String frameId; /** - * 要点击的按钮名字 + * 要点击的按钮id */ private String btn; + + /** + * 要点击的按钮名字 + */ + private String btnName; /** * 处理科室 @@ -64,7 +69,14 @@ public void setBtn(String btn) { this.btn = btn; } + + public String getBtnName() { + return btnName; + } + public void setBtnName(String btnName) { + this.btnName = btnName; + } public String getHandleRoom() { return handleRoom; } @@ -100,4 +112,5 @@ ", assertWinId='" + assertWinId + '\'' + '}'; } + }