
diff --git a/src/test/java/integration/MainPageIT.java b/src/test/java/integration/MainPageIT.java
new file mode 100644
index 000000000..4c3f2701b
--- /dev/null
+++ b/src/test/java/integration/MainPageIT.java
@@ -0,0 +1,45 @@
+package integration;
+
+import static org.junit.Assert.assertEquals;
+
+import java.net.MalformedURLException;
+
+import org.junit.After;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+
+public class MainPageIT {
+
+ private SeleniumConfig config;
+ private String url = "http://app-petclinic-dev.apps.cluster-ottawa-630b.ottawa-630b.example.opentlc.com/";
+
+ public MainPageIT() throws MalformedURLException {
+ config = new SeleniumConfig();
+ }
+
+ public String getTitle() {
+ return this.config.getDriver().getTitle();
+ }
+
+ @After
+ public void closeConnection() {
+ config.getDriver().quit();
+ }
+
+ @Test
+ public void googleTitleIT() {
+ WebDriver driver = config.getDriver();
+ driver.get(url);
+ assertEquals("Title not as expected: ", "PetClinic :: a Spring Framework demonstration", getTitle());
+ // Save the random value from the page.
+ String welcomeText = driver.findElement(By.id("welcome")).getText();
+ // Reload the page and get a new random value.
+ driver.get(url);
+ String value2 = driver.findElement(By.id("random-value")).getText();
+ // Values should not be the same.
+ assertEquals("Wrong welcome text.", "Welcome to the Pet Clinic!", welcomeText);
+ System.out.println("Text extracted: " + welcomeText);
+ }
+
+}
diff --git a/src/test/java/integration/SeleniumConfig.java b/src/test/java/integration/SeleniumConfig.java
new file mode 100644
index 000000000..4c8c80b80
--- /dev/null
+++ b/src/test/java/integration/SeleniumConfig.java
@@ -0,0 +1,26 @@
+package integration;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.concurrent.TimeUnit;
+
+import org.openqa.selenium.Capabilities;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.firefox.FirefoxOptions;
+import org.openqa.selenium.remote.RemoteWebDriver;
+
+public class SeleniumConfig {
+ private WebDriver driver;
+
+ public SeleniumConfig() throws MalformedURLException {
+ Capabilities capabilities = new FirefoxOptions();
+ driver = new RemoteWebDriver(
+ new URL("http://selenium-hub-cicd.apps.cluster-ottawa-630b.ottawa-630b.example.opentlc.com/wd/hub"),
+ capabilities);
+ driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
+ }
+
+ public WebDriver getDriver() {
+ return driver;
+ }
+}