Sha256: b06052befe21d3ac15f0785b51395293363df2f9a8c5ea349f2cb270ca5bffbf

Contents?: true

Size: 759 Bytes

Versions: 1

Compression:

Stored size: 759 Bytes

Contents

require 'watir-webdriver'
require 'selenium-webdriver'

module PowerSchool
    module Configuration
        VALID_OPTION_KEYS = %w(host username password browser).freeze

        HOST = nil
        USERNAME = nil
        PASSWORD = nil

        attr_accessor *VALID_OPTION_KEYS

        def self.extend(base)
            base.reset
        end

        def reset
            self.host = HOST
            self.username = USERNAME
            self.password = PASSWORD
        end

        def configure
            yield self

            client = Selenium::WebDriver::Remote::Http::Default.new
            client.timeout = 180 # seconds – default is 60

            self.browser ||= Watir::Browser.new :chrome, :http_client => client
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
power_school-0.0.4 lib/power_school/configuration.rb