Przełącz na wyskakujące okienka w ogórku, kapibarze

W RSpec mogę użyć takiego przełączenia kodu na wyskakujące okienko,połączyć, Jak mogę zrobić coś takiego w krokach ogórka?

login_window = page.driver.find_window('PPA_identity_window')
    main_window = page.driver.find_window('')

    # We use this to execute the next instructions in the popup window
    page.within_window(login_window) do
      #Normally fill in the form and log in
      fill_in 'email', :with => "<your paypal sandbox username>"
      fill_in 'password', :with => "<your paypal sandbox password>"
      click_button 'Log In'
    end

questionAnswers(3)

yourAnswerToTheQuestion