diff options
author | Anna Miroshnik <anna.miroshnik@arcadia.spb.ru> | 2014-09-09 14:17:06 +0400 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2014-09-12 16:52:17 +0300 |
commit | 219cd81c6d097b34419dadc68e307f48575b5cbb (patch) | |
tree | 52cc69ae166480d9822ff269572829a516ba5c68 /uitest | |
parent | 1eebd89464f4a6ff20672dee0c6f0807d5926f5c (diff) | |
download | vaadin-framework-219cd81c6d097b34419dadc68e307f48575b5cbb.tar.gz vaadin-framework-219cd81c6d097b34419dadc68e307f48575b5cbb.zip |
Fix slider inside table is not accessible.(#13681)
some fixes after review.
HiddenSliderHandle extends AbstractTestUI instead of UI now.
Change-Id: I83578014ae83219941da745e8373614854c937d7
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/slider/HiddenSliderHandle.java | 50 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/slider/HiddenSliderHandleTest.java | 41 |
2 files changed, 91 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/slider/HiddenSliderHandle.java b/uitest/src/com/vaadin/tests/components/slider/HiddenSliderHandle.java new file mode 100644 index 0000000000..105c20f7c6 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/slider/HiddenSliderHandle.java @@ -0,0 +1,50 @@ +/* + * 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.data.Item; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Slider; +import com.vaadin.ui.Table; + +public class HiddenSliderHandle extends AbstractTestUI { + + private static final long serialVersionUID = 1L; + + @Override + protected void setup(VaadinRequest request) { + Table t = new Table(); + Slider s = new Slider(); + t.setWidth("200px"); + s.setWidth("100px"); + t.addContainerProperty("s", Slider.class, null); + Item i = t.addItem("123"); + i.getItemProperty("s").setValue(s); + getLayout().addComponent(t); + } + + @Override + protected String getTestDescription() { + return "Slider's handler should be accessible (visible) if slider is put inside table"; + } + + @Override + protected Integer getTicketNumber() { + return 13681; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/slider/HiddenSliderHandleTest.java b/uitest/src/com/vaadin/tests/components/slider/HiddenSliderHandleTest.java new file mode 100644 index 0000000000..3717f7f754 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/slider/HiddenSliderHandleTest.java @@ -0,0 +1,41 @@ +/* + * 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 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 com.vaadin.tests.tb3.MultiBrowserTest; + +public class HiddenSliderHandleTest extends MultiBrowserTest { + + @Test + public void handleIsAccessible() throws IOException { + openTestURL(); + + assertThat(getSliderHandle().isDisplayed(), is(true)); + } + + private WebElement getSliderHandle() { + return driver.findElement(By.className("v-slider-handle")); + } +} |