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

UIUnit: Provide page reload method to allow simulating a user based browser page reload #1884

Open
stefanuebe opened this issue Mar 17, 2025 · 1 comment
Labels

Comments

@stefanuebe
Copy link

stefanuebe commented Mar 17, 2025

We have a problem in UI Unit tests on simulating a user based browser page reload. When having a real page reload in the application, the nav type is set to "page_load", while using UI.getCurrent().getPage().reload() sets the nav type to "programmatic".

The issue coming up with this is in short, that programmatic navigation affects dialog and notification open states by closing them in certain situations.

In our case, a Notification is opened during the initial navigation lifecycle. While that notification is shown in the real application (and can for instance be tested using browser tests), it gets closed in the UI Unit tests due to the "programmatic" nav type.

Therefore it would be ideal, if the UIUnit tests would provide a dedicated "reload page" method (parallel to the navigate methods in BaseUIUnitTest), that simulates the browser page reload and set the type to "page_load". This way, the programmatic reload using Page#reload and related actions stay unaffected and thus should prevent any unwanted side effects.

@stefanuebe stefanuebe changed the title UIUnit: Page reload should set different navigation trigger type UIUnit: Provide page reload method to allow simulating a user based browser page reload Mar 17, 2025
@mshabarov
Copy link
Contributor

Even if changing the nav type to "page_load" would be a breaking change for some test cases, I'd prose doing this right away. Page reload in browser tests and in UI unit test should be aligned in terms of nav mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🔖 Low Priority (P3)
Development

No branches or pull requests

2 participants