[build] Attempt to fix flickering test.
- Implemented inside the DatePicker constructor a wait for the popup to show so that clients don't have to manually call the wait.
- This also inroduces the same pattern we have for pages, that is to first make the UI available (i.e. click to display the date picker) and then call the constructor to start using it, never the other way around.

(cherry picked from commit 933faf1a3ec91cc9c717fed5db6627d2bb2afeea)