Skip to content

Commit

Permalink
Getting started with Vaadin TestBench Maven project
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesh2 committed Jun 23, 2016
1 parent 80e2587 commit f937efa
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 165 deletions.
68 changes: 0 additions & 68 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,6 @@
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- The Jetty plugin allows us to easily test the development build
by running jetty:run on the command line. -->
<plugin>
Expand All @@ -177,67 +164,12 @@
<version>${jetty.plugin.version}</version>
<configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
<stopKey>STOP</stopKey>
<stopPort>${jetty.stop.port}</stopPort>
<httpConnector>
<port>${test.port}</port>
</httpConnector>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
<configuration>

</configuration>
</execution>
</executions>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>

<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<test.port>8080</test.port>
<jetty.stop.port>8081</jetty.stop.port>
<test.headless>false</test.headless>
<test.hostname>localhost</test.hostname>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<test.port>8080</test.port>
<jetty.stop.port>8081</jetty.stop.port>
<test.headless>true</test.headless>
<test.hostname>localhost</test.hostname>
</properties>
</profile>
<profile>
<!-- Vaadin pre-release repositories -->
<id>vaadin-prerelease</id>
Expand Down
59 changes: 0 additions & 59 deletions src/test/java/my/vaadin/app/test/DriverUtil.java

This file was deleted.

34 changes: 0 additions & 34 deletions src/test/java/my/vaadin/app/test/MyFirstIT.java

This file was deleted.

38 changes: 38 additions & 0 deletions src/test/java/my/vaadin/app/test/MyFirstUITest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package my.vaadin.app.test;

import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import com.vaadin.testbench.TestBenchTestCase;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.TextFieldElement;

@RunWith(BlockJUnit4ClassRunner.class)
public class MyFirstUITest extends TestBenchTestCase {

private WebDriver driver;

@Before
public void setup() {
setDriver(driver = new FirefoxDriver());
}

@Test
public void testMyStuff() {
driver.get("http://localhost:8080");
$(ButtonElement.class).caption("Add new customer").first().click();
assertTrue($(TextFieldElement.class).caption("Email").exists());
}

@After
public void teardown() {
driver.close();
}
}
4 changes: 0 additions & 4 deletions src/test/resources/config.properties

This file was deleted.

0 comments on commit f937efa

Please sign in to comment.