forked from kolaparthisrini/BDD-Java-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMYtest.java
40 lines (31 loc) · 1.07 KB
/
MYtest.java
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
package junitcucumber;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import cucumber.annotation.en.Given;
import cucumber.annotation.en.Then;
import cucumber.annotation.en.When;
public class MYtest {
WebDriver driver = null;
@Given("^I have open the browser$")
public void openBrowser() {
driver = new FirefoxDriver();
}
@Given("^I have open the browser$")
public void i_have_open_the_browser() throws Throwable {
driver.navigate().to("http://localhost:7890/TestMe/login.html");
}
@When("^I open Login website$")
public void i_open_Login_website() throws Throwable {
System.out.println("I Opended");
}
@Then("^Login button should exits$")
public void login_button_should_exits() throws Throwable {
if(driver.findElement(By.id("submit")).isEnabled()) {
System.out.println("Test 1 Pass");
} else {
System.out.println("Test 1 Fail");
}
driver.close();
}
}