1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package com.vaadin.tests.components.ui;
-
- import static org.junit.Assert.assertTrue;
-
- import java.util.Locale;
-
- import org.junit.Test;
- import org.openqa.selenium.By;
- import org.openqa.selenium.WebElement;
-
- import com.vaadin.tests.tb3.MultiBrowserTest;
-
- /**
- * Test to check auto-generated style name for UI div and overlays div.
- *
- * @author Vaadin Ltd
- */
- public class UIAutoGeneratedStyleNameTest extends MultiBrowserTest {
-
- @Test
- public void testUiStyleName() {
- openTestURL();
-
- assertTrue("UI div element doesn't contain autogenerated style name",
- containsStyle(getDriver().findElement(By.className("v-app")),
- UIAutoGeneratedStyleName.class.getSimpleName()
- .toLowerCase(Locale.ROOT)));
-
- assertTrue(
- "Overlays div element doesn't contain autogenerated style name",
- containsStyle(
- getDriver().findElement(
- By.className("v-overlay-container")),
- UIAutoGeneratedStyleName.class.getSimpleName()
- .toLowerCase(Locale.ROOT)));
- }
-
- private boolean containsStyle(WebElement element, String style) {
- return element.getAttribute("class").contains(style);
- }
- }
|