12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- module WindowActions
- delegate :app_host, to: Capybara
-
-
-
-
-
-
-
- def switch_to_window_index(index)
- return false if !windows[index - 1]
- switch_to_window(windows[index - 1])
- end
-
-
-
-
-
-
-
-
- def close_window_index(index)
- return false if !windows[index - 1]
- windows[index - 1].close
- switch_to_window(windows[0]) if windows.length == 1
- end
-
-
-
-
-
-
-
- def open_window_and_switch
- window = open_new_window
- switch_to_window(window)
- end
- end
- RSpec.configure do |config|
- config.include WindowActions, type: :system
- end
|