This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RegisterView < CLOView | |
process_page "Create Registration" do | |
process_page_alias 'Edit Registration' | |
keyword(:username) {browser.text_field(id: 'username')} | |
keyword(:password) {browser.text_field(id: 'password')} | |
keyword(:email) {browser.text_field(id: 'email')} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
first_window = File.open('window1.html', 'w').tap {|f| f.puts "<html><head><title><Window1</title></head><body><p>Click <a id='open' href='#' onclick='window.open(\"window2.html\")'>here</a></body></html>" } | |
first_window.close | |
File.open('window2.html', 'w').tap {|f| f.puts "<html><head><title>window1</title></head><body><p>Click <a id='close' href='#' onclick=\"window.close()\">close</a></p></body></html>" }.close | |
driver = Selenium::WebDriver.for :chrome | |
driver.navigate.to "file://#{File.expand_path(File.dirname(__FILE__))}/#{first_window.path}" | |
driver.first(id: 'open').click | |
driver.switch_to.window(driver.window_handles.last) | |
driver.first(id: 'close').click | |
#driver.window_handles ### If you un-comment out this line, the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new_watir_browser | |
set_headless if config.headless | |
..... | |
end | |
def set_headless | |
begin | |
require 'headless' | |
@headless = Headless.new | |
@headless.start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_email_text(search_array, timeout=600, delete=true, since_sec=3600) | |
# Trying super ugly workaraound for the gmail 'Too many simlutaneous connections' error. | |
# Just trying to login to gmail and if it fails try to wait until other connections | |
# are closed and try again. | |
email_text = nil | |
email_subject = nil | |
email_uid = nil | |
::Timeout.timeout(timeout) do | |
@log.debug("start Timeout block for #{timeout} seconds") |