-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStepDefinition.java
More file actions
71 lines (59 loc) · 1.84 KB
/
StepDefinition.java
File metadata and controls
71 lines (59 loc) · 1.84 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package Steps;
import org.openqa.selenium.By;
import io.cucumber.java.en.But;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
public class StepDefinition extends BaseClass {
//public void LaunchBrowser() {
//}
//@Given ("Load the {string}")
//public void LaunchURL(String url) {
// driver.get(url);
//}
@Given ("Enter username as {string}")
public void UserName(String uName) {
driver.findElement(By.id("username")).sendKeys(uName);
}
@Given ("Enter password as {string}")
public void Password(String pwd) {
driver.findElement(By.id("password")).sendKeys(pwd);
}
@When ("click on login button")
public void ClickLogin() {
driver.findElement(By.className("decorativeSubmit")).click();
}
@Then ("Homepage should be displayed")
public void TitleVerification() {
String TitlePage = driver.getTitle();
if (TitlePage.equals("Leaftaps - TestLeaf Automation Platform")) {
System.out.print("HomePage is displayed");
}
}
@But ("Error should be displayed")
public void errorMessgae(){
System.out.print("Page error");
}
@When("click on CRMSFA link")
public void click_on_crm_sfa_link() {
driver.findElement(By.xpath("//img[@src='/opentaps_images/integratingweb/crm.png']")).click();
}
@Then ("Leads HomePage should be opened")
public void LeadsPageTitle(){
String TitlePage = driver.getTitle();
if (TitlePage.equals("My Home | opentaps CRM")) {
System.out.print("Lead Home Page is displayed");
}
}
@When ("click on Create Leads")
public void CreatLeads() {
driver.findElement(By.xpath("//a[text()='Create Lead']")).click();
}
@Then ("CreateLead Page should be opened")
public void CreateLeadPage() {
String TitlePage = driver.getTitle();
if (TitlePage.equals("Create Lead | opentaps CRM")) {
System.out.print("Create Lead Home Page is displayed");
}
}
}