Some element methods have been integrated into TestBench and are removed from the
framework element classes
Change-Id: I35c8bf272b7603127816595de8145e68500e22e5
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench</artifactId>
- <version>4.0.3</version>
+ <version>4.1.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
public class ProgressBarElement
extends com.vaadin.testbench.elements.ProgressBarElement {
+ @Override
public double getValue() {
WebElement indicator = findElement(
By.className("v-progressbar-indicator"));
return Double.parseDouble(width.replace("%", "")) / 100.0;
}
- /**
- * @since 7.5.6
- * @param indicator
- * @param string
- * @return
- */
- private String getStyleAttribute(WebElement element, String styleName) {
- String style = element.getAttribute("style");
- String[] styles = style.split(";");
- for (String s : styles) {
- if (s.startsWith(styleName + ":")) {
- return s.substring(styleName.length() + 1).trim();
- }
- }
-
- return null;
- }
-
}
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
-import com.vaadin.testbench.elementsbase.AbstractElement;
import com.vaadin.testbench.elementsbase.ServerClass;
@ServerClass("com.vaadin.ui.Table")
return findElement(By.className("v-table-column-selector"));
}
- public static class ContextMenuElement extends AbstractElement {
-
- public WebElement getItem(int index) {
- return findElement(
- By.xpath(".//table//tr[" + (index + 1) + "]//td/*"));
- }
-
- }
-
- public ContextMenuElement getContextMenu() {
- WebElement cm = getDriver().findElement(By.className("v-contextmenu"));
- return wrapElement(cm, getCommandExecutor())
- .wrap(ContextMenuElement.class);
- }
-
}
private final String maximizeBoxClass = "v-window-maximizebox";
private final String closeBoxClass = "v-window-closebox";
+ @Override
public void restore() {
if (isMaximized()) {
getRestoreButton().click();
}
}
- private boolean isMaximized() {
- return isElementPresent(By.className(restoreBoxClass));
- }
-
private WebElement getRestoreButton() {
return findElement(By.className("v-window-restorebox"));
}
+ @Override
public void maximize() {
if (!isMaximized()) {
getMaximizeButton().click();
return findElement(By.className(closeBoxClass));
}
+ @Override
public void close() {
getCloseButton().click();
<dependency org="org.hsqldb" name="hsqldb" rev="2.2.6"
conf="build -> default" />
<dependency org="com.vaadin" name="vaadin-testbench"
- rev="4.0.3" conf="build-provided -> default" />
+ rev="4.1.0" conf="build-provided -> default" />
<!-- This should be removed once tests have been updated to use lang3 -->
<dependency org="commons-lang" name="commons-lang"
rev="2.6" conf="build -> default" />
import com.vaadin.testbench.TestBenchElement;
import com.vaadin.testbench.customelements.TableElement;
-import com.vaadin.testbench.customelements.TableElement.ContextMenuElement;
import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.TableElement.ContextMenuElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
public class ColumnCollapsingAndColumnExpansionTest extends MultiBrowserTest {