4 import lombok.extern.slf4j.Slf4j;
5 import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
6 import org.junit.jupiter.api.BeforeEach;
7 import org.junit.jupiter.api.Test;
8 import org.junit.jupiter.api.extension.ExtendWith;
9 import org.openqa.selenium.By;
10 import org.openqa.selenium.WebElement;
11 import org.openqa.selenium.remote.RemoteWebDriver;
12 import org.springframework.boot.test.context.SpringBootTest;
13 import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
14 import org.springframework.boot.web.server.LocalServerPort;
18 * Integration-Test for the {@link DemoController}.
21 @SpringBootTest(webEnvironment = RANDOM_PORT)
22 @ExtendWith(WebDriverExtension.class)
24 public class DemoControllerIT
32 void generateBaseUri()
34 baseUri = "http://localhost:" + port;
39 void testSubmit(RemoteWebDriver driver)
41 driver.get(baseUri + "/");
43 WebElement submit = driver.findElement(By.xpath("//*[@class=\"card-footer\"]/button"));
44 assertThat(submit).isNotNull();