Group testing modules (#3014)
* move security content from spring-security-rest-full * swagger update * move query language to new module * rename spring-security-rest-full to spring-rest-full * group persistence modules * group testing modules * try fix conflict
This commit is contained in:
committed by
GitHub
parent
b383d83bf4
commit
776a01429e
@@ -0,0 +1,50 @@
|
||||
package test.java.com.baeldung.selenium.junit;
|
||||
|
||||
import main.java.com.baeldung.selenium.config.SeleniumConfig;
|
||||
import main.java.com.baeldung.selenium.models.BaeldungAbout;
|
||||
import main.java.com.baeldung.selenium.pages.BaeldungHomePage;
|
||||
import main.java.com.baeldung.selenium.pages.StartHerePage;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
|
||||
public class SeleniumPageObjectLiveTest {
|
||||
|
||||
private SeleniumConfig config;
|
||||
private BaeldungHomePage homePage;
|
||||
private BaeldungAbout about;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
config = new SeleniumConfig();
|
||||
homePage = new BaeldungHomePage(config);
|
||||
about = new BaeldungAbout(config);
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
config.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenHomePage_whenNavigate_thenTitleMatch() {
|
||||
homePage.navigate();
|
||||
assertThat(homePage.getPageTitle(), is("Baeldung"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenHomePage_whenNavigate_thenShouldBeInStartHere() {
|
||||
homePage.navigate();
|
||||
StartHerePage startHerePage = homePage.clickOnStartHere();
|
||||
assertThat(startHerePage.getPageTitle(), is("Start Here"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenAboutPage_whenNavigate_thenTitleMatch() {
|
||||
about.navigateTo();
|
||||
assertThat(about.getPageTitle(), is("About Baeldung"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package test.java.com.baeldung.selenium.junit;
|
||||
|
||||
import main.java.com.baeldung.selenium.SeleniumExample;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.testng.Assert.*;
|
||||
|
||||
public class SeleniumWithJUnitLiveTest {
|
||||
|
||||
private static SeleniumExample seleniumExample;
|
||||
private String expectedTitle = "Baeldung | Java, Spring and Web Development tutorials";
|
||||
|
||||
@BeforeClass
|
||||
public static void setUp() {
|
||||
seleniumExample = new SeleniumExample();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDown() {
|
||||
seleniumExample.closeWindow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenAboutBaeldungIsLoaded_thenAboutEugenIsMentionedOnPage() {
|
||||
seleniumExample.getAboutBaeldungPage();
|
||||
String actualTitle = seleniumExample.getTitle();
|
||||
assertNotNull(actualTitle);
|
||||
assertEquals(expectedTitle, actualTitle);
|
||||
assertTrue(seleniumExample.isAuthorInformationAvailable());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package test.java.com.baeldung.selenium.testng;
|
||||
|
||||
import main.java.com.baeldung.selenium.SeleniumExample;
|
||||
import org.testng.annotations.AfterSuite;
|
||||
import org.testng.annotations.BeforeSuite;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import static org.testng.Assert.*;
|
||||
|
||||
public class SeleniumWithTestNGLiveTest {
|
||||
|
||||
private SeleniumExample seleniumExample;
|
||||
private String expectedTitle = "Baeldung | Java, Spring and Web Development tutorials";
|
||||
|
||||
@BeforeSuite
|
||||
public void setUp() {
|
||||
seleniumExample = new SeleniumExample();
|
||||
}
|
||||
|
||||
@AfterSuite
|
||||
public void tearDown() {
|
||||
seleniumExample.closeWindow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenAboutBaeldungIsLoaded_thenAboutEugenIsMentionedOnPage() {
|
||||
seleniumExample.getAboutBaeldungPage();
|
||||
String actualTitle = seleniumExample.getTitle();
|
||||
assertNotNull(actualTitle);
|
||||
assertEquals(expectedTitle, actualTitle);
|
||||
assertTrue(seleniumExample.isAuthorInformationAvailable());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user