Adding support for waitForElements