aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorBuild Agent <build@vaadin.com>2014-03-31 11:28:13 +0300
committerBuild Agent <build@vaadin.com>2014-03-31 11:28:14 +0300
commita6805ea6e96a158fda1fc5426faca543b3ba5563 (patch)
tree493ca43eb84aeaf38d1584bae77921e73e3f57ea /uitest
parent7a91d29097e606a7e2dc4440443cb21ae7dfa61b (diff)
parent7a47febb2fdb03a743cca60409426ff70cc463a2 (diff)
downloadvaadin-framework-a6805ea6e96a158fda1fc5426faca543b3ba5563.tar.gz
vaadin-framework-a6805ea6e96a158fda1fc5426faca543b3ba5563.zip
Merge changes from origin/7.1
7a47feb Refactored slider disable test. Change-Id: I11e49db753753073dcaec634cd54ce0b17c71ad8
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java35
1 files changed, 31 insertions, 4 deletions
diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java b/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java
index 53521ee483..f8fed28fac 100644
--- a/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java
+++ b/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java
@@ -15,9 +15,14 @@
*/
package com.vaadin.tests.components.slider;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
import java.io.IOException;
import org.junit.Test;
+import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
@@ -27,11 +32,33 @@ public class SliderDisableTest extends MultiBrowserTest {
@Test
public void disableSlider() throws IOException {
openTestURL();
+
+ assertSliderHandlePositionIs(38);
+
+ // Move slider handle from 38px to 150px
+ moveSlider(112);
+
+ assertSliderHandlePositionIs(150);
+ driver.findElement(By.id("disableButton")).click();
+
+ assertSliderIsDisabled();
+ assertSliderHandlePositionIs(150);
+ }
+
+ private void assertSliderIsDisabled() {
+ WebElement slider = driver.findElement(By.className("v-slider"));
+ assertThat(slider.getAttribute("class"), containsString("v-disabled"));
+ }
+
+ private void moveSlider(int offset) {
WebElement element = vaadinElement("/VVerticalLayout[0]/Slot[0]/VSlider[0]/domChild[2]/domChild[0]");
- new Actions(driver).dragAndDropBy(element, 112, 0).perform();
+ new Actions(driver).dragAndDropBy(element, offset, 0).perform();
testBench().waitForVaadin();
- compareScreen("enabled");
- vaadinElementById("disableButton").click();
- compareScreen("disabled");
+ }
+
+ private void assertSliderHandlePositionIs(int position) {
+ WebElement handle = driver.findElement(By.className("v-slider-handle"));
+
+ assertThat(handle.getCssValue("margin-left"), is(position + "px"));
}
} \ No newline at end of file