Blame view

src/main/java/com/buyer/pageObject/SettingMarksPage.java 1.24 KB
27d9a429   suweicheng   开发梳理;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  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;
  
  /**
   * 设置唛头页
   * @author Administrator
   *
   */
  public class SettingMarksPage extends BasePage {
  	public SettingMarksPage(WebDriver driver) {
  		super(driver);
  	}
  	//不应用唛头
  	@FindBy (xpath ="//*[@title='No shipping marks for these products']")
  	WebElement noNeedMarks;
a3e6db11   zengjin   修改bug
22
23
24
25
  
  	//第一个唛头
  	@FindBy (xpath = "//ul[@class='list']/li[2]")
  	WebElement firstMarks;
27d9a429   suweicheng   开发梳理;
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  	
  	//下一步
  	@FindBy (xpath ="//*[text()='Next step']")
  	WebElement next;
  	
  	//弹框提示-确定
  	@FindBy (xpath ="//*[text()='OK']")
  	WebElement ok;
  	
  	/**
  	 * 设置唛头:不应用唛头
  	 * @return SettingStickerPage
  	 */
  	public SettingStickerPage setMarks() {
  		/*while(!(isVisibility(By.xpath("//*[@title='No shipping marks for these products']")))) {
  			forceWait(1000);
  		}*/
  		dynamicWait(By.xpath("//*[@title='No shipping marks for these products']"));
a3e6db11   zengjin   修改bug
44
45
46
  		if(isVisibility(By.xpath("//ul[@class='list']/li[2]"))){
  			click(firstMarks);
  		}
27d9a429   suweicheng   开发梳理;
47
48
49
50
51
52
53
  		click(noNeedMarks);
  		click(next);
  		forceWait(500);
  		click(ok);
  		return new SettingStickerPage(driver);
  	}
  }