在 RSpec 中,我可以使用这样的代码开关来弹出窗口、链接,我如何在 Cucumber 步骤中做这样的事情?
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