testnow 0.0.4 → 0.0.5

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: eb556c37d8d2e832253d745a9bf20d05e3145d97
4
- data.tar.gz: 0a5ff7218eaedd0d5d2d38aeeb199be5f8f23ba9
3
+ metadata.gz: 14794c0fbef9669ae635509c4366bc16d95135b6
4
+ data.tar.gz: 06271a0aa763817c7166c242e52895c164c837ca
5
5
  SHA512:
6
- metadata.gz: 823fc2fbf9d73eac0a341e795782adbc204f6576f402ffa3aa0b7c543ccf60011bdf598781ca81276801124081cfdbe5022d54f1a8ee721f2afda8708c33e86e
7
- data.tar.gz: 8fdac75edef2b6a10783f2cc883ea27d84994ea5d140f1d547e3f45ead4bd48f942405e5c435e7722a4b9eae6537fbc6090336777f23a9dec386d735458f5dff
6
+ metadata.gz: 5cfceab1c8ba33e733de91bd3243ccb839e2288c9c769f6369c0946fe3de1a67a631cab5fbf5828bbb08c220695f2a5b05214076197613e35a09fb7a5174bb3f
7
+ data.tar.gz: 9703853dc59c68d6cbe4fc49f21801762704882185eb4a8d1d45768b8daac324ecc953f495f3e3ab95c028c5446268e12bc72d128d6ef903a6950247c6513ae8
data/bin/testnow CHANGED
@@ -2,16 +2,17 @@
2
2
 
3
3
  require 'fileutils'
4
4
 
5
- @root_dir = File.join(FileUtils.pwd, "cucumber_now")
6
- @feature_dir = File.join(@root_dir,'features')
7
- @scenario_dir = File.join(@feature_dir, 'scenarios')
8
- @steps_dir = File.join(@feature_dir,'step_definition')
9
- @page_dir = File.join(@feature_dir, 'pages')
10
- @support_dir = File.join(@feature_dir,'support')
11
- @report_dir = File.join(@root_dir, 'reports')
12
5
  @showtime_dir = File.join(File.dirname(__FILE__) + "/../data/showtime")
13
6
 
14
7
  def cucumber_now
8
+ @root_dir = File.join(FileUtils.pwd, "cucumber_now")
9
+ @feature_dir = File.join(@root_dir,'features')
10
+ @scenario_dir = File.join(@feature_dir, 'scenarios')
11
+ @steps_dir = File.join(@feature_dir,'step_definition')
12
+ @page_dir = File.join(@feature_dir, 'pages')
13
+ @support_dir = File.join(@feature_dir,'support')
14
+ @report_dir = File.join(@root_dir, 'reports')
15
+
15
16
  if File.exist?(@root_dir)
16
17
  print 'There is already cucumber_now directory. Either delete it or try running the command from some other directory.'
17
18
  exit 1
@@ -41,10 +42,9 @@ def cucumber_now
41
42
  print "Creating the reports directory where the reports will be save after execution."
42
43
  FileUtils.makedirs(@report_dir)
43
44
 
44
- print "Creating config files..."
45
- print "1. hooks.rb -- used for setup and teardown purpose."
45
+ print "Creating config files -- hooks.rb -- used for setup and teardown purpose."
46
46
  FileUtils.copy(@showtime_dir+"/hooks.rb", @support_dir)
47
- print "2. env.rb -- used as cucumber config"
47
+ print "Creating config files -- env.rb -- used as cucumber config"
48
48
  FileUtils.copy(@showtime_dir+"/env.rb", @support_dir)
49
49
 
50
50
  print "Creating feature file inside scenarios directory."
@@ -66,23 +66,91 @@ def cucumber_now
66
66
  puts "* TestNow completed framework creation. A sample scenario is also created for your reference. *"
67
67
  puts "*"*97
68
68
 
69
- puts "\n Would you like to continue with dependency(gems) installation? (Y/n)"
69
+ puts "\n Would you like to continue with dependency(gems) installation? (Y/n) :"
70
70
  ans=gets
71
71
  if ans.chomp.downcase == "y"
72
72
  print "TestNow is installing gems using bundler. Please wait till process completed."
73
- system('gem install bundler')
74
73
  system('bundle install --gemfile=$(pwd)/cucumber_now/Gemfile')
75
74
  print "Dependency installation completed successfully.\n"
76
75
  else
76
+ print "You can do this later also. Just cd into cucumber_now directory and run 'bundle install'\n"
77
77
  exit 1
78
78
  end
79
79
 
80
80
  puts "\n"+"*"*80
81
81
  puts "* Congratulations!!! Your WenDriver-Ruby-Cucumber framework is ready to use. *"
82
- puts "*"*80
82
+ puts "* To run the sample reference test, please cd into cucumber_now directory *"
83
+ puts "* and run the command 'cucumber features' or 'rake cucumber_now' *"
84
+ puts "* A beautiful screenshot embedded report will be created in reports directory. *"
85
+ puts "* !!! HAPPY AUTOMATION !!! *"
86
+ puts "*"*80+"\n"
87
+
88
+ end
89
+
90
+
91
+ def rspec_now
92
+ @root_dir = File.join(FileUtils.pwd, "rspec_now")
93
+ @spec_dir = File.join(@root_dir, "spec")
94
+ @scenario_dir = File.join(@spec_dir, "scenarios")
95
+ @pages_dir = File.join(@root_dir, "pages")
96
+
97
+ if File.exist?(@root_dir)
98
+ print 'There is already rspec_now directory. Either delete it or try running the command from some other directory.'
99
+ exit 1
100
+ end
101
+ puts "\n"+"*"*67
102
+ puts "* TestNow is creating a WebDriver-Ruby-RSpec framework for you. *"
103
+ puts "*"*67
104
+
105
+ print "Creating project directory."
106
+ FileUtils.makedirs(@root_dir)
107
+
108
+ print "Creating spec directory."
109
+ FileUtils.makedirs(@spec_dir)
110
+
111
+ print "Creating the scenarios directory to contain the spec files."
112
+ FileUtils.makedirs(@scenario_dir)
113
+
114
+ print "Creating the page directory just in case if you want to use page object pattern."
115
+ FileUtils.makedirs(@pages_dir)
116
+
117
+ print "Creating config file -- spec_helper.rb -- used for dependency declaration and global setup-teardown"
118
+ FileUtils.copy(@showtime_dir+"/spec_helper.rb", @spec_dir)
119
+
120
+ print "Creating Gemfile -- used to contain all required gems information."
121
+ FileUtils.copy(@showtime_dir+"/Gemfile", @root_dir)
122
+
123
+ print "Creating Rakefile -- used to create automation execution tasks."
124
+ FileUtils.copy(@showtime_dir+"/Rakefile_rspec", @root_dir+"/Rakefile")
125
+
126
+ print "Creating spec file inside the scenarios directory."
127
+ FileUtils.copy(@showtime_dir+"/github_spec.rb", @scenario_dir)
128
+
129
+ print "Creating page class file inside the pages directory."
130
+ FileUtils.copy(@showtime_dir+"/github_page.rb", @pages_dir)
131
+
132
+ puts "\n Would you like to continue with dependency(gems) installation? (Y/n) :"
133
+ ans=gets
134
+ if ans.chomp.downcase == "y"
135
+ print "TestNow is installing gems using bundler. Please wait till process completed."
136
+ system('bundle install --gemfile=$(pwd)/rspec_now/Gemfile')
137
+ print "Dependency installation completed successfully.\n"
138
+ else
139
+ print "You can do this later. Just cd into rspec_now directory and run 'bundle install'\n"
140
+ exit 1
141
+ end
142
+
143
+ puts "\n"+"*"*77
144
+ puts "* Congratulations!!! Your WenDriver-Ruby-RSpec framework is ready to use. *"
145
+ puts "* To run the sample reference test, please cd into rspec_now directory *"
146
+ puts "* and run the command 'rake rspec_now'. Enjoy the show!!! *"
147
+ puts "* A beautiful descriptive report will be created in reports directory. *"
148
+ puts "* !!! HAPPY AUTOMATION !!! *"
149
+ puts "*"*77+"\n"
83
150
 
84
151
  end
85
152
 
153
+
86
154
  def print(msg)
87
155
  puts "\n"
88
156
  puts "=>=>=>=>=> " + msg
@@ -97,16 +165,22 @@ def print_help
97
165
  <command-name> can be one of
98
166
  help
99
167
  cucumber_now
168
+ rspec_now
100
169
  version
101
170
 
102
171
 
103
172
  Command descriptions :
104
173
  help : Prints help information in detail.
105
174
 
106
- cucumber_now : Creates a framework for cross browser testing. This framework acts
107
- as a sketon to add more features for your respective project.
108
- This framework is compatible with the TestNow platform and also
109
- can be used locally.
175
+ cucumber_now : Creates a WebDriver-Ruby-Cucumber skeleton framework for cross
176
+ browser automation testing. Also creates a sample scenario for
177
+ reference which can be used to add more features(tests). This
178
+ framework is compatible with TestNow platform.
179
+
180
+ rspec_now : Creates a WebDriver-Ruby-RSpec skeleton framework for cross
181
+ browser automation testing. Also creates a sample scenario for
182
+ reference which can be used to add more specs(tests). This
183
+ framework is compatible with TestNow platform.
110
184
 
111
185
  version : Prints the gem version
112
186
 
@@ -121,9 +195,11 @@ else
121
195
  print_help
122
196
  elsif cmd == 'cucumber_now'
123
197
  cucumber_now
198
+ elsif cmd == 'rspec_now'
199
+ rspec_now
124
200
  elsif cmd == 'version'
125
201
  puts File.read(File.expand_path("../../lib/testnow/version", __FILE__))
126
202
  else
127
- print_usage
203
+ print_help
128
204
  end
129
205
  end
@@ -3,5 +3,4 @@ gem 'selenium-webdriver'
3
3
  gem 'cucumber'
4
4
  gem 'rspec'
5
5
  gem 'rake'
6
- gem 'page-object'
7
6
  gem 'testnow'
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+ gem 'selenium-webdriver'
3
+ gem 'cucumber'
4
+ gem 'rspec'
5
+ gem 'rake'
6
+ gem 'testnow'
@@ -0,0 +1,7 @@
1
+ require 'rake'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new("rspec_now") do |role|
5
+ role.pattern="spec/scenarios/*_spec.rb"
6
+ role.rspec_opts = ["--format", "html", "--out", "reports/github.html"]
7
+ end
@@ -0,0 +1,18 @@
1
+ require File.join(File.dirname(__FILE__),'/../spec_helper')
2
+
3
+ describe "As a github user, my public profile" do
4
+
5
+ before(:each) do
6
+ @driver.get(ENV['TEST_URL'])
7
+ end
8
+
9
+ it "should display my name" do
10
+ git = GithubPage.new(@driver)
11
+ git.search_github("Kaushal Rupani")
12
+ git.click_tab("Users")
13
+ git.verify_text_presence("Kaushal Rupani")
14
+ git.visit_profile
15
+ git.verify_text_presence("Kaushal Rupani")
16
+ end
17
+
18
+ end
@@ -0,0 +1,20 @@
1
+ require 'rspec'
2
+ require 'selenium-webdriver'
3
+ require 'rake'
4
+ require 'testnow'
5
+
6
+ include RSpec::Matchers
7
+ include TestNow
8
+
9
+ require File.dirname(__FILE__) + "/../pages/github_page"
10
+
11
+ RSpec.configure do |config|
12
+ config.before(:all) do
13
+ ENV['TEST_URL'] = "https://github.com" if ENV['TEST_URL'].nil?
14
+ @driver = TestNow.init
15
+ end
16
+
17
+ config.after(:all) do
18
+ @driver.quit
19
+ end
20
+ end
data/lib/testnow/version CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testnow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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-16 00:00:00.000000000 Z
11
+ date: 2016-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.11.2
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.10.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 1.11.2
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.10.0
13
33
  - !ruby/object:Gem::Dependency
14
34
  name: selenium-webdriver
15
35
  requirement: !ruby/object:Gem::Requirement
@@ -20,7 +40,7 @@ dependencies:
20
40
  - - ">="
21
41
  - !ruby/object:Gem::Version
22
42
  version: '2.52'
23
- type: :runtime
43
+ type: :development
24
44
  prerelease: false
25
45
  version_requirements: !ruby/object:Gem::Requirement
26
46
  requirements:
@@ -30,7 +50,8 @@ dependencies:
30
50
  - - ">="
31
51
  - !ruby/object:Gem::Version
32
52
  version: '2.52'
33
- description: A gem to configure your Ruby Selenium suite for TestNow
53
+ description: A gem to configure your WebDriver-Ruby automation suite for TestNow and
54
+ local
34
55
  email: kushrupani@live.com
35
56
  executables:
36
57
  - testnow
@@ -43,12 +64,16 @@ files:
43
64
  - data/firebug-2.0.13.xpi
44
65
  - data/netExport-0.8.xpi
45
66
  - data/showtime/Gemfile
67
+ - data/showtime/Gemfile_rspec
68
+ - data/showtime/Rakefile_rspec
46
69
  - data/showtime/cucumber.yml
47
70
  - data/showtime/env.rb
48
71
  - data/showtime/github.feature
49
72
  - data/showtime/github_page.rb
73
+ - data/showtime/github_spec.rb
50
74
  - data/showtime/github_steps.rb
51
75
  - data/showtime/hooks.rb
76
+ - data/showtime/spec_helper.rb
52
77
  - lib/testnow.rb
53
78
  - lib/testnow/chrome.rb
54
79
  - lib/testnow/firefox.rb
@@ -79,7 +104,7 @@ rubyforge_project:
79
104
  rubygems_version: 2.5.1
80
105
  signing_key:
81
106
  specification_version: 4
82
- summary: TestNow helper
107
+ summary: 'TestNow gem : Automate in a BDD + Cross Browser style'
83
108
  test_files:
84
109
  - spec/spec_helper.rb
85
110
  - spec/testnow/testnow_spec.rb