You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.
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 inBaseUIUnitTest
), that simulates the browser page reload and set the type to "page_load". This way, the programmatic reload usingPage#reload
and related actions stay unaffected and thus should prevent any unwanted side effects.The text was updated successfully, but these errors were encountered: