frameworks-capybara 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/frameworks-capybara.gemspec +3 -2
- data/lib/tasks/frameworks-tasks.rake +75 -0
- metadata +5 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/frameworks-capybara.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{frameworks-capybara}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["mcrmfc"]
|
12
|
-
s.date = %q{2012-01-
|
12
|
+
s.date = %q{2012-01-23}
|
13
13
|
s.description = %q{gem to aid setup of Capybara for testing bbc sites}
|
14
14
|
s.email = %q{mcrobbins@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
"lib/monkey-patches/mechanize-patches.rb",
|
36
36
|
"lib/monkey-patches/send-keys.rb",
|
37
37
|
"lib/monkey-patches/webdriver-patches.rb",
|
38
|
+
"lib/tasks/frameworks-tasks.rake",
|
38
39
|
"schemas/xhtml-lat1.ent",
|
39
40
|
"schemas/xhtml-rdfa-1.dtd",
|
40
41
|
"schemas/xhtml-special.ent",
|
@@ -0,0 +1,75 @@
|
|
1
|
+
INVOKE_CUCUMBER = "bin/cucumber"
|
2
|
+
|
3
|
+
task :install do
|
4
|
+
system('bundle install --no-cache --binstubs --path vendor/bundle')
|
5
|
+
end
|
6
|
+
|
7
|
+
def color(text, options = {})
|
8
|
+
#ANSI color codes
|
9
|
+
case options[:color]
|
10
|
+
when :red
|
11
|
+
text = "\033[31m#{text}\033[0m"
|
12
|
+
when :green
|
13
|
+
text = "\033[32m#{text}\033[0m"
|
14
|
+
when :yellow
|
15
|
+
text = "\033[33m#{text}\033[0m"
|
16
|
+
end
|
17
|
+
text
|
18
|
+
end
|
19
|
+
|
20
|
+
task :list_profiles do
|
21
|
+
puts 'Available profiles:'
|
22
|
+
f = File.open('config/cucumber.yml', 'r')
|
23
|
+
linenum = 0
|
24
|
+
@profiles = {}
|
25
|
+
f.read.each do |line|
|
26
|
+
line.scan(/.*?: /) do |match|
|
27
|
+
linenum += 1
|
28
|
+
puts color(linenum.to_s + '. ', :color => :yellow) + color(match.gsub(':',''), :color => :green)
|
29
|
+
@profiles[linenum.to_s] = match.gsub(':','')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
task :update do
|
35
|
+
system('bundle update')
|
36
|
+
end
|
37
|
+
|
38
|
+
task :run_feature, :feature, :profile do |t, args|
|
39
|
+
args.with_defaults(:profile => 'default')
|
40
|
+
system("#{INVOKE_CUCUMBER} -p #{args[:profile]} features/#{args[:feature]}.feature")
|
41
|
+
end
|
42
|
+
|
43
|
+
task :run_profile, :profile do |t, args|
|
44
|
+
args.with_defaults(:profile => 'default')
|
45
|
+
system("#{INVOKE_CUCUMBER} -p #{args[:profile]}")
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
task :start_app do
|
50
|
+
$: << File.dirname( __FILE__)
|
51
|
+
require 'lib/spec/test_app'
|
52
|
+
Rack::Handler::WEBrick.run TestApp, :Port => 8070
|
53
|
+
end
|
54
|
+
|
55
|
+
task :run_local do
|
56
|
+
if(RUBY_PLATFORM == 'java')
|
57
|
+
abort color("This script only works if you are running on MRI ('normal') Ruby....sorry....", :color => :red)
|
58
|
+
end
|
59
|
+
puts color('*********************************************',:color => :green)
|
60
|
+
puts color('* *',:color => :green)
|
61
|
+
puts color('* Cucumber Acceptance Tests *',:color => :green)
|
62
|
+
puts color('* Pre-Requisites: *',:color => :green)
|
63
|
+
puts color('* ruby 1.8.7, bundler, rake *',:color => :green)
|
64
|
+
puts color('* *',:color => :green)
|
65
|
+
puts color('*********************************************',:color => :green)
|
66
|
+
Rake::Task[:list_profiles].invoke
|
67
|
+
puts 'Above is a list of the available profiles, please enter the number of the profile you wish to run: '
|
68
|
+
profile = STDIN.gets.chomp
|
69
|
+
#TODO: Add some input validation?
|
70
|
+
puts "The profile chosen is: #{color(@profiles[profile], :color => :red)}"
|
71
|
+
puts 'Preparing to bundle required gems...'
|
72
|
+
Rake::Task[:install].invoke
|
73
|
+
puts 'Preparing to run tests...'
|
74
|
+
Rake::Task[:run_profile].invoke(@profiles[profile])
|
75
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frameworks-capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- mcrmfc
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-23 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -236,6 +236,7 @@ files:
|
|
236
236
|
- lib/monkey-patches/mechanize-patches.rb
|
237
237
|
- lib/monkey-patches/send-keys.rb
|
238
238
|
- lib/monkey-patches/webdriver-patches.rb
|
239
|
+
- lib/tasks/frameworks-tasks.rake
|
239
240
|
- schemas/xhtml-lat1.ent
|
240
241
|
- schemas/xhtml-rdfa-1.dtd
|
241
242
|
- schemas/xhtml-special.ent
|