summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorSun Zhe <31067185+ZheSun88@users.noreply.github.com>2018-12-20 17:00:57 +0200
committerGitHub <noreply@github.com>2018-12-20 17:00:57 +0200
commit0cfbee6ed5663d928a31def30d111733eae93731 (patch)
tree0737483b3ca66322f9c7f4a06c2824c2d00bd26e /uitest
parent353ba29cfdefddb032122cbeae5f02f6d9de76ba (diff)
downloadvaadin-framework-0cfbee6ed5663d928a31def30d111733eae93731.tar.gz
vaadin-framework-0cfbee6ed5663d928a31def30d111733eae93731.zip
Update release note and since tag (#11386)
* Some formatting changes
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxLabelInputElement.java3
-rwxr-xr-xuitest/src/main/java/com/vaadin/tests/components/grid/GridEditorScrollSync.java12
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/FocusShortcutsTest.java4
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/checkbox/CheckboxLabelInputElementTest.java45
-rwxr-xr-xuitest/src/test/java/com/vaadin/tests/components/grid/GridEditorScrollSyncTest.java19
5 files changed, 52 insertions, 31 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxLabelInputElement.java b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxLabelInputElement.java
index 248f214d1b..acdb88b32a 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxLabelInputElement.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckboxLabelInputElement.java
@@ -8,7 +8,8 @@ public class CheckboxLabelInputElement extends AbstractTestUIWithLog {
@Override
protected void setup(VaadinRequest request) {
- final CheckBox cb = new CheckBox("Test custom style names for inner elements", true);
+ final CheckBox cb = new CheckBox(
+ "Test custom style names for inner elements", true);
cb.getInputElement().addStyleName("my-input-class");
cb.getLabelElement().addStyleName("my-label-class");
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorScrollSync.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorScrollSync.java
index 2d93403926..661e23dd21 100755
--- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorScrollSync.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridEditorScrollSync.java
@@ -1,7 +1,9 @@
package com.vaadin.tests.components.grid;
+
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.v7.ui.Grid;
+
public class GridEditorScrollSync extends AbstractTestUI {
@Override
protected void setup(VaadinRequest request) {
@@ -23,13 +25,13 @@ public class GridEditorScrollSync extends AbstractTestUI {
grid.setWidth("450px");
// Add some data rows
grid.addRow("Nicolaus Copernicus", 1543, "Nicolaus Copernicus", 1543,
- "Nicolaus Copernicus", 1543, "Nicolaus Copernicus", 1543,
- "Nicolaus Copernicus", 1543);
+ "Nicolaus Copernicus", 1543, "Nicolaus Copernicus", 1543,
+ "Nicolaus Copernicus", 1543);
grid.addRow("Galileo Galilei", 1564, "Galileo Galilei", 1564,
- "Galileo Galilei", 1564, "s", 55, "Nicolaus Copernicus", 1543);
+ "Galileo Galilei", 1564, "s", 55, "Nicolaus Copernicus", 1543);
grid.addRow("Johannes Kepler", 1571, "Johannes Kepler", 1571,
- "Johannes Kepler", 1571, "Nicolaus Copernicus", 1543,
- "Nicolaus Copernicus", 1543);
+ "Johannes Kepler", 1571, "Nicolaus Copernicus", 1543,
+ "Nicolaus Copernicus", 1543);
getLayout().addComponent(grid);
}
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/FocusShortcutsTest.java b/uitest/src/test/java/com/vaadin/tests/components/FocusShortcutsTest.java
index e67b8d3240..92ba65d043 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/FocusShortcutsTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/FocusShortcutsTest.java
@@ -7,7 +7,6 @@ import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
-import com.vaadin.testbench.elements.TextFieldElement;
import com.vaadin.tests.tb3.SingleBrowserTest;
public class FocusShortcutsTest extends SingleBrowserTest {
@@ -35,7 +34,8 @@ public class FocusShortcutsTest extends SingleBrowserTest {
actions = new Actions(getDriver());
actions.keyDown(body, Keys.LEFT_CONTROL).keyDown(body, Keys.LEFT_SHIFT)
- .sendKeys("d").keyUp(Keys.LEFT_CONTROL).keyUp(Keys.LEFT_SHIFT).build().perform();
+ .sendKeys("d").keyUp(Keys.LEFT_CONTROL).keyUp(Keys.LEFT_SHIFT)
+ .build().perform();
Assert.assertEquals("3. Ctrl+Shift+D", getLogRow(0));
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/checkbox/CheckboxLabelInputElementTest.java b/uitest/src/test/java/com/vaadin/tests/components/checkbox/CheckboxLabelInputElementTest.java
index 16ac7ee1fc..7b83ecc120 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/checkbox/CheckboxLabelInputElementTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/checkbox/CheckboxLabelInputElementTest.java
@@ -1,14 +1,15 @@
package com.vaadin.tests.components.checkbox;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.CheckBoxElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
-import org.junit.Test;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
public class CheckboxLabelInputElementTest extends MultiBrowserTest {
@@ -21,24 +22,34 @@ public class CheckboxLabelInputElementTest extends MultiBrowserTest {
assertEquals("my-label-class", labelElem.getAttribute("class"));
assertEquals("my-input-class", inputElem.getAttribute("class"));
- assertTrue("The Checkbox Widget should not contain the classes that are " +
- "defined as style names for the input or label.",
- !checkBoxElement.getAttribute("class").contains("my-label-class") &&
- !checkBoxElement.getAttribute("class").contains("my-input-class"));
+ assertTrue(
+ "The Checkbox Widget should not contain the classes that are "
+ + "defined as style names for the input or label.",
+ !checkBoxElement.getAttribute("class")
+ .contains("my-label-class")
+ && !checkBoxElement.getAttribute("class")
+ .contains("my-input-class"));
$(ButtonElement.class).caption("add-style").first().click();
- assertEquals("my-label-class later-applied-label-class", labelElem.getAttribute("class"));
- assertEquals("my-input-class later-applied-input-class", inputElem.getAttribute("class"));
- assertTrue("The Checkbox Widget should not contain the classes that are " +
- "defined as style names for the input or label.",
- !checkBoxElement.getAttribute("class").contains("later-applied-label-class") &&
- !checkBoxElement.getAttribute("class").contains("later-applied-input-class"));
+ assertEquals("my-label-class later-applied-label-class",
+ labelElem.getAttribute("class"));
+ assertEquals("my-input-class later-applied-input-class",
+ inputElem.getAttribute("class"));
+ assertTrue(
+ "The Checkbox Widget should not contain the classes that are "
+ + "defined as style names for the input or label.",
+ !checkBoxElement.getAttribute("class")
+ .contains("later-applied-label-class")
+ && !checkBoxElement.getAttribute("class")
+ .contains("later-applied-input-class"));
$(ButtonElement.class).caption("remove-style").first().click();
- assertEquals("later-applied-label-class", labelElem.getAttribute("class"));
- assertEquals("later-applied-input-class", inputElem.getAttribute("class"));
+ assertEquals("later-applied-label-class",
+ labelElem.getAttribute("class"));
+ assertEquals("later-applied-input-class",
+ inputElem.getAttribute("class"));
$(ButtonElement.class).caption("remove-style-2").first().click();
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorScrollSyncTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorScrollSyncTest.java
index 33297bdbf9..9c0c7360ee 100755
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorScrollSyncTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridEditorScrollSyncTest.java
@@ -1,33 +1,40 @@
package com.vaadin.tests.components.grid;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.number.IsCloseTo.closeTo;
+
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
+
import com.vaadin.testbench.TestBenchElement;
import com.vaadin.testbench.elements.GridElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.number.IsCloseTo.closeTo;
+
public class GridEditorScrollSyncTest extends MultiBrowserTest {
private GridElement grid;
+
@Test
public void testScrollAndEdit() {
openTestURL();
grid = $(GridElement.class).first();
((TestBenchElement) grid
- .findElement(By.className("v-grid-scroller-horizontal")))
- .scrollLeft(300);
+ .findElement(By.className("v-grid-scroller-horizontal")))
+ .scrollLeft(300);
openEditor();
GridElement.GridCellElement rowCell = grid.getCell(1, 6);
TestBenchElement editorField = grid.getEditor().getField(6);
assertPosition(rowCell.getLocation().getX(),
- editorField.getWrappedElement().getLocation().getX());
+ editorField.getWrappedElement().getLocation().getX());
}
+
private GridElement openEditor() {
grid.getCell(0, 6).doubleClick();
Assert.assertTrue("Grid editor should be displayed.",
- grid.getEditor().isDisplayed());
+ grid.getEditor().isDisplayed());
return grid;
}
+
private void assertPosition(double expected, double actual) {
// 1px leeway for calculations
assertThat("Unexpected position.", expected, closeTo(actual, 1d));