Skip to content

Instantly share code, notes, and snippets.

@christophervigliotti
Created April 20, 2018 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christophervigliotti/03021c79a5ae6f6dfd79c5b385532a8b to your computer and use it in GitHub Desktop.
Save christophervigliotti/03021c79a5ae6f6dfd79c5b385532a8b to your computer and use it in GitHub Desktop.
AFT Working With Popups
a_popup_window = window_opened_by do
# click_button 'Open Login Window', which opens a popup
the_xpath = "//a[@id='open_popup_link']"
find(:xpath, the_xpath).click
end
within_window(a_popup_window) do
# are we focused on the popup?
expect(page).to have_selector(:xpath, "//h1[contains(text(), 'Text that appears in the H1 Tag')]")
popup_page_instance = PopupPageObj.new
popup_page_instance.do_a_thing
popup_page_instance.do_another_thing
# fill_in :email, with: "email@example.com"
# fill_in :password, with: "password"
# click_button 'Log In'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment