Skip to content

Allow custom Vaadin configurations per test #48

@mcollovati

Description

@mcollovati

There might be situations where different tests need different configurations.
One example is testing a view with a component behind a feature flag.
Another example could be enabling UI serialization (devmode.sessionSerialization.enabled=true) only for certain tests.

Currently, the only way to test this is to set system properties in before hook and reset it in after hook.

It would be nice if we could provide a way to apply similar configurations per single test / test class (after implementing #22).

One option could be to add a @BrowserlessTestConfig(featureFlags={}, applicationProperties={}) annotation;
for properties we can propagate them to the mock servlet MockVaadin.setup(...) (as we do enforce browserless mode).
FeatureFlags can be a bit more tricky, but I guess we can "inject" a custom instance into Lookup, in the same MockVaadin.setup(...) method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    Status

    🪵Product backlog

    Status

    Maybe

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions