[build] Bulletproofing tests to try to fix more flickers.
- added a waitUntilPageJSIsLoaded() method to help with sinchronization of the UI and used it in the BasePage constructor.
- Note: when reusing instances of BasePage, the constructor is not doing the work anymore and the waitUntilPageJSIsLoaded() method needs to be executed manually, when needed.

(cherry picked from commit 9c503afb3d2171d2ca2a34a9c13f0033363794bc)