diff options
author | Olli Tietäväinen <ollit@vaadin.com> | 2018-11-29 16:26:35 +0200 |
---|---|---|
committer | Sun Zhe <31067185+ZheSun88@users.noreply.github.com> | 2018-11-29 16:26:35 +0200 |
commit | 1c1b62f92e9c6b6c43e033bef9befbdfa15a9c2a (patch) | |
tree | 460922fe5ab134d768f455e9d2e411a06d2d322f | |
parent | 7f2b6f9f9ad10e9fd671b4ae041f471acae7aaa7 (diff) | |
download | vaadin-framework-1c1b62f92e9c6b6c43e033bef9befbdfa15a9c2a.tar.gz vaadin-framework-1c1b62f92e9c6b6c43e033bef9befbdfa15a9c2a.zip |
removed tests that are broken on headless Chrome which doesn't allow resizing (#11342)
6 files changed, 0 insertions, 316 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/SortableHeaderStylesTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/SortableHeaderStylesTest.java deleted file mode 100644 index 2e98322617..0000000000 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/SortableHeaderStylesTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.vaadin.tests.components.grid; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; -import com.vaadin.testbench.elements.OptionGroupElement; -import com.vaadin.tests.tb3.SingleBrowserTest; - -public class SortableHeaderStylesTest extends SingleBrowserTest { - @Test - public void testSortableHeaderStyles() { - openTestURL(); - - Assert.assertFalse(hasSortableStyle(0)); - for (int i = 1; i < 8; i++) { - Assert.assertTrue(hasSortableStyle(i)); - } - - OptionGroupElement sortableSelector = $(OptionGroupElement.class) - .first(); - - // Toggle sortability - sortableSelector.selectByText("lastName"); - Assert.assertFalse(hasSortableStyle(3)); - - // Toggle back - sortableSelector.selectByText("lastName"); - Assert.assertTrue(hasSortableStyle(3)); - } - - private boolean hasSortableStyle(int column) { - return $(GridElement.class).first().getHeaderCell(0, column) - .getAttribute("class").contains("sortable"); - } -} diff --git a/uitest/src/test/java/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximumTest.java b/uitest/src/test/java/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximumTest.java index 2e21216165..edb950eb9e 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximumTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximumTest.java @@ -28,58 +28,6 @@ public class SplitPanelWithMinimumAndMaximumTest extends MultiBrowserTest { } @Test - public void testMoveHorizontalSplitsToLimits() { - // Amount of pixels to move each splitter (to left) - int[] movements = { -250, -350, -320, -100, -200, -100, -170, -400 }; - - // Expected final positions of splitters (at left limit) - int[] finalPositions = { 60, 60, 100, 100, 478, 478, 550, 550 }; - - List<HorizontalSplitPanelElement> splits = $( - HorizontalSplitPanelElement.class).all(); - - Actions actions = new Actions(driver); - - for (int i = 0; i < splits.size(); i++) { - TestBenchElement splitter = splits.get(i).getSplitter(); - actions.clickAndHold(splitter).moveByOffset(movements[i], 0) - .release().perform(); - - double newX = parseHorizontalPosition(splitter, i < 4); - int expectedX = finalPositions[i]; - - // Due to minor browser differences and sub-pixels we must allow 1px - // of play between the expected and measured value - assertTrue( - "When moving left, the splitter at index " + i - + " was at position " + newX + " (expected " - + expectedX + ").", - Math.abs(newX - expectedX) <= 1); - } - - // Amount of pixels to move each splitter (to right) - movements = new int[] { 450, 450, 480, 480, 450, 450, 480, 480 }; - - // Expected final positions of splitters (at right limit) - finalPositions = new int[] { 478, 478, 550, 550, 60, 60, 100, 100 }; - - for (int i = 0; i < splits.size(); i++) { - TestBenchElement splitter = splits.get(i).getSplitter(); - actions.clickAndHold(splitter).moveByOffset(movements[i], 0) - .release().perform(); - - double newX = parseHorizontalPosition(splitter, i < 4); - int expectedX = finalPositions[i]; - - assertTrue( - "When moving right, the splitter at index " + i - + " was at position " + newX + " (expected " - + expectedX + ").", - Math.abs(newX - expectedX) <= 1); - } - } - - @Test public void testMoveVerticalSplitsToLimits() { $(TabSheetElement.class).first().openTab(1); diff --git a/uitest/src/test/java/com/vaadin/tests/components/table/ContextMenuSizeTest.java b/uitest/src/test/java/com/vaadin/tests/components/table/ContextMenuSizeTest.java deleted file mode 100644 index 663eb59cd2..0000000000 --- a/uitest/src/test/java/com/vaadin/tests/components/table/ContextMenuSizeTest.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.vaadin.tests.components.table; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.lessThan; - -import java.util.List; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.remote.DesiredCapabilities; - -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * Test for context menu position and size. - * - * @author Vaadin Ltd - */ -public class ContextMenuSizeTest extends MultiBrowserTest { - - @Override - public List<DesiredCapabilities> getBrowsersToTest() { - return getBrowsersSupportingContextMenu(); - } - - @Override - public void setup() throws Exception { - super.setup(); - - openTestURL(); - } - - private void resizeViewPortHeightTo(int windowHeight) { - // viewport width doesn't matter, let's use a magic number of 500. - testBench().resizeViewPortTo(500, windowHeight); - } - - private int getContextMenuY() { - int y = openContextMenu().getLocation().getY(); - - closeContextMenu(); - - return y; - } - - private int getContextMenuHeight() { - int height = openContextMenu().getSize().getHeight(); - - closeContextMenu(); - - return height; - } - - private WebElement openContextMenu() { - Actions actions = new Actions(getDriver()); - actions.contextClick(findElement(By.className("v-table-cell-wrapper"))); - actions.perform(); - return findElement(By.className("v-contextmenu")); - } - - private void closeContextMenu() { - findElement(By.className("v-app")).click(); - } - - @Test - public void contextMenuIsResizedToFitWindow() { - int initialHeight = getContextMenuHeight(); - - resizeViewPortHeightTo(initialHeight - 10); - assertThat(getContextMenuHeight(), lessThan(initialHeight)); - - resizeViewPortHeightTo(initialHeight + 100); - assertThat(getContextMenuHeight(), is(initialHeight)); - } - - @Test - public void contextMenuPositionIsChangedAfterResize() { - int height = getContextMenuHeight(); - int y = getContextMenuY(); - - resizeViewPortHeightTo(y + height - 10); - - assertThat(getContextMenuY(), lessThan(y)); - assertThat(getContextMenuHeight(), is(height)); - } - -} diff --git a/uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveLayoutUpdateTest.java b/uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveLayoutUpdateTest.java deleted file mode 100644 index d6afe9889e..0000000000 --- a/uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveLayoutUpdateTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.vaadin.tests.extensions; - -import org.junit.Test; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.support.ui.ExpectedCondition; - -import com.vaadin.testbench.By; -import com.vaadin.testbench.elements.PanelElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class ResponsiveLayoutUpdateTest extends MultiBrowserTest { - - @Test - public void testWidthAndHeightRanges() throws Exception { - openTestURL(); - - final PanelElement panelElement = $(PanelElement.class).first(); - // I currently have no idea why PhantomJS wants a click here to work - // properly - panelElement.click(); - waitForElementVisible(By.cssSelector(".layout-update")); - - compareScreen("large"); - - // Resize below 600px width breakpoint - testBench().resizeViewPortTo(550, 768); - - waitUntil(new ExpectedCondition<Boolean>() { - @Override - public Boolean apply(WebDriver input) { - return panelElement.getSize().getWidth() < 500; - } - }); - compareScreen("small"); - } -} diff --git a/uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveWidthAndHeightTest.java b/uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveWidthAndHeightTest.java deleted file mode 100644 index 833978c848..0000000000 --- a/uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveWidthAndHeightTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.tests.extensions; - -import static org.junit.Assert.assertEquals; - -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; - -import com.vaadin.testbench.By; -import com.vaadin.testbench.elements.CssLayoutElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class ResponsiveWidthAndHeightTest extends MultiBrowserTest { - - @Before - public void setUp() throws Exception { - // We need this in order to ensure that the initial width-range is - // width: 600px- and height: 500px- - testBench().resizeViewPortTo(1024, 768); - } - - @Test - public void testWidthAndHeightRanges() throws Exception { - openTestURL(); - - // IE sometimes has trouble waiting long enough. - new WebDriverWait(getDriver(), 30) - .until(ExpectedConditions.presenceOfElementLocated( - By.cssSelector(".v-csslayout-width-and-height"))); - - // Verify both width-range and height-range. - assertEquals("600px-", - $(CssLayoutElement.class).first().getAttribute("width-range")); - assertEquals("500px-", - $(CssLayoutElement.class).first().getAttribute("height-range")); - - // Resize - testBench().resizeViewPortTo(550, 450); - - // Verify updated width-range and height-range. - assertEquals("0-599px", - $(CssLayoutElement.class).first().getAttribute("width-range")); - assertEquals("0-499px", - $(CssLayoutElement.class).first().getAttribute("height-range")); - } - -} diff --git a/uitest/src/test/java/com/vaadin/tests/extensions/SetThemeAndResponsiveLayoutTest.java b/uitest/src/test/java/com/vaadin/tests/extensions/SetThemeAndResponsiveLayoutTest.java deleted file mode 100644 index e242bae94c..0000000000 --- a/uitest/src/test/java/com/vaadin/tests/extensions/SetThemeAndResponsiveLayoutTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.tests.extensions; - -import static org.junit.Assert.assertEquals; - -import java.util.List; - -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.remote.DesiredCapabilities; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; - -import com.vaadin.testbench.By; -import com.vaadin.testbench.elements.ButtonElement; -import com.vaadin.testbench.elements.CssLayoutElement; -import com.vaadin.tests.tb3.MultiBrowserTest; - -public class SetThemeAndResponsiveLayoutTest extends MultiBrowserTest { - - @Before - public void setUp() throws Exception { - // We need this in order to ensure that the initial width-range is - // width: 600px- and height: 500px- - testBench().resizeViewPortTo(1024, 768); - } - - @Test - public void testWidthAndHeightRanges() throws Exception { - openTestURL(); - // IE sometimes has trouble waiting long enough. - new WebDriverWait(getDriver(), 30) - .until(ExpectedConditions.presenceOfElementLocated( - By.cssSelector(".v-csslayout-width-and-height"))); - // set the theme programmatically - $(ButtonElement.class).caption("Set theme").first().click(); - new WebDriverWait(getDriver(), 30).until(ExpectedConditions - .presenceOfElementLocated(By.xpath("//div[@width-range]"))); - - // Verify both width-range and height-range. - assertEquals("600px-", - $(CssLayoutElement.class).first().getAttribute("width-range")); - assertEquals("500px-", - $(CssLayoutElement.class).first().getAttribute("height-range")); - - // Resize - testBench().resizeViewPortTo(550, 450); - - // Verify updated width-range and height-range. - assertEquals("0-599px", - $(CssLayoutElement.class).first().getAttribute("width-range")); - assertEquals("0-499px", - $(CssLayoutElement.class).first().getAttribute("height-range")); - } -} |