summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2015-06-09 16:46:56 +0300
committerVaadin Code Review <review@vaadin.com>2015-06-09 15:47:18 +0000
commit4837e3838e22bf8699ac88a967ca6d5063df39d0 (patch)
treea61d255de3f34745bef621a17caad6c0e0b23d67 /uitest
parent5b965ff478ef22a83a476eeebdf70554a776bae6 (diff)
downloadvaadin-framework-4837e3838e22bf8699ac88a967ca6d5063df39d0.tar.gz
vaadin-framework-4837e3838e22bf8699ac88a967ca6d5063df39d0.zip
Properly display Slider values greater than Integer.MAX_VALUE (#18192)
Change-Id: Ic83d067b69eff8b34acf7945e84fb645160d8ae2
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/slider/SliderFeedback.java43
-rw-r--r--uitest/src/com/vaadin/tests/components/slider/SliderFeedbackTest.java44
2 files changed, 87 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderFeedback.java b/uitest/src/com/vaadin/tests/components/slider/SliderFeedback.java
new file mode 100644
index 0000000000..f28dfc8f79
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/slider/SliderFeedback.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.slider;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Slider;
+
+public class SliderFeedback extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Slider slider = new Slider(0, 5);
+ slider.setWidth(800, Unit.PIXELS);
+ slider.setMin(0);
+ slider.setMax(1e12);
+ addComponent(slider);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Slider feedback popup should display the correct value";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 18192;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderFeedbackTest.java b/uitest/src/com/vaadin/tests/components/slider/SliderFeedbackTest.java
new file mode 100644
index 0000000000..86bc351480
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/slider/SliderFeedbackTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.slider;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class SliderFeedbackTest extends MultiBrowserTest {
+
+ @Test
+ public void testValueGreaterThanMaxInt() {
+ openTestURL();
+
+ WebElement handle = findElement(By.className("v-slider-handle"));
+ new Actions(driver).dragAndDropBy(handle, 400, 0).perform();
+ testBench().waitForVaadin();
+
+ double value = Double.valueOf(findElement(
+ By.className("v-slider-feedback")).getText());
+
+ // Allow for some tolerance due to, you guessed it, IE8
+ assertLessThan("Unexpected feedback value {1} < {0}", 505000000000.0,
+ value);
+ assertGreater("Unexpected feedback value {1} > {0}", 510000000000.0,
+ value);
+ }
+}