BS-9663: add waitUntil to ensure the main window is available