Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper for navigation with query parameters in UI Unit Test #1758

Open
mcollovati opened this issue Feb 25, 2024 · 3 comments
Open

Add helper for navigation with query parameters in UI Unit Test #1758

mcollovati opened this issue Feb 25, 2024 · 3 comments
Labels
enhancement UITest JUnit testing the UI

Comments

@mcollovati
Copy link
Contributor

This PR improved the UI class by adding navigation methods that take query parameters.
UI Unit Test base class should also provide such helpers.

@mcollovati mcollovati added enhancement UITest JUnit testing the UI labels Feb 25, 2024
@ma99koch
Copy link

@mcollovati Do you have any appropriate workaround to perform a test with navigating to a view with query parameters?
Just don't test such things as public <T extends Component> T navigate(String location, Class<T> expectedTarget); does not allow query parameters in the location-String 😉?

@mcollovati
Copy link
Contributor Author

As a workaround, I think you can directly use UI.getCurrent().navigate(Class<? extends T> navigationTarget, QueryParameters queryParameters).
It should work, but you will lose the checks on UI and target view.

To also have the checks, you can create your own navigate(...) method and use reflection to call verifyAndGetUI and validateNavigationTarget.

@ma99koch
Copy link

Thanks, this worked! Somehow didn't had in mind I can just use UI.getCurrent.navigate()...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement UITest JUnit testing the UI
Projects
None yet
Development

No branches or pull requests

2 participants