12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package com.vaadin.tests.components.customlayout;
-
- import static org.junit.Assert.assertEquals;
-
- import org.junit.Test;
- import org.openqa.selenium.By;
-
- import com.vaadin.tests.tb3.MultiBrowserTest;
-
- public class OverflowAutoFixTest extends MultiBrowserTest {
- @Test
- public void testRestoreOverflowHidden() throws InterruptedException {
- openTestURL();
-
- click("run-button-one");
-
- assertElementCssValueEquals("first-scrollbar", "overflow", "scroll");
- assertElementCssValueEquals("second-scrollbar", "overflow-x", "hidden");
- assertElementCssValueEquals("third-scrollbar", "overflow-y", "hidden");
- }
-
- @Test
- public void testRestoreOverflowOther() throws InterruptedException {
- openTestURL();
-
- click("run-button-two");
-
- assertElementCssValueEquals("first-scrollbar", "overflow", "visible");
- assertElementCssValueEquals("second-scrollbar", "overflow-x", "scroll");
- assertElementCssValueEquals("third-scrollbar", "overflow-y", "auto");
- }
-
- private void click(String className) {
- findElement(By.className(className)).click();
- }
-
- private void assertElementCssValueEquals(String className,
- String propertyName, String expected) {
- assertEquals(
- String.format(
- "Unexpected value for property '%s' on element '%s',",
- propertyName, className),
- expected,
- findElement(By.className(className)).getCssValue(propertyName));
- }
- }
|