-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testbench-api for board, fixes DASH-104 (#65)
* Add testbench-api for board, fixes DASH-104 Add plugin repository to precompiled module
- Loading branch information
Showing
13 changed files
with
205 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>vaadin-board-root</artifactId> | ||
<groupId>com.vaadin.board</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>vaadin-board-testbench-api</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>vaadin-testbench-api</artifactId> | ||
<version>${vaadin.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>license-maven-plugin</artifactId> | ||
<configuration> | ||
<licenseName>cval3</licenseName> | ||
<licenseResolver>file://${basedir}/src/license</licenseResolver> | ||
<includes> | ||
<include>**/main/**/*.java</include> | ||
</includes> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>2.9</version> | ||
<executions> | ||
<execution> | ||
<id>attach-javadoc</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<version>2.2.1</version> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
69 changes: 69 additions & 0 deletions
69
testbench-api/src/main/java/com/vaadin/board/elements/BoardElement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package com.vaadin.board.elements; | ||
|
||
/* | ||
* #%L | ||
* Vaadin Spreadsheet Testbench API | ||
* %% | ||
* Copyright (C) 2013 - 2016 Vaadin Ltd | ||
* %% | ||
* This program is available under Commercial Vaadin Add-On License 3.0 | ||
* (CVALv3). | ||
* | ||
* See the file license.html distributed with this software for more | ||
* information about licensing. | ||
* | ||
* You should have received a copy of the CVALv3 along with this program. | ||
* If not, see <http://vaadin.com/license/cval-3>. | ||
* #L% | ||
*/ | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.NoSuchElementException; | ||
import org.openqa.selenium.WebElement; | ||
|
||
import com.vaadin.testbench.TestBenchElement; | ||
import com.vaadin.testbench.elements.AbstractComponentElement; | ||
import com.vaadin.testbench.elementsbase.ServerClass; | ||
|
||
/** | ||
* This is the base element class for accessing a Vaadin Board component | ||
* for TestBench testing. | ||
* | ||
* @author Vaadin Ltd. | ||
*/ | ||
@ServerClass("com.vaadin.board.Board") | ||
public class BoardElement extends AbstractComponentElement { | ||
|
||
/** | ||
* Gets the row header element at the given index. | ||
* | ||
* @param rowIndex | ||
* Index of target row, 0-based | ||
* @return Row at the given index | ||
*/ | ||
public RowElement getRow(int rowIndex) { | ||
List<RowElement> rows = getRows(); | ||
if (rows != null && rows.size() > rowIndex) { | ||
return rows.get(rowIndex); | ||
} | ||
throw new NoSuchElementException( | ||
String.format("There is no row with the index %d in the current board", rowIndex)); | ||
} | ||
|
||
/** | ||
* Gets all rows from the board. Inner rows are not included. | ||
* | ||
* @return Row elements | ||
*/ | ||
public List<RowElement> getRows() { | ||
List<WebElement> elements = findElements(By.xpath("./vaadin-board-row")); | ||
List<RowElement> rElements = new ArrayList<RowElement>(); | ||
for (TestBenchElement elem : wrapElements(elements, getCommandExecutor())) { | ||
rElements.add(elem.wrap(RowElement.class)); | ||
} | ||
return rElements; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
testbench-api/src/main/java/com/vaadin/board/elements/RowElement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.vaadin.board.elements; | ||
|
||
/* | ||
* #%L | ||
* Vaadin Spreadsheet Testbench API | ||
* %% | ||
* Copyright (C) 2013 - 2016 Vaadin Ltd | ||
* %% | ||
* This program is available under Commercial Vaadin Add-On License 3.0 | ||
* (CVALv3). | ||
* | ||
* See the file license.html distributed with this software for more | ||
* information about licensing. | ||
* | ||
* You should have received a copy of the CVALv3 along with this program. | ||
* If not, see <http://vaadin.com/license/cval-3>. | ||
* #L% | ||
*/ | ||
|
||
import com.vaadin.testbench.elements.AbstractComponentContainerElement; | ||
import com.vaadin.testbench.elementsbase.ServerClass; | ||
|
||
/** | ||
* This class represents one row inside the Vaadin Board. | ||
* | ||
* @author Vaadin Ltd. | ||
*/ | ||
@ServerClass("com.vaadin.board.Row") | ||
public class RowElement extends AbstractComponentContainerElement { | ||
} |