BAEL 298 | Intro to Selenium with JUnit / TestNg

This commit is contained in:
Sandeep Kumar
2016-08-30 22:04:37 +05:30
parent ae907114c7
commit 2310cf8717
4 changed files with 125 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package test.java.com.baeldung.selenium.junit;
import static org.testng.Assert.assertEquals;
import main.java.com.baeldung.selenium.SeleniumExample;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class TestSeleniumWithJUnit {
private SeleniumExample seleniumExample;
@Before
public void setUp() {
seleniumExample = new SeleniumExample();
}
@After
public void tearDown() {
seleniumExample.closeWindow();
}
@Test
public void whenPageIsLoaded_thenTitleIsAsPerExpectation() {
String expectedTitle = seleniumExample.getExpectedTitle();
String actualTitle = seleniumExample.getActualTitle();
assertEquals(actualTitle, expectedTitle);
}
}