Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Wash.java =================================================================== diff -u -r21347 -r21391 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Wash.java (.../Wash.java) (revision 21347) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Wash.java (.../Wash.java) (revision 21391) @@ -28,8 +28,8 @@ @BeforeMethod public void init() { try { - //调试时需要打开 -// Utils.init(); + // 调试时需要打开 + // Utils.init(); Login login = new Login(); login.login_oneSupplyRoom(); Utils.retryingFindAndClick(By.id("washAndDisinfect")); @@ -72,8 +72,8 @@ @Test public void wash_touch() { try { - //调试时需要打开 -// Utils.init(); + // 调试时需要打开 + // Utils.init(); Login login = new Login(); String serverAddress = Utils.settings.get("服务器地址").toString(); @@ -511,9 +511,11 @@ // 定位回来 Utils.retryingFindAndSwitchToFrame(By.id("iframe_washAndDisinfect")); // 需要判断表单提交成功且返回正常后才能结束,否则就将不会提交到后台 - wait.until(ExpectedConditions.attributeToBe( - Utils.driver.findElement(By.id("washSaveSubmitResult")), - "value", "1")); + if (Utils.isFind(Utils.retryingFind(By.id("washSaveSubmitResult")))) { + wait.until(ExpectedConditions.attributeToBe( + Utils.driver.findElement(By.id("washSaveSubmitResult")), + "value", "1")); + } } } Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Assemble.java =================================================================== diff -u -r21336 -r21391 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Assemble.java (.../Assemble.java) (revision 21336) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Assemble.java (.../Assemble.java) (revision 21391) @@ -1,5 +1,7 @@ package test.forgon.disinfectsystem.selenium; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.function.Function; import org.openqa.selenium.Alert; @@ -1404,7 +1406,13 @@ Utils.retryingFindAndClick(By .xpath("//div/div/div[contains(text(), '" + name + "')]")); } - + if (Utils.retryingFind(By.id("disinfectionDate")).getText() != null) { + } else { + Date now = new Date(); + SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd"); + String date = dateFormater.format(now); + Utils.retryingFindAndSendKeys(By.id("disinfectionDate"), date); + } Utils.retryingFindAndClick(By .xpath("//tbody/tr/td/em/button[contains(text(), '装配并打印标签')]")); JSWaiter.waitUntilJQueryReady(); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Intervene.java =================================================================== diff -u -r21065 -r21391 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Intervene.java (.../Intervene.java) (revision 21065) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Intervene.java (.../Intervene.java) (revision 21391) @@ -101,6 +101,17 @@ Utils.driver.switchTo().window(currentwindowhandle); Utils.retryingFind(By .cssSelector("div[class='x-grid3-viewport']")); + if (Utils.isFind(Utils.retryingFind(By + .cssSelector("input[id='hasInvoice']")))) { + Utils.retryingFindAndClick(By + .cssSelector("input[id='hasInvoice']")); + Utils.retryingFindAndSendKeys( + By.cssSelector("input[id='hasInvoice']"), + Keys.DOWN); + Utils.retryingFindAndSendKeys( + By.cssSelector("input[id='hasInvoice']"), + "\n"); + } String name = Utils.settings.getJSONObject("一级供应室一次性物品2") .getString("名称"); Utils.retryingFindAndClick(By.id("name1")); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java =================================================================== diff -u -r21381 -r21391 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java (.../ALL.java) (revision 21381) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java (.../ALL.java) (revision 21391) @@ -758,11 +758,12 @@ } } } - try { - Runtime.getRuntime().exec("shutdown -r -t 15");// 指定15秒后重启电脑,并且强制结束其他进程 - } catch (IOException e) { - e.printStackTrace(); - } + //由于现在使用了SeleniumGridExtras,以下重启代码先注释掉 +// try { +//// Runtime.getRuntime().exec("shutdown -r -t 15");// 指定15秒后重启电脑,并且强制结束其他进程 +// } catch (IOException e) { +// e.printStackTrace(); +// } } catch (Exception e) { e.printStackTrace(); } Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Recall.java =================================================================== diff -u -r20954 -r21391 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Recall.java (.../Recall.java) (revision 20954) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Recall.java (.../Recall.java) (revision 21391) @@ -46,17 +46,24 @@ Utils.driver.switchTo().window(currentwindowhandle); if (Utils.isFind(Utils.retryingFind(By.id("barcode")))) { Utils.retryingFindAndClick(By.id("barcode")); - Utils.retryingFindAndSendKeys(By.id("barcode"), - Utils.disposableGoodsBatchBarcodesAfterEntry.get(0) - + "\n"); - Utils.retryingFindAndClick(By - .xpath("//button[contains(text(), '搜索一次性物品')]")); - if (Utils - .isFind(Utils.retryingFind(By - .cssSelector("div[class='x-grid3-cell-inner x-grid3-col-departName']")))) { + if (Utils.disposableGoodsBatchBarcodesAfterEntry.size() > 0) { + Utils.retryingFindAndSendKeys(By.id("barcode"), + Utils.disposableGoodsBatchBarcodesAfterEntry.get(0) + + "\n"); Utils.retryingFindAndClick(By - .xpath("//button[contains(text(), '保存')]")); + .xpath("//button[contains(text(), '搜索一次性物品')]")); + if (Utils + .isFind(Utils.retryingFind(By + .cssSelector("div[class='x-grid3-cell-inner x-grid3-col-departName']")))) { + Utils.retryingFindAndClick(By + .xpath("//button[contains(text(), '保存')]")); + } } + else + { + Utils.retryingFindAndClick(By + .xpath("//button[contains(text(), '取消')]")); + } JSWaiter.waitUntilJQueryReady(); } } catch (Exception e) {