From d20516863ed234a4d1bd0c69cb852538ce0046ee Mon Sep 17 00:00:00 2001 From: zengjin Date: Mon, 29 Oct 2018 10:34:28 +0800 Subject: [PATCH] 删除一些不要用的类和修改一些类的位置 --- src/main/java/com/essa/framework/BasePage1.java | 38 -------------------------------------- src/main/java/com/essa/pageObject/Documentary/PODocumentaryPage.java | 17 ----------------- src/main/java/com/essa/pageObject/HomePage.java | 1 + src/main/java/com/essa/pageObject/SupplierManage/SupplierOperationsTrackPage.java | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/essa/pageObject/SupplierManage/SupplierStrengthPage.java | 311 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/essa/pageObject/SupplierOperationsTrackPage.java | 79 ------------------------------------------------------------------------------- src/main/java/com/essa/pageObject/SupplierStrengthPage.java | 307 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/main/java/com/essa/testSuite/SendEmail.java | 6 +++++- src/main/java/com/essa/testSuite/TestDevelopmentAbility.java | 10 +++++++--- 9 files changed, 408 insertions(+), 445 deletions(-) delete mode 100644 src/main/java/com/essa/framework/BasePage1.java delete mode 100644 src/main/java/com/essa/pageObject/Documentary/PODocumentaryPage.java create mode 100644 src/main/java/com/essa/pageObject/SupplierManage/SupplierOperationsTrackPage.java create mode 100644 src/main/java/com/essa/pageObject/SupplierManage/SupplierStrengthPage.java delete mode 100644 src/main/java/com/essa/pageObject/SupplierOperationsTrackPage.java delete mode 100644 src/main/java/com/essa/pageObject/SupplierStrengthPage.java diff --git a/src/main/java/com/essa/framework/BasePage1.java b/src/main/java/com/essa/framework/BasePage1.java deleted file mode 100644 index 025790f..0000000 --- a/src/main/java/com/essa/framework/BasePage1.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.essa.framework; - -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; - -public class BasePage1 { - public static WebDriver driver; - /** - * 构造方法 - * @param driver - */ - public BasePage1(WebDriver driver) { - BasePage.driver = driver; - } - /** - * 填写文本 - * @param element 元素 - * @param text 文本值 - */ - protected void sendKeys(WebElement element, String text) { - element.clear();// 清除原有文本 - element.sendKeys(text); - } - /** - * 鼠标左键点击 - * @param element 元素 - */ - protected void click(WebElement element) { - element.click(); - } - /** - * 获取当前页面的标题 - * @return 标题 - */ - protected String getCurrentPageTitle() { - return driver.getTitle(); - } -} diff --git a/src/main/java/com/essa/pageObject/Documentary/PODocumentaryPage.java b/src/main/java/com/essa/pageObject/Documentary/PODocumentaryPage.java deleted file mode 100644 index ec5af0d..0000000 --- a/src/main/java/com/essa/pageObject/Documentary/PODocumentaryPage.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.essa.pageObject.Documentary; - -import org.openqa.selenium.WebDriver; - -import com.essa.framework.BasePage; - -/** - * @author Administrator - *PO跟单页面 - */ -public class PODocumentaryPage extends BasePage { - - public PODocumentaryPage(WebDriver driver) { - super(driver); - } - -} diff --git a/src/main/java/com/essa/pageObject/HomePage.java b/src/main/java/com/essa/pageObject/HomePage.java index 0fd068f..ae615ce 100644 --- a/src/main/java/com/essa/pageObject/HomePage.java +++ b/src/main/java/com/essa/pageObject/HomePage.java @@ -1,6 +1,7 @@ package com.essa.pageObject; import com.essa.pageObject.DocumentaryManage.POBoardPage; +import com.essa.pageObject.SupplierManage.SupplierOperationsTrackPage; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/src/main/java/com/essa/pageObject/SupplierManage/SupplierOperationsTrackPage.java b/src/main/java/com/essa/pageObject/SupplierManage/SupplierOperationsTrackPage.java new file mode 100644 index 0000000..804835d --- /dev/null +++ b/src/main/java/com/essa/pageObject/SupplierManage/SupplierOperationsTrackPage.java @@ -0,0 +1,84 @@ +package com.essa.pageObject.SupplierManage; + +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import com.essa.framework.BasePage; + +/* +* @Description:BD跟进管理页面 +* @Author: ZengJin +* @CreateTime: 2018/10/29 +*/ +public class SupplierOperationsTrackPage extends BasePage { + public SupplierOperationsTrackPage(WebDriver driver) { + super(driver); + } + + /* + * 元素定位 + */ + + // 查询输入框 + @FindBy(xpath = "//*[contains(text(),'关键字查询')]/../div/div/input") + WebElement query; + + // 查询按钮 + @FindBy(xpath = "//*[text()='查询']") + WebElement search; + + // 综合实力更新 + @FindBy(xpath = "//*/button[contains(text(),'综合实力更新')]") + WebElement supplierStrength; + + // 第一条查询结果(用于确定是否查询完毕) + @FindBy(xpath = "//*[@id='content-table']/tbody/tr[1]") + WebElement firstResult; + + // 检查点:自主发布商品数 + @FindBy(xpath = "//*[@id='content-table']/thead/tr/th[10]") + WebElement checkPoint; + + /* + * 页面方法 + */ + + // 输入要查询的文本 + public void searchText(String text) throws InterruptedException { + + // 输入要查询的供应商或者编号等,点击查询按钮 + + sendKeys(query, text); + + click(search); + + } + + // 检查是否进入平台运营跟进管理 + public boolean isSucceed() { + + return isThisPage("自主发布商品数", checkPoint); + + } + + // 跳转到综合实力更新 + public SupplierStrengthPage goToSupplierStrengthPage(String supplierName) throws InterruptedException { + /* + * 查询供应商,点击 综合实力更新,将driver传递至综合实力更新页面 + */ + searchText(supplierName); + + click(supplierStrength); + + + return new SupplierStrengthPage(driver); + + } + + // 列表是否有查询结果,没有则等待 + public void waitResult() throws InterruptedException { + while(!(firstResult.isDisplayed())) + Thread.sleep(1000); + } +} diff --git a/src/main/java/com/essa/pageObject/SupplierManage/SupplierStrengthPage.java b/src/main/java/com/essa/pageObject/SupplierManage/SupplierStrengthPage.java new file mode 100644 index 0000000..ce841f1 --- /dev/null +++ b/src/main/java/com/essa/pageObject/SupplierManage/SupplierStrengthPage.java @@ -0,0 +1,311 @@ +package com.essa.pageObject.SupplierManage; + +import java.util.List; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import com.essa.framework.BasePage; +/* +* @Description:综合实力评估页面 +* @Author: ZengJin +* @CreateTime: 2018/10/29 +*/ +public class SupplierStrengthPage extends BasePage{ + public SupplierStrengthPage(WebDriver driver) { + super(driver); + } + + + /* + * 元素定位 + */ + + //配合度 + @FindBy (xpath="//*[contains(text(),'配合度')]/../div[1]/div/select") + WebElement cooperateDegree; + + //主打产品定位 + @FindBy (xpath="//*[@dict-check-list='supplier_main_product_location']/select") + WebElement mainProduct; + + //是否有研发能力:否 + @FindBy (xpath = "//*[contains(text(),'是否有研发能力')]/../div/label[2]") + WebElement notDev; + + //是否研发能力:是 + @FindBy (xpath = "//*[contains(text(),'是否有研发能力')]/../div/label[1]") + WebElement isDev; + + //每个季度有新品推出 + @FindBy (xpath = ".//*[@class='col-md-20']/div/label[1]/input") + WebElement newGoodsEveryQuarter; + + //有配备工程师 + @FindBy (xpath =".//*[@class='col-md-20']/div/label[2]/input") + WebElement existsEngineer; + + //有产品研发团队 + @FindBy (xpath = ".//*[@class='col-md-20']/div/label[3]/input") + WebElement existsProductDev; + + //其他 + @FindBy (xpath = ".//*[@class='col-md-20']/div/label[4]/input") + WebElement others; + + //其他文本输入框 + @FindBy (xpath = ".//*[@ng-model='ctrl.model.otherDevelopmentAbilityValue']") + WebElement otherDevAbilValue; + + //是否有证书:是 + @FindBy (xpath = ".//*[contains(text(),'是否有证书')]/../div/label[1]") + WebElement isCertificate; + + //是否有证书:否 + @FindBy (xpath =".//*[contains(text(),'是否有证书')]/../div/label[2]") + WebElement notCertificate; + + //添加证书的“+” + @FindBy (xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[1]/div/button[1]") + WebElement addCertificate; + + /* + * 由于这个是动态表格,表格行数会变化,必须自己写方法来定位元素 + * 证书类型选择项,value值:0~8 0:BSCI,1:SA8000,2:ICTT…… + */ + public WebElement itemType(int i) { + String xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[1]/table/tbody/tr["+i+"]/td[2]/div/select"; + return driver.findElement(By.xpath(xpath)); + } + + //证书编号文本框 + public WebElement itemCode(int i) { + String xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[1]/table/tbody/tr["+i+"]/td[3]/input"; + return driver.findElement(By.xpath(xpath)); + } + + //证书说明文本框 + public WebElement itemDec(int i) { + String xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[1]/table/tbody/tr["+i+"]/td[4]/input"; + return driver.findElement(By.xpath(xpath)); + } + + //证书图片,用于判断图片是否上传成功 + public WebElement imge(int i) { + String xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[2]/div[2]/div/div["+i+"]/div[1]/img"; + return driver.findElement(By.xpath(xpath)); + } + + //添加证书文件 + public WebElement itemFile(int i) { + String xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[2]/div[2]/div/div["+i+"]/div[4]"; + return driver.findElement(By.xpath(xpath)); + } + + //已添加证书下的证书集合 + @FindBy (xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[1]/table/tbody/tr") + List checkBoxes; + + //是否服务过大客户:是 + @FindBy (xpath = ".//*[contains(text(),'是否服务过大客户')]/../div[1]/label[1]") + WebElement isServLargeCus; + + //是否服务过大客户:否 + @FindBy (xpath = ".//*[contains(text(),'是否服务过大客户')]/../div[1]/label[2]") + WebElement notServLargeCus; + + //服务过的大客户数 + @FindBy (xpath = ".//*[@list='ctrl.model.serviceLargeCustomerList']/div/table/tbody/tr") + List customers; + + //大客户的“+” + @FindBy (xpath = ".//*[@list='ctrl.model.serviceLargeCustomerList']/div/div/button[1]") + WebElement addCustomer; + + //大客户名称文本框 + public WebElement largeCusName(int i) { + String xpath = ".//*[@list='ctrl.model.serviceLargeCustomerList']/div/table/tbody/tr["+i+"]/td[2]/input"; + return driver.findElement(By.xpath(xpath)); + } + + //备注文本框 + public WebElement note(int i) { + String xpath = ".//*[@list='ctrl.model.serviceLargeCustomerList']/div/table/tbody/tr["+i+"]/td[3]/input"; + return driver.findElement(By.xpath(xpath)); + } + + //确定按钮 + @FindBy (xpath = "//*[text()='确定']") + WebElement submit; + + //标签页名称 + @FindBy (xpath ="//*/a[contains(text(),'综合实力评估')]") + WebElement labelName; + + //提交完成后,操作成功的弹框关闭按钮 + @FindBy (xpath="//*[@class='close']") + WebElement alertClosed; + + //关闭页面 + @FindBy(xpath = "//*[text()='综合实力评估']/../span") + WebElement closed; + + + /* + * 方法 + */ + + //选择配合度 + public void selectCooperateDegree(String cooperateGrade) { + + //选择配合度:高、中、低 + selectElement(cooperateDegree, cooperateGrade); + + } + + //是否有研发能力,参数可选 是/否 + public void isDevAblity(String ablity) { + if("是".equals(ablity)) + click(isDev); + else { + click(notDev); + } + } + + // + + //提交编辑 + public void submit() { + moveHeightScroll("0"); + click(submit); + + } + + //勾选每季度有新品推出 + public void newProduct() { + if(newGoodsEveryQuarter.isSelected());//判断是否已勾选 + else { + isElementExist(newGoodsEveryQuarter); + click(newGoodsEveryQuarter); + } + } + + //勾选有配备工程师 + public void haveEngineer() { + if(existsEngineer.isSelected()); + else { + isElementExist(existsEngineer); + click(existsEngineer); + } + } + + //勾选有研发团队 + public void haveTeam() { + if (existsProductDev.isSelected()); + else { + isElementExist(existsProductDev); + click(existsProductDev); + } + } + + //勾选“其他” + public void other() { + if(others.isSelected()); + else { + click(others); + isElementExist(otherDevAbilValue); + sendKeys(otherDevAbilValue, "我们每天都有新品推出!"); + } + } + + + //拖动滚动条,因为本页面如果数据量多,就看不到头部的关闭本页面的X + public void moveScroll() { + + moveHeightScroll("100"); + + } + + //检查是否列表加载完成 + public boolean isSucceed() throws InterruptedException { + while(!(labelName.isDisplayed())) { + Thread.sleep(1000); + } + return isElementExist(labelName); + + } + + //判断是否提交成功 + public boolean isSubmit() { + + return isElementExist(alertClosed); + + } + + //关闭“操作成功”提示 + public void alertClosed() { + click(alertClosed); + } + + /* + * 添加证书逻辑: + * 1.点击是否有证书:是 + * 2.点击“+” + * 3.统计已有x个证书 + * 4.i=x + * 5.选择证书类型WRAP,证书编号,证书说明,传证书图片 + * 6.判断证书是否上传成功,不成功则等待 + */ + public void addCertification() throws Exception { + click(isCertificate); + isElementExist(addCertificate); + click(addCertificate); + + List list= checkBoxes; + int x = list.size(); + + selectElement(itemType(x), "WRAP"); + sendKeys(itemCode(x), "20180331:"+x); + sendKeys(itemDec(x), "证书说明:这是第"+x+"个证书"); + click(itemFile(x)); + uploadFile("E:\\pic\\证书.jpg"); + + //如果图片是系统默认的图片,则等待1秒 + while("/img/nopic.jpg".equals(imge(x).getAttribute("ng-src"))) { + Thread.sleep(1000); + } + } + + /* + * 添加服务大客户记录 + * 先把滚动条拉下来,不然找不到元素 + * 1.是否服务过大客户,点击:是 + * 2.点击“+” + * 3.判断已有服务过的次数x,i=x + * 4.写入大客户名称,备注 + */ + public void addSerLargeCus() { + moveHeightScroll("0"); + click(isServLargeCus); + isElementExist(addCustomer); + click(addCustomer); + List list = customers; + int x = list.size(); + sendKeys(largeCusName(x), "第"+x+"大客户"); + sendKeys(note(x), "这个是备注信息"+x); + } + + //选择主打产品 + public void selMainProduct(String degree) { + selectElement(mainProduct, degree); + } + + //关闭本页面 + public void closed() { + + click(closed); + + } +} diff --git a/src/main/java/com/essa/pageObject/SupplierOperationsTrackPage.java b/src/main/java/com/essa/pageObject/SupplierOperationsTrackPage.java deleted file mode 100644 index 2e903fd..0000000 --- a/src/main/java/com/essa/pageObject/SupplierOperationsTrackPage.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.essa.pageObject; - -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import com.essa.framework.BasePage; - -public class SupplierOperationsTrackPage extends BasePage { - public SupplierOperationsTrackPage(WebDriver driver) { - super(driver); - } - - /* - * 元素定位 - */ - - // 查询输入框 - @FindBy(xpath = "//*[contains(text(),'关键字查询')]/../div/div/input") - WebElement query; - - // 查询按钮 - @FindBy(xpath = "//*[text()='查询']") - WebElement search; - - // 综合实力更新 - @FindBy(xpath = "//*/button[contains(text(),'综合实力更新')]") - WebElement supplierStrength; - - // 第一条查询结果(用于确定是否查询完毕) - @FindBy(xpath = "//*[@id='content-table']/tbody/tr[1]") - WebElement firstResult; - - // 检查点:自主发布商品数 - @FindBy(xpath = "//*[@id='content-table']/thead/tr/th[10]") - WebElement checkPoint; - - /* - * 页面方法 - */ - - // 输入要查询的文本 - public void searchText(String text) throws InterruptedException { - - // 输入要查询的供应商或者编号等,点击查询按钮 - - sendKeys(query, text); - - click(search); - - } - - // 检查是否进入平台运营跟进管理 - public boolean isSucceed() { - - return isThisPage("自主发布商品数", checkPoint); - - } - - // 跳转到综合实力更新 - public SupplierStrengthPage goToSupplierStrengthPage(String supplierName) throws InterruptedException { - /* - * 查询供应商,点击 综合实力更新,将driver传递至综合实力更新页面 - */ - searchText(supplierName); - - click(supplierStrength); - - - return new SupplierStrengthPage(driver); - - } - - // 列表是否有查询结果,没有则等待 - public void waitResult() throws InterruptedException { - while(!(firstResult.isDisplayed())) - Thread.sleep(1000); - } -} diff --git a/src/main/java/com/essa/pageObject/SupplierStrengthPage.java b/src/main/java/com/essa/pageObject/SupplierStrengthPage.java deleted file mode 100644 index ed7ad24..0000000 --- a/src/main/java/com/essa/pageObject/SupplierStrengthPage.java +++ /dev/null @@ -1,307 +0,0 @@ -package com.essa.pageObject; - -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import com.essa.framework.BasePage; - -public class SupplierStrengthPage extends BasePage{ - public SupplierStrengthPage(WebDriver driver) { - super(driver); - } - - - /* - * 元素定位 - */ - - //配合度 - @FindBy (xpath="//*[contains(text(),'配合度')]/../div[1]/div/select") - WebElement cooperateDegree; - - //主打产品定位 - @FindBy (xpath="//*[@dict-check-list='supplier_main_product_location']/select") - WebElement mainProduct; - - //是否有研发能力:否 - @FindBy (xpath = "//*[contains(text(),'是否有研发能力')]/../div/label[2]") - WebElement notDev; - - //是否研发能力:是 - @FindBy (xpath = "//*[contains(text(),'是否有研发能力')]/../div/label[1]") - WebElement isDev; - - //每个季度有新品推出 - @FindBy (xpath = ".//*[@class='col-md-20']/div/label[1]/input") - WebElement newGoodsEveryQuarter; - - //有配备工程师 - @FindBy (xpath =".//*[@class='col-md-20']/div/label[2]/input") - WebElement existsEngineer; - - //有产品研发团队 - @FindBy (xpath = ".//*[@class='col-md-20']/div/label[3]/input") - WebElement existsProductDev; - - //其他 - @FindBy (xpath = ".//*[@class='col-md-20']/div/label[4]/input") - WebElement others; - - //其他文本输入框 - @FindBy (xpath = ".//*[@ng-model='ctrl.model.otherDevelopmentAbilityValue']") - WebElement otherDevAbilValue; - - //是否有证书:是 - @FindBy (xpath = ".//*[contains(text(),'是否有证书')]/../div/label[1]") - WebElement isCertificate; - - //是否有证书:否 - @FindBy (xpath =".//*[contains(text(),'是否有证书')]/../div/label[2]") - WebElement notCertificate; - - //添加证书的“+” - @FindBy (xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[1]/div/button[1]") - WebElement addCertificate; - - /* - * 由于这个是动态表格,表格行数会变化,必须自己写方法来定位元素 - * 证书类型选择项,value值:0~8 0:BSCI,1:SA8000,2:ICTT…… - */ - public WebElement itemType(int i) { - String xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[1]/table/tbody/tr["+i+"]/td[2]/div/select"; - return driver.findElement(By.xpath(xpath)); - } - - //证书编号文本框 - public WebElement itemCode(int i) { - String xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[1]/table/tbody/tr["+i+"]/td[3]/input"; - return driver.findElement(By.xpath(xpath)); - } - - //证书说明文本框 - public WebElement itemDec(int i) { - String xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[1]/table/tbody/tr["+i+"]/td[4]/input"; - return driver.findElement(By.xpath(xpath)); - } - - //证书图片,用于判断图片是否上传成功 - public WebElement imge(int i) { - String xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[2]/div[2]/div/div["+i+"]/div[1]/img"; - return driver.findElement(By.xpath(xpath)); - } - - //添加证书文件 - public WebElement itemFile(int i) { - String xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[2]/div[2]/div/div["+i+"]/div[4]"; - return driver.findElement(By.xpath(xpath)); - } - - //已添加证书下的证书集合 - @FindBy (xpath = ".//*[@list='ctrl.model.supplierCertificationList']/div[1]/table/tbody/tr") - List checkBoxes; - - //是否服务过大客户:是 - @FindBy (xpath = ".//*[contains(text(),'是否服务过大客户')]/../div[1]/label[1]") - WebElement isServLargeCus; - - //是否服务过大客户:否 - @FindBy (xpath = ".//*[contains(text(),'是否服务过大客户')]/../div[1]/label[2]") - WebElement notServLargeCus; - - //服务过的大客户数 - @FindBy (xpath = ".//*[@list='ctrl.model.serviceLargeCustomerList']/div/table/tbody/tr") - List customers; - - //大客户的“+” - @FindBy (xpath = ".//*[@list='ctrl.model.serviceLargeCustomerList']/div/div/button[1]") - WebElement addCustomer; - - //大客户名称文本框 - public WebElement largeCusName(int i) { - String xpath = ".//*[@list='ctrl.model.serviceLargeCustomerList']/div/table/tbody/tr["+i+"]/td[2]/input"; - return driver.findElement(By.xpath(xpath)); - } - - //备注文本框 - public WebElement note(int i) { - String xpath = ".//*[@list='ctrl.model.serviceLargeCustomerList']/div/table/tbody/tr["+i+"]/td[3]/input"; - return driver.findElement(By.xpath(xpath)); - } - - //确定按钮 - @FindBy (xpath = "//*[text()='确定']") - WebElement submit; - - //标签页名称 - @FindBy (xpath ="//*/a[contains(text(),'综合实力评估')]") - WebElement labelName; - - //提交完成后,操作成功的弹框关闭按钮 - @FindBy (xpath="//*[@class='close']") - WebElement alertClosed; - - //关闭页面 - @FindBy(xpath = "//*[text()='综合实力评估']/../span") - WebElement closed; - - - /* - * 方法 - */ - - //选择配合度 - public void selectCooperateDegree(String cooperateGrade) { - - //选择配合度:高、中、低 - selectElement(cooperateDegree, cooperateGrade); - - } - - //是否有研发能力,参数可选 是/否 - public void isDevAblity(String ablity) { - if("是".equals(ablity)) - click(isDev); - else { - click(notDev); - } - } - - // - - //提交编辑 - public void submit() { - moveHeightScroll("0"); - click(submit); - - } - - //勾选每季度有新品推出 - public void newProduct() { - if(newGoodsEveryQuarter.isSelected());//判断是否已勾选 - else { - isElementExist(newGoodsEveryQuarter); - click(newGoodsEveryQuarter); - } - } - - //勾选有配备工程师 - public void haveEngineer() { - if(existsEngineer.isSelected()); - else { - isElementExist(existsEngineer); - click(existsEngineer); - } - } - - //勾选有研发团队 - public void haveTeam() { - if (existsProductDev.isSelected()); - else { - isElementExist(existsProductDev); - click(existsProductDev); - } - } - - //勾选“其他” - public void other() { - if(others.isSelected()); - else { - click(others); - isElementExist(otherDevAbilValue); - sendKeys(otherDevAbilValue, "我们每天都有新品推出!"); - } - } - - - //拖动滚动条,因为本页面如果数据量多,就看不到头部的关闭本页面的X - public void moveScroll() { - - moveHeightScroll("100"); - - } - - //检查是否列表加载完成 - public boolean isSucceed() throws InterruptedException { - while(!(labelName.isDisplayed())) { - Thread.sleep(1000); - } - return isElementExist(labelName); - - } - - //判断是否提交成功 - public boolean isSubmit() { - - return isElementExist(alertClosed); - - } - - //关闭“操作成功”提示 - public void alertClosed() { - click(alertClosed); - } - - /* - * 添加证书逻辑: - * 1.点击是否有证书:是 - * 2.点击“+” - * 3.统计已有x个证书 - * 4.i=x - * 5.选择证书类型WRAP,证书编号,证书说明,传证书图片 - * 6.判断证书是否上传成功,不成功则等待 - */ - public void addCertification() throws Exception { - click(isCertificate); - isElementExist(addCertificate); - click(addCertificate); - - List list= checkBoxes; - int x = list.size(); - - selectElement(itemType(x), "WRAP"); - sendKeys(itemCode(x), "20180331:"+x); - sendKeys(itemDec(x), "证书说明:这是第"+x+"个证书"); - click(itemFile(x)); - uploadFile("E:\\pic\\证书.jpg"); - - //如果图片是系统默认的图片,则等待1秒 - while("/img/nopic.jpg".equals(imge(x).getAttribute("ng-src"))) { - Thread.sleep(1000); - } - } - - /* - * 添加服务大客户记录 - * 先把滚动条拉下来,不然找不到元素 - * 1.是否服务过大客户,点击:是 - * 2.点击“+” - * 3.判断已有服务过的次数x,i=x - * 4.写入大客户名称,备注 - */ - public void addSerLargeCus() { - moveHeightScroll("0"); - click(isServLargeCus); - isElementExist(addCustomer); - click(addCustomer); - List list = customers; - int x = list.size(); - sendKeys(largeCusName(x), "第"+x+"大客户"); - sendKeys(note(x), "这个是备注信息"+x); - } - - //选择主打产品 - public void selMainProduct(String degree) { - selectElement(mainProduct, degree); - } - - //关闭本页面 - public void closed() { - - click(closed); - - } -} diff --git a/src/main/java/com/essa/testSuite/SendEmail.java b/src/main/java/com/essa/testSuite/SendEmail.java index aec2d62..acf6df5 100644 --- a/src/main/java/com/essa/testSuite/SendEmail.java +++ b/src/main/java/com/essa/testSuite/SendEmail.java @@ -16,7 +16,11 @@ import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; - +/* +* @Description:发送邮件的demo +* @Author: ZengJin +* @CreateTime: 2018/10/29 +*/ public class SendEmail { public static void main(String[] args) { diff --git a/src/main/java/com/essa/testSuite/TestDevelopmentAbility.java b/src/main/java/com/essa/testSuite/TestDevelopmentAbility.java index e564f11..fb9e0d0 100644 --- a/src/main/java/com/essa/testSuite/TestDevelopmentAbility.java +++ b/src/main/java/com/essa/testSuite/TestDevelopmentAbility.java @@ -3,8 +3,8 @@ package com.essa.testSuite; import com.essa.framework.SystemConstant; import com.essa.pageObject.BaseTest; import com.essa.pageObject.HomePage; -import com.essa.pageObject.SupplierOperationsTrackPage; -import com.essa.pageObject.SupplierStrengthPage; +import com.essa.pageObject.SupplierManage.SupplierOperationsTrackPage; +import com.essa.pageObject.SupplierManage.SupplierStrengthPage; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.PageFactory; import org.testng.annotations.AfterClass; @@ -16,7 +16,11 @@ import org.testng.asserts.SoftAssert; import java.io.IOException; import static org.testng.Assert.assertEquals; - +/* +* @Description:综合实力评估 +* @Author: ZengJin +* @CreateTime: 2018/10/29 +*/ public class TestDevelopmentAbility extends BaseTest { WebDriver driver; -- libgit2 0.21.2