aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/test/java/com/vaadin/tests/components/customcomponent/CustomComponentChildVisibilityTest.java
blob: 44c39b5c5ffc786e21512788ce9da7935a547c35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.vaadin.tests.components.customcomponent;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.LabelElement;
import com.vaadin.tests.tb3.MultiBrowserTest;

public class CustomComponentChildVisibilityTest extends MultiBrowserTest {

    @Test
    public void childVisibilityIsSet() {
        openTestURL();

        assertTrue(isChildElementVisible());

        $(ButtonElement.class).first().click();

        assertFalse(isChildElementVisible());
    }

    private boolean isChildElementVisible() {
        return $(LabelElement.class).all().size() > 1;
    }

}