Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium3/testscript/TestForeignProxyDisinfection.java =================================================================== diff -u -r34143 -r34280 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium3/testscript/TestForeignProxyDisinfection.java (.../TestForeignProxyDisinfection.java) (revision 34143) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium3/testscript/TestForeignProxyDisinfection.java (.../TestForeignProxyDisinfection.java) (revision 34280) @@ -9,13 +9,15 @@ + import net.sf.json.JSONObject; import org.apache.log4j.Logger; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; @@ -77,6 +79,36 @@ Assert.assertTrue(result.contains(expect)); } + @Test + @Ignore + @Story("通过勾选第一条来删除一条外部代理灭菌记录") + public void test_foreignproxydisinfect_delete_by_select_options() { + JSONObject operator = normalforeignproxySterilizeJsonObj.getJSONObject("operator");//操作人 + String barcodes = normalforeignproxySterilizeJsonObj.getJSONObject("basic").getString("barcodes_1");//灭菌员 + String foreignProxyGroup = normalforeignproxySterilizeJsonObj.getJSONObject("basic").getString("foreignProxyGroup");//所属分组 + String depart = normalforeignproxySterilizeJsonObj.getJSONObject("basic").getString("depart");//申请科室 + String applicant = normalforeignproxySterilizeJsonObj.getJSONObject("basic").getString("applicant");//申请人 + String maker = normalforeignproxySterilizeJsonObj.getJSONObject("basic").getString("maker");//制作者 + String assistant = normalforeignproxySterilizeJsonObj.getJSONObject("basic").getString("assistant");//核对者 + String basket_barcodes = normalforeignproxySterilizeJsonObj.getJSONObject("basic").getString("basket_barcodes");//灭菌篮筐 + String scheduleTime = normalforeignproxySterilizeJsonObj.getJSONObject("basic").getString("scheduleTime");//预约时间 + String remark = normalforeignproxySterilizeJsonObj.getJSONObject("basic").getString("remark");//备注 + String package1 = normalforeignproxySterilizeJsonObj.getJSONObject("packages").getString("package1");//物品名称 + String count1 = normalforeignproxySterilizeJsonObj.getJSONObject("packages").getString("count1");//数量 + String expect = normalforeignproxySterilizeJsonObj.getJSONObject("expect").getString("delete");//预期结果 + + + //登录 + logger.debug("登录"); + loginProxy.go_login_by_btn(operator.getString("username"), operator.getString("password")); + personalDesktopProxy.go_ForeignProxyDisinfection();//进入外部代理灭菌 + //添加一条外部代理灭菌记录 + logger.debug("通过勾选第一条来删除一条外部代理灭菌记录"); + String result= ForeignProxyDisinfectionProxy.foreignproxydisinfection_delete_by_select_options(); + + Assert.assertTrue(result.contains(expect)); + } + @After public void tearDown() throws FileNotFoundException, WebDriverException, InterruptedException{ Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium3/page/sterile/ForeignProxyDisinfectionPage.java =================================================================== diff -u -r34143 -r34280 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium3/page/sterile/ForeignProxyDisinfectionPage.java (.../ForeignProxyDisinfectionPage.java) (revision 34143) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium3/page/sterile/ForeignProxyDisinfectionPage.java (.../ForeignProxyDisinfectionPage.java) (revision 34280) @@ -13,7 +13,7 @@ */ public class ForeignProxyDisinfectionPage extends BasePage { private By foreignProxySterilization = By.id("iframe_foreignProxySterilizationManage");// 外部代理灭菌管理标签页 - private By addBtn = By.xpath("//button[text()='添加']");// 添加按钮 + private By addBtn = By.cssSelector("button.x-btn-text.btn_ext_application_add");// 添加按钮 private By scanBarcode = By.id("scanBarcode");// 扫描条码框 private By foreignProxyGroup = By.id("foreignProxyGroup");// 所属分组 private By depart = By.id("depart");// 申请科室 @@ -32,9 +32,10 @@ private By yes = By.xpath("//button[text()='是']");// 是否提交外部代理灭菌单信息-是按钮 private By no = By.xpath("//button[text()='否']");// 是否提交外部代理灭菌单信息-否按钮 - private By first_select = By.xpath("/html/body/div[1]/div/div/div/div[2]/div[2]/div/div[1]/div[2]/div/div[1]/table/tbody/tr/td[1]/div/div");// 第一个复选框 - private By delete = By.xpath("//button[text()='删除']");// 删除按钮 + private By first_select = By.cssSelector("div.x-grid3-row-checker:first-child"); + private By delete = By.cssSelector("button.x-btn-text.btn_ext_application_del"); + /** * 获取灭菌标签页 *