'Block until `num_windows` are present (usually 2, but can be
overridden in the case of pop-ups opening other pop-ups).'

def wait_for_popup(self, num_windows=2, timeout=10):

    self.wait_until((lambda d: (len(d.window_handles) == num_windows)), timeout)
