aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/components/nativebutton/NativeButtonHtml.java
blob: c8b04e5b92010f9901cdc39b2cece4df918c0b73 (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
30
31
32
33
34
package com.vaadin.tests.components.nativebutton;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.NativeButton;

public class NativeButtonHtml extends TestBase {

    @Override
    protected void setup() {
        NativeButton b = new NativeButton("<b>Plain text button</b>");
        addComponent(b);

        b = new NativeButton(
                "<span style=\"color: red; font-weight: bold;\">HTML</span> button");
        b.setCaptionAsHtml(true);
        addComponent(b);

        final NativeButton swapButton = new NativeButton("<i>Swap button<i>");
        swapButton.addClickListener(event -> swapButton
                .setCaptionAsHtml(!swapButton.isCaptionAsHtml()));
        addComponent(swapButton);
    }

    @Override
    protected String getDescription() {
        return "Verify that NativeButton HTML rendering works";
    }

    @Override
    protected Integer getTicketNumber() {
        // 8663 was for normal button (see ButtonHtml test)
        return null;
    }
}