Search in sources :

Example 6 with HomePage

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

the class SecurityTests method logInViewsHomePage.

@Test
public void logInViewsHomePage() {
    LoginPage loginPage = LoginPage.go(this.driver);
    HomePage homePage = loginPage.login("user", "password");
    homePage.assertAt();
    WebElement username = homePage.getDriver().findElement(By.id("un"));
    assertThat(username.getText()).isEqualTo("user");
    Set<Cookie> cookies = homePage.getDriver().manage().getCookies();
    assertThat(cookies).extracting("name").contains("SESSION");
    assertThat(cookies).extracting("name").doesNotContain("JSESSIONID");
}
Also used : Cookie(org.openqa.selenium.Cookie) HomePage(sample.pages.HomePage) WebElement(org.openqa.selenium.WebElement) LoginPage(sample.pages.LoginPage) Test(org.junit.Test)

Example 7 with HomePage

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

the class AttributeTests method home.

@Test
public void home() {
    HomePage home = HomePage.go(this.driver);
    home.assertAt();
}
Also used : HomePage(sample.pages.HomePage) Test(org.junit.Test)

Example 8 with HomePage

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

the class HazelcastSpringTests method login.

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

Example 9 with HomePage

use of sample.pages.HomePage 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 10 with HomePage

use of sample.pages.HomePage 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)

Aggregations

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