Package com.vaadin.testbench.elements

Examples of com.vaadin.testbench.elements.VerticalLayoutElement


        // remove focus
        getDriver().findElement(By.className("v-app")).click();

        // check button widths in VerticalLayout
        VerticalLayoutElement vLayout = $(VerticalLayoutElement.class).$(
                VerticalLayoutElement.class).first();
        int containerWidth = vLayout.getSize().getWidth();

        NativeButtonElement nativeButton = vLayout.$(NativeButtonElement.class)
                .first();
        int buttonWidth = nativeButton.getSize().getWidth();

        assertButtonWidth(buttonWidth, containerWidth);

        ButtonElement button = vLayout.$(ButtonElement.class).first();
        buttonWidth = button.getSize().getWidth();
        assertButtonWidth(buttonWidth, containerWidth);

        // check button widths in table, also make sure that there is some
        // spacing between the table edges and buttons
View Full Code Here


        return false;
    }

    protected List<String> getLogs() {
        VerticalLayoutElement log = $(VerticalLayoutElement.class).id("Log");
        List<LabelElement> logLabels = log.$(LabelElement.class).all();
        List<String> logTexts = new ArrayList<String>();

        for (LabelElement label : logLabels) {
            logTexts.add(label.getText());
        }
View Full Code Here

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

        VerticalLayoutElement mainLayout = $(VerticalLayoutElement.class)
                .first();

        TextFieldElement textField = $(TextFieldElement.class).first();
        // Enter in mainlayout -> should trigger shortcut
        sendEnter(mainLayout);
View Full Code Here

                "3. GridLayout: left click on <none>");
    }

    @Test
    public void clickInVerticalLayout() {
        VerticalLayoutElement layout = $(VerticalLayoutElement.class).get(4);

        // click on a text field
        layout.$(TextFieldElement.class).get(1).click();
        assertLogText("VerticalLayout 6th child clicked",
                "1. VerticalLayout: left click on This is tf6");

        // click on a label
        layout.$(LabelElement.class).get(3).click();
        assertLogText("VerticalLayout 4th child clicked",
                "2. VerticalLayout: left click on This is label 3");
    }
View Full Code Here

                "1. GridLayout: left click on This is label 1");
    }

    @Test
    public void dragInVerticalLayout() {
        VerticalLayoutElement layout = $(VerticalLayoutElement.class).get(4);

        // Drag inside the first text field
        new Actions(getDriver())
                .moveToElement(layout.$(TextFieldElement.class).first(), 25, 9)
                .clickAndHold().moveByOffset(-20, 0).release().perform();
        assertLogText("Mouse dragged in VerticalLayout",
                "1. VerticalLayout: left click on This is tf5");

        // Drag from a caption to its text field
        new Actions(getDriver())
                .moveToElement(layout.$(TextFieldElement.class).get(4), 28, 11)
                .clickAndHold()
                .moveToElement(layout.$(TextFieldElement.class).get(4), 39, 30)
                .release().perform();
        assertLogText("Expected the drag to be ignored between elements",
                "1. VerticalLayout: left click on This is tf5");
    }
View Full Code Here

TOP

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

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.