testnow 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14794c0fbef9669ae635509c4366bc16d95135b6
4
- data.tar.gz: 06271a0aa763817c7166c242e52895c164c837ca
3
+ metadata.gz: 2192857e7f1f56c7e190e32b7f853fda9baa62bd
4
+ data.tar.gz: 3e5dc6cf8ce9510bb75100148381225cf4aa3730
5
5
  SHA512:
6
- metadata.gz: 5cfceab1c8ba33e733de91bd3243ccb839e2288c9c769f6369c0946fe3de1a67a631cab5fbf5828bbb08c220695f2a5b05214076197613e35a09fb7a5174bb3f
7
- data.tar.gz: 9703853dc59c68d6cbe4fc49f21801762704882185eb4a8d1d45768b8daac324ecc953f495f3e3ab95c028c5446268e12bc72d128d6ef903a6950247c6513ae8
6
+ metadata.gz: 717fdb1ce5432a827efd8e9598dafbeead074d6b5c2edb2928eedb781e0920912522aa26f88e90f707c0f881d43d3ec9fc2486a3e9a16d9edd79fbbda09aa551
7
+ data.tar.gz: 86b7ec6b8e3fa4360f4d6b7bf164db42b429addf01ab9a42348c63e7163bc2ac7af175d27fc414225a1f92700217a7ad7f81a93c371ce3454277b550c44fe63f
data/README.md CHANGED
@@ -1,4 +1,68 @@
1
1
  # testnow
2
2
 
3
- ###THIS IS A GEM FOR TESTNOW BY OPEX SOFTWARE
4
- ###IT IS STILL IN THE MAKING
3
+ An instant WebDriver-Ruby-Cucumber or WebDriver-Ruby-RSpec framework which has ability to do cross browser testing on any of the popular browsers, Firefox, Chrome, Opera, Internet Explorer, Safari, Android Browser. It uses the selenium-webdriver to driver the browsers already installed on your box. This gem also makes your existing automation code compatible to the TestNow platform by adding 1 command in your existing setup method.
4
+
5
+ ## Installation
6
+ You must have Ruby installed before you can install this gem.
7
+
8
+ ```
9
+ gem install testnow
10
+ ```
11
+
12
+ or you can include it in your Gemfile and run bundle install
13
+
14
+ ```
15
+ gem 'testnow'
16
+ ```
17
+
18
+
19
+ ## Usage
20
+
21
+ ### 1. Instant Cross Browser Configuration -- TestNow Platform Compatibility
22
+ When creating a Selenium-WebDriver automation suite, if one requires cross browser testing, the biggest headache is configuring all browsers mainly because configurations for every browser is done differently. It is . This is where TestNow gem jumps in as an Asprin.
23
+
24
+ Unlike some very famous Ruby-WebDriver tools which wraps up the WebDriver object and provides its own set of commands, TestNow gem returns you the ```driver``` object as is but initialized with any browser of your choice.
25
+
26
+ In your existing automation suite, just put the following command in the setup method. (Setup method is where WebDriver is initialized with a certain browser and a driver object is created.)
27
+
28
+ ```
29
+ @driver = TestNow.init
30
+ ```
31
+
32
+ TestNow gem uses the environment variable __BROWSER__ to detect which browser to initialize. If no value is set for this variable then firefox will be initialized by default.
33
+
34
+
35
+ ### 2. Instant WebDriver-Ruby-Cucumber framework
36
+
37
+ ```
38
+ testnow cucumber_now
39
+ ```
40
+ This will run a series of commands and create a WebDriver-Ruby-Cucumber framework for you in a directory called __cucumber_now__. It will towards the end also ask you for gem dependency installation and it is highly recommended to say Yes. It will also create a sample scenario with a feature file and also a hooks and env file with all configurations. This scenario can be executed by simple command to see a demo of the execution.
41
+
42
+ ```
43
+ cd cucumber_now # Navigate into the created directory
44
+
45
+ Command 1 : cucumber features # Executes using cucumber gem executable
46
+ or
47
+ Command 2 : rake cucumber_now # Executes using cucumber rake task
48
+ ```
49
+
50
+ Use any of the command to execute the sample scenario. A beautiful, screenshot embedded report will be created by this execution to in the reports directory. It will be in html format, please double click or open in a browser to view it.
51
+
52
+
53
+ ### 3. Instant WebDriver-Ruby-RSpec framework
54
+
55
+ ```
56
+ testnow rspec_now
57
+ ```
58
+
59
+ This will run a series of commands and create a WebDriver-Ruby-RSpec framework for you in a directory called __rspec_now__. It will towards the end also ask you for gem dependency installation and it is highly recommended to say Yes. It will also create a sample scenario with a spec and spec_helper file with all configuration. This scenario can be executed by simple command to see a live demo of the execution.
60
+
61
+ ```
62
+ cd cucumber_now # Navigate into the created directory
63
+
64
+ rake rspec_now # Executes using cucumber rake task
65
+ ```
66
+
67
+ Use any of the command to execute the sample spec. A beautiful report will be created by this execution to in the reports directory. It will be in html format, please double click or open in a browser to view it.
68
+
data/bin/testnow CHANGED
@@ -62,6 +62,9 @@ def cucumber_now
62
62
  print "Creating cucumber.yml -- used to provide cucumber options"
63
63
  FileUtils.copy(@showtime_dir+"/cucumber.yml", @root_dir)
64
64
 
65
+ print "Creating Rakefile -- used to write automation execution tasks."
66
+ FileUtils.copy(@showtime_dir+"/Rakefile", @root_dir)
67
+
65
68
  puts "\n"+"*"*97
66
69
  puts "* TestNow completed framework creation. A sample scenario is also created for your reference. *"
67
70
  puts "*"*97
@@ -120,7 +123,7 @@ def rspec_now
120
123
  print "Creating Gemfile -- used to contain all required gems information."
121
124
  FileUtils.copy(@showtime_dir+"/Gemfile", @root_dir)
122
125
 
123
- print "Creating Rakefile -- used to create automation execution tasks."
126
+ print "Creating Rakefile -- used to write automation execution tasks."
124
127
  FileUtils.copy(@showtime_dir+"/Rakefile_rspec", @root_dir+"/Rakefile")
125
128
 
126
129
  print "Creating spec file inside the scenarios directory."
@@ -145,7 +148,7 @@ def rspec_now
145
148
  puts "* To run the sample reference test, please cd into rspec_now directory *"
146
149
  puts "* and run the command 'rake rspec_now'. Enjoy the show!!! *"
147
150
  puts "* A beautiful descriptive report will be created in reports directory. *"
148
- puts "* !!! HAPPY AUTOMATION !!! *"
151
+ puts "* !!! HAPPY AUTOMATION !!! *"
149
152
  puts "*"*77+"\n"
150
153
 
151
154
  end
@@ -0,0 +1,5 @@
1
+ require 'cucumber/rake/task'
2
+
3
+ Cucumber::Rake::Task.new('cucumber_now') do |feature|
4
+ feature.cucumber_opts = 'features --profile default'
5
+ end
data/data/showtime/env.rb CHANGED
@@ -2,7 +2,6 @@ require 'rspec'
2
2
  require 'selenium-webdriver'
3
3
  require 'cucumber'
4
4
  require 'rake'
5
- require 'page-object'
6
5
  require 'testnow'
7
6
 
8
7
  include RSpec::Matchers
data/lib/testnow.rb CHANGED
@@ -2,6 +2,9 @@ require 'selenium-webdriver'
2
2
  require 'testnow/chrome'
3
3
  require 'testnow/opera'
4
4
  require 'testnow/firefox'
5
+ require 'testnow/android'
6
+ require 'testnow/android_chrome'
7
+ require 'testnow/internet_explorer'
5
8
 
6
9
  module TestNow
7
10
 
@@ -11,13 +14,13 @@ module TestNow
11
14
  when "chrome"
12
15
  TestNow.launch_driver_chrome
13
16
  when "android"
14
- launch_driver_android
17
+ TestNow.launch_driver_android
15
18
  when "opera"
16
19
  TestNow.launch_driver_opera
17
20
  when "androidchrome"
18
- launch_driver_android_chrome
21
+ TestNow.launch_driver_android_chrome
19
22
  when "ie"
20
- launch_driver_ie
23
+ TestNow.launch_driver_ie
21
24
  else
22
25
  TestNow.launch_driver_firefox
23
26
  end
@@ -0,0 +1,8 @@
1
+ module TestNow
2
+
3
+ def launch_driver_android
4
+ @driver = Selenium::WebDriver.for :remote, :desired_capabilities => :android
5
+ @driver
6
+ end
7
+
8
+ end
@@ -0,0 +1,12 @@
1
+ module TestNow
2
+
3
+ def launch_driver_android_chrome
4
+ client = Selenium::WebDriver::Remote::Http::Default.new
5
+ client.timeout = 120
6
+ caps = {'chromeOptions'=> {'androidPackage' => 'com.android.chrome'}}
7
+ @driver = Selenium::WebDriver.for(:remote, :http_client => client, :url => "http://localhost:9515", :desired_capabilities => caps)
8
+ @driver.manage.timeouts.implicit_wait = 60
9
+ @driver
10
+ end
11
+
12
+ end
@@ -0,0 +1,21 @@
1
+ module TestNow
2
+
3
+ def launch_driver_ie
4
+ client = Selenium::WebDriver::Remote::Http::Default.new
5
+ client.timeout = 120
6
+ caps = Selenium::WebDriver::Remote::Capabilities.ie('ie.ensureCleanSession' => true, :javascript_enabled => true, :http_client => client, :native_events => false, :acceptSslCerts => true)
7
+ @driver = Selenium::WebDriver.for(:ie, :desired_capabilities => caps)
8
+ @driver.manage.timeouts.implicit_wait = 90
9
+ @driver.manage.timeouts.page_load = 120
10
+ if ENV['RESOLUTION'].nil?
11
+ @driver.manage.window.size = Selenium::WebDriver::Dimension.new(1366,768)
12
+ elsif ENV['RESOLUTION'].downcase == "max"
13
+ @driver.manage.window.maximize
14
+ else
15
+ res = ENV['RESOLUTION'].split('x')
16
+ @driver.manage.window.size = Selenium::WebDriver::Dimension.new(res.first.to_i, res.last.to_i)
17
+ end
18
+ @driver
19
+ end
20
+
21
+ end
data/lib/testnow/version CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testnow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaushal Rupani
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-17 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -65,6 +65,7 @@ files:
65
65
  - data/netExport-0.8.xpi
66
66
  - data/showtime/Gemfile
67
67
  - data/showtime/Gemfile_rspec
68
+ - data/showtime/Rakefile
68
69
  - data/showtime/Rakefile_rspec
69
70
  - data/showtime/cucumber.yml
70
71
  - data/showtime/env.rb
@@ -75,8 +76,11 @@ files:
75
76
  - data/showtime/hooks.rb
76
77
  - data/showtime/spec_helper.rb
77
78
  - lib/testnow.rb
79
+ - lib/testnow/android.rb
80
+ - lib/testnow/android_chrome.rb
78
81
  - lib/testnow/chrome.rb
79
82
  - lib/testnow/firefox.rb
83
+ - lib/testnow/internet_explorer.rb
80
84
  - lib/testnow/opera.rb
81
85
  - lib/testnow/version
82
86
  - spec/spec_helper.rb