import org.fluentlenium.adapter.FluentTest;
import org.junit.ClassRule;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

import static org.fluentlenium.core.filter.FilterConstructor.*;
import static org.assertj.core.api.Assertions.assertThat;

public class IntegrationTest extends FluentTest {
  public WebDriver webDriver = new HtmlUnitDriver();

  @Override
  public WebDriver getDefaultDriver() {
    return webDriver;
  }

  @ClassRule
  public static ServerRule server = new ServerRule();

  @Test
  public void rootTest() {
      goTo("http://localhost:4567/");
      assertThat(pageSource()).contains("Dictionary");
  }

  @Test
  public void addAWordPage() {
      goTo("http://localhost:4567/");
      click("a", withText("Add a Word"));
      assertThat(pageSource()).contains("add your own word");
  }

  @Test
  public void addsWordsSuccessfully() {
      goTo("http://localhost:4567/new");
      fill("#userword").with("expeditious");
      submit(".btn");
      assertThat(pageSource()).contains("expeditious");
  }

  @Test
  public void individualWordPage() {
      goTo("http://localhost:4567/new");
      fill("#userword").with("expeditious");
      submit(".btn");
      click("a", withText("expeditious"));
      assertThat(pageSource()).contains("define this word");
  }

  @Test
  public void addsDefinitionsSuccessfully() {
      goTo("http://localhost:4567/new");
      fill("#userword").with("baton");
      submit(".btn");
      click("a", withText("baton"));
      fill("#userdefinition").with("a kind of stick");
      fill("#userexample").with("the marshal had a baton");
      submit(".btn");
      assertThat(pageSource()).contains("the marshal had a baton");
  }

  @Test
  public void addsMultipleDefinitions() {
      goTo("http://localhost:4567/new");
      fill("#userword").with("baton");
      submit(".btn");
      click("a", withText("baton"));
      fill("#userdefinition").with("a kind of stick");
      fill("#userexample").with("the marshal had a baton");
      submit(".btn");
      fill("#userdefinition").with("a thing you toss");
      fill("#userexample").with("she twirled the baton");
      assertThat(pageSource()).contains("she twirled the baton");
  }
}

@@ -790,16 +790,18 @@
 thText(%22
++ 
 Add a Wo
@@ -803,24 +803,24 @@
  a Word%22));%0A
-
       assert
@@ -1018,32 +1018,89 @@
     submit(%22.btn
+-warning%22);%0A      goTo(%22http://localhost:4567/expeditious
 %22);%0A      assert
@@ -1289,32 +1289,40 @@
     submit(%22.btn
+-warning
 %22);%0A      click(
@@ -1315,37 +1315,44 @@
 ;%0A      
-click(%22a%22, withText(%22
+goTo(%22http://localhost:4567/
 expediti
@@ -1356,17 +1356,16 @@
 itious%22)
-)
 ;%0A      
@@ -1568,32 +1568,78 @@
     submit(%22.btn
+-warning%22);%0A      goTo(%22http://localhost:4567/
 %22);%0A      click(
@@ -1788,32 +1788,83 @@
     submit(%22.btn
+-warning%22);%0A      goTo(%22http://localhost:4567/baton
 %22);%0A      assert
@@ -2064,32 +2064,40 @@
     submit(%22.btn
+-warning
 %22);%0A      click(
@@ -2228,32 +2228,32 @@
  had a baton%22);%0A
-
       submit(%22.b
@@ -2254,16 +2254,24 @@
 it(%22.btn
+-warning
 %22);%0A    

Update integration tests to reflect changes in styling