Class: RUTL::Interface::Firefox

Inherits:
Base
  • Object
show all
Defined in:
lib/rutl/interface/firefox.rb

Overview

Small interface for Chrome browser.

Constant Summary

Constants included from Utilities

Utilities::DEFAULT_TIMEOUT, Utilities::POLL_SLEEP_TIME

Instance Attribute Summary

Attributes inherited from Base

#camera, #driver, #pages

Instance Method Summary collapse

Methods inherited from Base

#find_page, #find_state, #goto, #method_missing, #quit, #respond_to_missing?, #wait_for_transition

Methods included from Utilities

#await, #class_info, #location, #page?

Constructor Details

#initializeFirefox

Returns a new instance of Firefox.



10
11
12
13
14
15
16
17
18
19
# File 'lib/rutl/interface/firefox.rb', line 10

def initialize
  @logged_in = true
  options = Selenium::WebDriver::Firefox::Options.new
  options.add_argument('--ignore-certificate-errors')
  options.add_argument('--disable-popup-blocking')
  options.add_argument('--disable-translate')
  options.add_argument('--headless') if ENV['TRAVIS'] == 'true'
  @driver = Selenium::WebDriver.for :firefox, options: options
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RUTL::Interface::Base

Instance Method Details

#current_pageObject



21
22
23
24
25
26
# File 'lib/rutl/interface/firefox.rb', line 21

def current_page
  url = @driver.current_url
  page = find_page(url)
  raise "PAGE NOT FOUND: #{url}, PAGES: #{@pages}" unless page
  page
end