Added waitForDOM helper