testnow 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/testnow.rb +5 -1
  3. data/lib/testnow/opera.rb +29 -0
  4. metadata +19 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4503b64daad3b1624aa21eca2a7b4df488b905f
4
- data.tar.gz: 461040a50818435301b29996845f37e98a0114b2
3
+ metadata.gz: 785b44ff05aea32253420c7f339f2ef6c2074cb3
4
+ data.tar.gz: a9e90bb2d7e66c0737b56aa763cfe8a8932339c7
5
5
  SHA512:
6
- metadata.gz: a50c5c9b37e860d5454415ce47d8622e3f35513ccea0c240b7e9affac953209eaefdcb49c9dc4ec3dc3b2e424b7b94bde18558f004508e866ffd03c6c1631628
7
- data.tar.gz: c098485f8e05006f2cb563a3157a00371ac19f72403c1f4221c41d0b5f31fcd4a488493e9516fd608cc1487e292883aff8e8a4c2e65234d6e4570083a4c1122e
6
+ metadata.gz: b382c1f216cc7ba8df7db8ff4c22225c091b00435609d398f982d53f91585137d83293fbf41e305973cb9e7e2f009dd71d35f3d3c5cdfea27aaeaeb7ad7180f0
7
+ data.tar.gz: dcdb0bce2406ae80856053fc9cebcfadae16e6de027165379f948e64b8d6526f561a58172a9bc559f16ef731ee795c47975e10aa40e1f29acc3794c4c271d4f6
data/lib/testnow.rb CHANGED
@@ -1,3 +1,7 @@
1
+ require 'selenium-webdriver'
2
+ require 'testnow/chrome'
3
+ require 'testnow/opera'
4
+
1
5
  module TestNow
2
6
 
3
7
  def init
@@ -8,7 +12,7 @@ module TestNow
8
12
  when "android"
9
13
  launch_driver_android
10
14
  when "opera"
11
- launch_driver_opera
15
+ TestNow.launch_driver_opera
12
16
  when "androidchrome"
13
17
  launch_driver_android_chrome
14
18
  when "ie"
@@ -0,0 +1,29 @@
1
+ module TestNow
2
+
3
+ #Opera browser
4
+ def launch_driver_opera
5
+ client = Selenium::WebDriver::Remote::Http::Default.new
6
+ client.timeout = 180 # seconds
7
+ service = Selenium::WebDriver::Chrome::Service.new("/usr/local/bin/operadriver", 48923)
8
+ service.start
9
+ cap = Selenium::WebDriver::Remote::Capabilities.chrome('operaOptions' => {'binary' => "#{get_binary_path}", 'args' => ["--ignore-certificate-errors"]})
10
+ @driver = Selenium::WebDriver.for(:remote, :url => service.uri, :desired_capabilities => cap, :http_client => client)
11
+ @driver.manage.timeouts.implicit_wait = 30
12
+ @driver.manage.window.maximize
13
+ @driver.manage.timeouts.page_load = 120
14
+ return @driver
15
+ end
16
+
17
+
18
+ def get_binary_path
19
+ case RUBY_PLATFORM
20
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
21
+ return "NEED TO FIND WINDOWS BINARY LOCATION"
22
+ when /darwin|mac os/
23
+ return "/Applications/Opera.app/Contents/MacOS/Opera"
24
+ else
25
+ return "/usr/bin/opera"
26
+ end
27
+
28
+ end
29
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testnow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaushal Rupani
@@ -9,7 +9,21 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2016-03-25 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: selenium-webdriver
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: A simple gem for TestNow
14
28
  email: kushrupani@live.com
15
29
  executables: []
@@ -18,8 +32,10 @@ extra_rdoc_files: []
18
32
  files:
19
33
  - lib/testnow.rb
20
34
  - lib/testnow/chrome.rb
35
+ - lib/testnow/opera.rb
21
36
  homepage: https://github.com/krupani/testnow
22
- licenses: []
37
+ licenses:
38
+ - MIT
23
39
  metadata: {}
24
40
  post_install_message:
25
41
  rdoc_options: []