NeedDealtApplyPage.java 2.48 KB
package com.essa.pageObject.needDealt;

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;
import com.essa.pageObject.HomePage;

/**
 * 当团购活动成功时,类目经理采购计划单申请页面
 * @author Administrator
 *
 */
public class NeedDealtApplyPage extends BasePage {

	public NeedDealtApplyPage(WebDriver driver) {
		super(driver);
	}

	/*
	 * 元素定位
	 */
	
	//提交询价
	@FindBy (xpath ="//*[text()='提交询价']")
	WebElement submitInquiry;
	
	//待办工作--检查点
	@FindBy (xpath = "//*[contains(text(),'待办工作')]")
	WebElement checkpoint;
	
	//流水号
	@FindBy (xpath = "//*[contains(text(),'流水号:RW')]")
	WebElement serialNumber;
	
	//确认
	@FindBy (xpath = "//*[text()='确认']")
	WebElement confirm;
	
	//送审核
	@FindBy (xpath = "//*[text()='提交审核']")
	WebElement toAudit;
	
	//认领
	@FindBy (xpath = "//*[text()='认领']")
	WebElement claim;
	
	//同意
	@FindBy (xpath ="//*[text()='同意']")
	WebElement agree;
	
	/*
	 * 页面方法
	 */
	
	/**
	 * 提交询价 
	 * @return bmps首页
	 */
	public HomePage submitInquiry() {
		mywait(checkpoint);
		forceWait(1000);
		Model.setSerialNum(partialStr(serialNumber.getText(), "流水号:"));
		moveHeightScroll("100");
		click(submitInquiry);
		forceWait(500);
		click(confirm);
		dynamicLoad(By.xpath("//*[style='display: block;']"));
		return new HomePage(driver);
	}
	
	/**
	 * 类目经理修订,送审核
	 * @return bpms首页
	 */
	public HomePage toAudit() {
		mywait(checkpoint);
		forceWait(1000);
		moveHeightScroll("100");
		click(toAudit);
		forceWait(500);
		click(confirm);
		dynamicLoad(By.xpath("//*[style='display: block;']"));
		return new HomePage(driver);
	}
	
	/**
	 * 财务审核计划申请
	 * @return
	 */
	public HomePage audit() {
		mywait(checkpoint);
		forceWait(1000);
		moveHeightScroll("100");
		click(claim);
		mywait(checkpoint);
		moveHeightScroll("100");
		click(agree);
		click(confirm);
		dynamicLoad(By.xpath("//*[style='display: block;']"));
		return new HomePage(driver);
	}
	
	public HomePage confirmSailingDate() {
		mywait(checkpoint);
		forceWait(1000);
		Model.setSerialNum(partialStr(serialNumber.getText(), "流水号:"));
		click(confirm);
		return new HomePage(driver);
	}
}