Skip to content

UIUnit: add client like "click()" method to testers #1940

@stefanuebe

Description

@stefanuebe

Nearly all components are clickable, but there is no prebuilt click method in the testers. This means, the dev has to fire a ClickEvent manually, which implies somehow internal knowledge (as you normaly do not use that event in normal code).

Something like

ComponenTester ... {
    /**
     * Simulates a click as if it came from the client by setting the "fromClient" to true. Please note, that
     * there are no mouse details at all, but default values only, like x = 0 etc.
     */
    public void click() {
        ComponentUtil.fireEvent(getComponent(), new ClickEvent<>(getComponent(), false,
                0, 0, 0, 0, 0, 0, false,false, false, false));
    }
}

Metadata

Metadata

Assignees

Labels

UITestJUnit testing the UI

Projects

Status

Maybe

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions