Package com.vaadin.testbench.elements

Examples of com.vaadin.testbench.elements.NativeSelectElement


    public void notificationTest() throws Exception {
        openTestURL();

        TextFieldElement prefix = $(TextFieldElement.class).first();
        TextFieldElement postfix = $(TextFieldElement.class).get(1);
        NativeSelectElement type = $(NativeSelectElement.class).first();
        ButtonElement show = $(ButtonElement.class).first();

        prefix.clear();
        prefix.sendKeys("Prefix:");

        postfix.clear();
        postfix.sendKeys("- press ESC to close");

        type.selectByText(NotificationRole.ALERT.toString());

        show.click();
        waitForElementPresent(By.className("v-Notification"));

        NotificationElement notification = $(NotificationElement.class).first();

        String text = notification.getAttribute("role");
        Assert.assertTrue("Expected attribute 'role' to equal 'alert', found "
                + text, text.equals("alert"));

        text = getHiddenText(notification.findElements(
                By.className("v-assistive-device-only")).get(0));
        Assert.assertTrue("Expected 'Prefix:', found " + text,
                text.equals("Prefix:"));

        text = getHiddenText(notification.findElements(
                By.className("v-assistive-device-only")).get(1));
        Assert.assertTrue("Expected '- press ESC to close', found " + text,
                text.equals("- press ESC to close"));

        try {
            notification.closeNotification();
        } catch (Exception e) {
        }

        type.selectByText("STATUS");

        show.click();
        waitForElementPresent(By.className("v-Notification"));

        notification = $(NotificationElement.class).first();
View Full Code Here

TOP

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

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.