Blame view

src/main/java/com/buyer/pageObject/PayDepositPage.java 2.07 KB
27d9a429   suweicheng   开发梳理;
1
2
3
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
  package com.buyer.pageObject;
  
  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;
  import com.essa.framework.Model;
  
  /**
   * @author Administrator
   *支付定金页
   */
  public class PayDepositPage extends BasePage {
  	public PayDepositPage(WebDriver driver) {
  		super(driver);
  	}
  	
  	//PO信息
  	@FindBy (xpath="//*[contains(text(),'PO information')]")
  	WebElement POInfo;
  	
  	//查看资金详情---可用资金不足
  	@FindBy (xpath ="//button[@class='submit-payment-deposit-button btn btn-primary']")
  	WebElement FundDetail;
  	
  	//免定金模式--确认按钮
a3e6db11   zengjin   修改bug
29
  	@FindBy (xpath ="//button[@class='btn btn-primary queding']")
27d9a429   suweicheng   开发梳理;
30
  	WebElement ok;
a3e6db11   zengjin   修改bug
31
32
33
34
  
  	//其他支付模式
  	@FindBy (xpath = "//button[@class='btn btn-primary btn-sm loading']")
  	WebElement confirm;
27d9a429   suweicheng   开发梳理;
35
36
37
38
  	
  	//po单号
  	@FindBy (xpath ="//*[contains(text(),'PO number:')]/../../td[2]/span")
  	WebElement poNum;
e747aeb0   zengjin   免定金方式bug修改
39
40
41
42
  
  	//免定金的确认
  	@FindBy (xpath = "//*[@ng-click='submit()']")
  	WebElement submit;
27d9a429   suweicheng   开发梳理;
43
44
45
46
47
48
  	
  	/**
  	 * 查看资金详情
  	 * @return AssetManagementPage
  	 */
  	public AssetManagementPage toAssetManagementPage() {
a3e6db11   zengjin   修改bug
49
  
27d9a429   suweicheng   开发梳理;
50
51
52
53
54
  		click(FundDetail);
  		return new AssetManagementPage(driver);
  	}
  	
  	/**
e747aeb0   zengjin   免定金方式bug修改
55
  	 * 确认PO:单柜比例
27d9a429   suweicheng   开发梳理;
56
57
58
59
  	 * @return MyOrderPage
  	 */
  	public MyOrderPage confirm() {
  		click(ok);
a3e6db11   zengjin   修改bug
60
61
62
  		if(isVisibility(By.xpath("//button[@class='btn btn-primary btn-sm loading']"))){
  			click(confirm);
  		}
27d9a429   suweicheng   开发梳理;
63
64
  		return new MyOrderPage(driver);
  	}
e747aeb0   zengjin   免定金方式bug修改
65
66
67
68
69
70
71
  
  
  	/**
  	 *确认PO操作方法
  	 * @param
  	 * @return
  	 */
27d9a429   suweicheng   开发梳理;
72
  	public void operate() {
27d9a429   suweicheng   开发梳理;
73
74
  		dynamicWait(By.xpath("//*[contains(text(),'PO information')]"));
  		Model.setPoNum(poNum.getText());
3f06ee1c   zengjin   修改时间工具,还有船务相关
75
  
27d9a429   suweicheng   开发梳理;
76
77
78
  		if (isVisibility(By.xpath("//button[@class='submit-payment-deposit-button btn btn-primary']"))) {
  			//如果是可用资金不足,跳转到资金管理
  			toAssetManagementPage();
e747aeb0   zengjin   免定金方式bug修改
79
  		}else if (isVisibility(By.xpath("//*[@ng-click='submit()']"))) {
27d9a429   suweicheng   开发梳理;
80
  			//免定金模式,确认po,跳转到我的订单列表
e747aeb0   zengjin   免定金方式bug修改
81
82
83
  			click(submit);
  		}else {
  			//单柜比例定金
27d9a429   suweicheng   开发梳理;
84
85
86
87
88
  			confirm();
  		}
  		forceWait(2000);
  	}
  }