在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