Package com.vaadin.testbench.elements

Examples of com.vaadin.testbench.elements.GridLayoutElement


    @Test
    public void componentRowFour() throws IOException, Exception {
        openTestURL();
        CssLayoutElement component = $(CssLayoutElement.class).first();
        GridLayoutElement gridLayout = $(GridLayoutElement.class).first();

        // Spacing on, not hiding empty rows/columns
        // There should be 3 * 6px spacing (red) above the csslayout
        verifySpacingAbove(3 * 6, gridLayout, component);

View Full Code Here


        openTestURL();
    }

    @Test
    public void clickInGridLayout() {
        GridLayoutElement layout = $(GridLayoutElement.class).first();

        // click on a label
        layout.$(LabelElement.class).first().click();
        assertLogText("GridLayout 1st child clicked",
                "1. GridLayout: left click on This is label 1");

        // click on a text field
        layout.$(TextFieldElement.class).get(1).click();
        assertLogText("GridLayout 5th child clicked",
                "2. GridLayout: left click on This is tf5");

        // click on the layout body (not any component inside the layout)
        layout.click(130, 41);
        assertLogText("GridLayout body clicked",
                "3. GridLayout: left click on <none>");
    }
View Full Code Here

                "2. Button A button with its own click listener was clicked");
    }

    @Test
    public void dragInGridLayout() {
        GridLayoutElement layout = $(GridLayoutElement.class).first();

        // Drag inside the first label in this layout
        new Actions(getDriver())
                .moveToElement(layout.$(LabelElement.class).first(), 40, 8)
                .clickAndHold().moveByOffset(-20, 0).release().perform();
        assertLogText("Mouse dragged in GridLayout",
                "1. GridLayout: left click on This is label 1");

        // Drag from the third label to a text field in this layout
        new Actions(getDriver())
                .moveToElement(layout.$(LabelElement.class).get(2), 40, 8)
                .clickAndHold()
                .moveToElement(layout.$(TextFieldElement.class).get(3), 46, 33)
                .release().perform();
        assertLogText("Expected the drag to be ignored between elements",
                "1. GridLayout: left click on This is label 1");
    }
View Full Code Here

            }
        }, 5);
    }

    private List<WebElement> getSlots(int index) {
        GridLayoutElement layout = $(GridLayoutElement.class).get(index);

        return layout.findElements(By.className("v-gridlayout-slot"));
    }
View Full Code Here

TOP

Related Classes of com.vaadin.testbench.elements.GridLayoutElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.