Skip to content

Create TooltipOverlayElement / TooltipElement for helping testing tooltips with TestBench #7312

@TatuLund

Description

@TatuLund

Describe your motivation

Create TooltipElement for helping testing tooltips with TestBench

Describe the solution you'd like

Currently you need to use Selenium API's, something like

    @Test
    public void tooltipWorks() {
        Actions action = new Actions(getDriver());
        action.moveToElement(colorPicker).perform();
        waitForElementPresent(By.tagName("vaadin-tooltip-overlay"));
        TestBenchElement tooltip = $("vaadin-tooltip-overlay").first();
        assertEquals("Correct tooltip was not found",
                "This is color picker", tooltip.getText());
    }

Probably it would be nicer and more intuitive if you could do something like this:

@Test
public void tooltipWorks() {
    colorPicker.hover();
    var tooltip = $(TooltipOverlayElement.class).waitForFirst();
    assertEquals("Correct tooltip was not found",
            "This is color picker", tooltip.getText());
}

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions