Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java =================================================================== diff -u -r19572 -r19827 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java (.../ALL.java) (revision 19572) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/ALL.java (.../ALL.java) (revision 19827) @@ -55,6 +55,7 @@ private UserRecord userrecord = new UserRecord(); private Delivery delivery = new Delivery(); private Apply apply = new Apply(); + private Sign sign = new Sign(); private Login login = new Login(); private Materials_Godown_Entry entry = new Materials_Godown_Entry(); boolean displayed = false; @@ -364,10 +365,24 @@ delivery.Delivery_custom(); delivery.Delivery_TousseAndDressing(); delivery.after(); + /*** 临床签收物品 ***/ + System.out.print("签收物品开始:"); + Utils.DateTime(); + sign.init(); + sign.Sign_Success(); + Utils.switchToDefaultContent(); + Utils.retryingFindAndClick(By + .xpath("//span[contains(text(), '个人桌面')]")); /*** 临床登记使用记录 ***/ System.out.print("登记使用记录开始:"); Utils.DateTime(); - userrecord.init(); + Utils.retryingFindAndClick(By.id("useRecord")); + Utils.retryingFindAndSwitchToFrame(By.id("iframe_useRecord")); + Utils.retryingFindAndClick(By + .xpath("//button[contains(text(), '添加')]")); + Utils.driver.switchTo().defaultContent(); + currentwindowhandle = Utils.driver.getWindowHandle(); + Utils.driver.switchTo().window(currentwindowhandle); userrecord.UserRecord_success_ji(); /*** 临床归还借物 ***/ System.out.print("归还借物开始:"); Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Sign.java =================================================================== diff -u --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Sign.java (revision 0) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/Sign.java (revision 19827) @@ -0,0 +1,76 @@ +package test.forgon.disinfectsystem.selenium; + +import org.testng.annotations.AfterMethod; +import org.testng.annotations.Test; +import org.testng.annotations.BeforeMethod; +import org.testng.AssertJUnit; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.os.WindowsUtils; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.Wait; + +import test.forgon.disinfectsystem.selenium.factory.WaitFactory; +import test.forgon.disinfectsystem.selenium.tools.JSWaiter; +import test.forgon.disinfectsystem.selenium.tools.Utils; + +/** + * @author cherry 2017-09-01 + * + */ + +public class Sign { + @BeforeMethod + public void init() { + try { + Utils.init(); + Login login = new Login(); + login.login_clinicNoWarnig(); + } catch (Exception e) { + e.printStackTrace(); + AssertJUnit.fail(e.getMessage()); + } + } + + /** + * 签收物品 + * */ + @Test + public void Sign_Success() { + try { + Utils.retryingFindAndClick(By.id("goodsReceipt")); + Utils.retryingFindAndSwitchToFrame(By.id("iframe_goodsReceipt")); + 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(); + if (a % 2 != 0) { + Utils.retryingFindAndSendKeys(By.id("awaitForRecycleTable"), + Utils.reBarcodes.get(i) + "\n"); + if(Utils.isFind(Utils.retryingFind(By.id("idBoxClose")))){ + Utils.retryingFindAndSendKeys(By.id("idBoxClose"), + "999999999" + "\n"); + Utils.switchToDefaultContent(); + Utils.retryingFindAndSwitchToFrame(By.id("iframe_goodsReceipt")); + } + } + + } + } + } catch (Exception e) { + e.printStackTrace(); + AssertJUnit.fail(e.getMessage()); + } + } + + @AfterMethod + public void after() { + Utils.driver.quit(); + WindowsUtils.killByName("IEDriverServer.exe"); + WindowsUtils.killByName("iexplore.exe"); + WindowsUtils.killByName("iexplore.exe *32"); + } + +}