Blame view

src/main/java/com/essa/pageObject/GoodsManage/AuditOriginalOpreatePage.java 1.86 KB
27d9a429   suweicheng   开发梳理;
1
2
  package com.essa.pageObject.GoodsManage;
  
b2af39f8   zengjin   新增开发商品
3
  import org.openqa.selenium.By;
27d9a429   suweicheng   开发梳理;
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.support.FindBy;
  
  import com.essa.framework.BasePage;
  
  /**
   * @author Administrator
   *审核原厂商品页面
   */
  public class AuditOriginalOpreatePage extends BasePage {
  	public AuditOriginalOpreatePage(WebDriver driver) {
  		super(driver);
  	}
  	/*
  	 * 元素定位
  	 */
  	
  	//审核通过
  	@FindBy(xpath="//*[text()='审核通过']")
  	WebElement pass;
  	
  	//审核通过提示语
  	@FindBy(xpath="//*[text()='商品审核已通过'")
  	WebElement succeedMessage;
b2af39f8   zengjin   新增开发商品
29
30
31
32
33
34
35
36
37
38
39
40
  
  	//定价销售
  	@FindBy (xpath = "//*[@ng-model='skuItem.isFixedSale']")
  	WebElement isFixedSale;
  
  	//毛利率
  	@FindBy (xpath = "//*[@ng-model='skuItem.grossProfit2']")
  	WebElement grossProfit;
  
  	//工厂货号重复时,确定按钮
  	@FindBy (xpath = "//*[text()='确定']")
  	WebElement confirm;
27d9a429   suweicheng   开发梳理;
41
42
43
44
45
46
47
48
49
50
51
  	
  	/*
  	 * 页面方法
  	 */
  	
  	/**
  	 * 挪动滚动条至底部,点击审核通过
  	 * @return AuditOriginalGoodsPage
  	 */
  	public AuditOriginalGoodsPage auditPass() {
  		forceWait(2000);
b2af39f8   zengjin   新增开发商品
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  		moveHeightScroll("0");
  		click(pass);
  		forceWait(500);
  		if (isVisibility(By.xpath("//*[text()='确定']")))
  			click(confirm);
  		return new AuditOriginalGoodsPage(driver);
  	}
  	/**
  	 *开发商品审核通过,要设置毛利率
  	 * @param
  	 * @return AuditOriginalGoodsPage
  	 */
  	public AuditOriginalGoodsPage auditDevGoodPass(){
  		forceWait(2000);
  		moveHeightScroll("50");
  		selectElement(isFixedSale,"否");
  		sendKeys(grossProfit,"5");
  		moveHeightScroll("0");
27d9a429   suweicheng   开发梳理;
70
  		click(pass);
b2af39f8   zengjin   新增开发商品
71
72
73
  		forceWait(500);
  		if (isVisibility(By.xpath("//*[text()='确定']")))
  			click(confirm);
27d9a429   suweicheng   开发梳理;
74
75
76
77
78
79
80
81
82
83
84
85
  		return new AuditOriginalGoodsPage(driver);
  	}
  	
  	/**
  	 * 用于断言商品审核是否通过
  	 * @return boolean
  	 */
  	public boolean isSucceed() {
  		return isElementExist(succeedMessage);
  	}
  	
  }