Search in sources :

Example 11 with LoginPage

use of sample.pages.LoginPage in project spring-session by spring-projects.

the class HttpRedisJsonTest method createAttribute.

@Test
public void createAttribute() {
    LoginPage login = HomePage.go(this.driver, LoginPage.class);
    HomePage home = login.form().login(HomePage.class);
    // @formatter:off
    home = home.form().attributeName("Demo Key").attributeValue("Demo Value").submit(HomePage.class);
    // @formatter:on
    List<Attribute> attributes = home.attributes();
    assertThat(attributes).extracting("attributeName").contains("Demo Key");
    assertThat(attributes).extracting("attributeValue").contains("Demo Value");
}
Also used : HomePage(sample.pages.HomePage) Attribute(sample.pages.HomePage.Attribute) LoginPage(sample.pages.LoginPage) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 12 with LoginPage

use of sample.pages.LoginPage in project spring-session by spring-projects.

the class HttpRedisJsonTest method goHomeRedirectLoginPage.

@Test
public void goHomeRedirectLoginPage() {
    LoginPage login = HomePage.go(this.driver, LoginPage.class);
    login.assertAt();
}
Also used : LoginPage(sample.pages.LoginPage) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 13 with LoginPage

use of sample.pages.LoginPage in project spring-session by spring-projects.

the class BootTests method login.

@Test
public void login() {
    LoginPage login = HomePage.go(this.driver);
    HomePage home = login.form().login(HomePage.class);
    home.assertAt();
    home.containCookie("SESSION");
    home.doesNotContainCookie("JSESSIONID");
}
Also used : HomePage(sample.pages.HomePage) LoginPage(sample.pages.LoginPage) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 14 with LoginPage

use of sample.pages.LoginPage in project spring-session by spring-projects.

the class SecurityTests method loggedOutUserSentToLoginPage.

@Test
public void loggedOutUserSentToLoginPage() {
    LoginPage loginPage = LoginPage.go(this.driver);
    HomePage homePage = loginPage.login("user", "password");
    homePage.logout();
    HomePage backHomePage = HomePage.go(this.driver);
    LoginPage backLoginPage = backHomePage.unauthenticated();
    backLoginPage.assertAt();
}
Also used : HomePage(sample.pages.HomePage) LoginPage(sample.pages.LoginPage) Test(org.junit.Test)

Example 15 with LoginPage

use of sample.pages.LoginPage in project spring-session by spring-projects.

the class SecurityTests method logOutSuccess.

@Test
public void logOutSuccess() {
    LoginPage loginPage = LoginPage.go(this.driver);
    HomePage homePage = loginPage.login("user", "password");
    LoginPage successLogoutPage = homePage.logout();
    successLogoutPage.assertAt();
}
Also used : HomePage(sample.pages.HomePage) LoginPage(sample.pages.LoginPage) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)15 LoginPage (sample.pages.LoginPage)15 HomePage (sample.pages.HomePage)10 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)9 Cookie (org.openqa.selenium.Cookie)1 WebElement (org.openqa.selenium.WebElement)1 Attribute (sample.pages.HomePage.Attribute)1