quintocumber 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ecb21b193b7ae698169b5eaf333f9f6a514a31e3
4
+ data.tar.gz: ffec7d41fbbc13d814f23e7450bff29b4408e642
5
+ SHA512:
6
+ metadata.gz: a44e670f21645b9dfceba858c26424ffa808ab7c42c9d9e0898c46a61a7c55186604cc072c7ba449829a2296abb7aa63677ace3a8ca077da3b2584a769bd9336
7
+ data.tar.gz: 2068b3cec475349263275f5e43ec56211b417c55b42de7fcf2f00ea193247553360447a306c1080f0b2db6aa5cdc3a5c626e1e71abafb4653f8861e946f9c349
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ tmp/
2
+ .DS_Store
3
+ Gemfile.lock
4
+ quintocumber-*.gem
5
+ pkg/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in quintocumber.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Diego Queiroz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Quintocumber
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/quintocumber`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'quintocumber'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install quintocumber
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/quintoandar/quintocumber.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "quintocumber"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/quintocumber ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'cucumber/cli/main'
3
+
4
+ loader_file = File.join(File.dirname(__FILE__), "../lib/loader.rb")
5
+
6
+ cmd_args = "#{ARGV.join(' ')}"
7
+
8
+ args = "--format pretty --format AllureCucumber::Formatter --out reports --require #{loader_file} #{cmd_args}".split(/\s+/)
9
+
10
+ Cucumber::Cli::Main.new(args).execute!
@@ -0,0 +1,16 @@
1
+ server: hub-cloud.browserstack.com
2
+ common_caps:
3
+ project: UNKOWN PROJECT
4
+ browser_caps:
5
+ chrome:
6
+ browser: chrome
7
+ version: 59
8
+ os: windows
9
+ os_version: 10
10
+ resolution: 1366x768
11
+ safari:
12
+ browser: safari
13
+ version: 9.1
14
+ os: OS X
15
+ os_version: El Capitan
16
+ resolution: 1600x1200
@@ -0,0 +1,74 @@
1
+ require 'capybara/cucumber'
2
+
3
+ #Get browserstack configuration from browserstack.yml
4
+ #and override credentials if credentials are set in env variables
5
+ BROWSERSTACK_DEFAULT_CONFIG = YAML.load(File.read(File.join(File.dirname(__FILE__), "./browserstack.yml")))
6
+
7
+ browserstack_project_config_filename = File.join(Dir.pwd, "./browserstack.yml")
8
+ if File.file?(browserstack_project_config_filename)
9
+ BROWSERSTACK_PROJECT_CONFIG = YAML.load(File.read(browserstack_project_config_filename)) || Hash.new
10
+ else
11
+ BROWSERSTACK_PROJECT_CONFIG = Hash.new
12
+ end
13
+
14
+
15
+ BROWSERSTACK_CONFIG = BROWSERSTACK_DEFAULT_CONFIG.merge(BROWSERSTACK_PROJECT_CONFIG)
16
+
17
+ BROWSERSTACK_CONFIG['user'] = ENV['BROWSERSTACK_USERNAME'] || BROWSERSTACK_CONFIG['user']
18
+ BROWSERSTACK_CONFIG['key'] = ENV['BROWSERSTACK_ACCESS_KEY'] || BROWSERSTACK_CONFIG['key']
19
+
20
+ #Only user browserstack if credentials are set
21
+ if BROWSERSTACK_CONFIG['user'] && BROWSERSTACK_CONFIG['key']
22
+ #Register browserstack remote driver into Capybara context
23
+ Capybara.register_driver :browserstack do |app|
24
+
25
+ #check if target browser is properly configured in browsertack.yaml
26
+ #if no target browser is defined, skip verification due to later override
27
+ if ENV['TEST_BROWSER'] && BROWSERSTACK_CONFIG['browser_caps'][ENV['TEST_BROWSER']].nil?
28
+ raise 'Remote browser not configured in browsertack.yaml'
29
+ end
30
+
31
+ test_browser = ENV['TEST_BROWSER'] || 'chrome'
32
+
33
+ #merge common capabilities and browser capabilities (if not browser is set, deafults to chrome)
34
+ @caps = BROWSERSTACK_CONFIG['common_caps'].merge(BROWSERSTACK_CONFIG['browser_caps'][test_browser])
35
+
36
+ #sets timestamp as build name along with target browser
37
+ @caps['build'] = "#{Time.now.utc.iso8601} - #{test_browser}"
38
+
39
+ #all set, instanciate new remote broser
40
+ Capybara::Selenium::Driver.new(app,
41
+ :browser => :remote,
42
+ :url => "http://#{BROWSERSTACK_CONFIG['user']}:#{BROWSERSTACK_CONFIG['key']}@#{BROWSERSTACK_CONFIG['server']}/wd/hub",
43
+ :desired_capabilities => @caps
44
+ )
45
+ end
46
+
47
+ #set browserstack as default browser
48
+ Capybara.default_driver = :browserstack
49
+ end
50
+
51
+
52
+ #Re-register browserstack remote browser before each scenario run to ensure
53
+ #browserstack will receive scenario name as test name
54
+ Before do |scenario|
55
+
56
+ #Only re-register if browserstack is the current driver
57
+ if Capybara.current_driver == :browserstack
58
+
59
+ #Get current options to override later
60
+ opts = Capybara.current_session.driver.options
61
+
62
+ #Put scenario name on options
63
+ opts[:desired_capabilities] = opts[:desired_capabilities].merge({"name" => scenario.name})
64
+
65
+ #Re-register browserstack with new options
66
+ Capybara.register_driver :browserstack do |app|
67
+ Capybara::Selenium::Driver.new(app, opts)
68
+ end
69
+
70
+ #Ensure Capybara will get the most recent driver registered (Kinda MAGIC; don't touch)
71
+ Capybara.current_driver = :browserstack
72
+ end
73
+ end
74
+
@@ -0,0 +1,4 @@
1
+ Capybara.register_driver :wip do |app|
2
+ test_browser = ENV['TEST_BROWSER'] || "firefox"
3
+ Capybara::Selenium::Driver.new(app, browser: test_browser.to_sym)
4
+ end
@@ -0,0 +1,12 @@
1
+ AfterConfiguration do |config|
2
+ config.on_event :after_test_step do |event|
3
+ if not event.result.ok?
4
+ filename = "#{event.test_case.name}/#{event.test_step.name}.png"
5
+ Capybara.page.save_screenshot(filename)
6
+ class Includer
7
+ extend AllureCucumber::DSL
8
+ end
9
+ Includer.attach_file(filename, File.open(File.join(Dir.pwd, Capybara.save_path, "#{filename}")))
10
+ end
11
+ end
12
+ end
data/lib/env.rb ADDED
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+ require 'selenium/webdriver'
3
+ require 'rspec'
4
+ require 'capybara/cucumber'
5
+ require 'site_prism'
6
+ require 'allure-cucumber'
7
+ require 'rspec/expectations'
8
+
9
+ Capybara.default_max_wait_time = 10
10
+ Capybara.save_path = "screenshots/"
11
+
12
+ After do |scenario|
13
+ Capybara.current_session.driver.quit()
14
+ end
15
+
16
+ Capybara.default_driver = :wip
data/lib/loader.rb ADDED
@@ -0,0 +1,9 @@
1
+ require_relative "env"
2
+
3
+ Dir[File.join(File.dirname(__FILE__), "config/**/*.rb")].each do |file|
4
+ require file
5
+ end
6
+
7
+ Dir[File.join(Dir.pwd, "features/**/*.rb")].each do |file|
8
+ require file
9
+ end
@@ -0,0 +1,3 @@
1
+ module Quintocumber
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,5 @@
1
+ require "quintocumber/version"
2
+
3
+ module Quintocumber
4
+ # Your code goes here...
5
+ end
data/lib/runner.rb ADDED
@@ -0,0 +1,7 @@
1
+ require 'cucumber/cli/main'
2
+
3
+ loader_file = File.join(File.dirname(__FILE__), "loader.rb")
4
+
5
+ args = "--verbose --require #{loader_file}".split(/\s+/)
6
+
7
+ Cucumber::Cli::Main.new(args).execute!
@@ -0,0 +1,45 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "quintocumber/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "quintocumber"
8
+ spec.version = Quintocumber::VERSION
9
+ spec.authors = ["Diego Queiroz"]
10
+ spec.email = ["dqueiroz@quintoandar.com.br"]
11
+
12
+ spec.summary = %q{Cucumber on steroids}
13
+ spec.description = %q{Cucumber with some additional support: Capybara, Browsertack, Allure reports, Rspec and SitePrism}
14
+ spec.homepage = "https://github.com/quintoandar/quintocumber"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ # if spec.respond_to?(:metadata)
20
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
21
+ # else
22
+ # raise "RubyGems 2.0 or newer is required to protect against " \
23
+ # "public gem pushes."
24
+ # end
25
+
26
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
+ f.match(%r{^(test|spec|features)/})
28
+ end
29
+ spec.executables = ["quintocumber"]
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+ spec.add_development_dependency "bundler", "~> 1.15"
35
+ spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency "cucumber", "~> 2.4"
37
+ spec.add_development_dependency "aruba", "~> 0.7"
38
+
39
+ spec.add_dependency "cucumber", "~> 2.4"
40
+ spec.add_dependency "rspec", "~> 3.6"
41
+ spec.add_dependency "site_prism", "~> 2.9"
42
+ spec.add_dependency "capybara", "~> 2.14"
43
+ spec.add_dependency "selenium-webdriver", "~> 3.4"
44
+ spec.add_dependency "allure-cucumber", "~> 0.5"
45
+ end
metadata ADDED
@@ -0,0 +1,204 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: quintocumber
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Diego Queiroz
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-07-18 00:00:00.000000000 Z
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.15'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: cucumber
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.4'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: aruba
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.7'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.7'
69
+ - !ruby/object:Gem::Dependency
70
+ name: cucumber
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.4'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.4'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.6'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.6'
97
+ - !ruby/object:Gem::Dependency
98
+ name: site_prism
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.9'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.9'
111
+ - !ruby/object:Gem::Dependency
112
+ name: capybara
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.14'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.14'
125
+ - !ruby/object:Gem::Dependency
126
+ name: selenium-webdriver
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.4'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.4'
139
+ - !ruby/object:Gem::Dependency
140
+ name: allure-cucumber
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.5'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.5'
153
+ description: 'Cucumber with some additional support: Capybara, Browsertack, Allure
154
+ reports, Rspec and SitePrism'
155
+ email:
156
+ - dqueiroz@quintoandar.com.br
157
+ executables:
158
+ - quintocumber
159
+ extensions: []
160
+ extra_rdoc_files: []
161
+ files:
162
+ - ".gitignore"
163
+ - Gemfile
164
+ - LICENSE.txt
165
+ - README.md
166
+ - Rakefile
167
+ - bin/console
168
+ - bin/setup
169
+ - exe/quintocumber
170
+ - lib/config/browserstack.yml
171
+ - lib/config/browserstack_config.rb
172
+ - lib/config/local_config.rb
173
+ - lib/config/screeshot_hooks.rb
174
+ - lib/env.rb
175
+ - lib/loader.rb
176
+ - lib/quintocumber.rb
177
+ - lib/quintocumber/version.rb
178
+ - lib/runner.rb
179
+ - quintocumber.gemspec
180
+ homepage: https://github.com/quintoandar/quintocumber
181
+ licenses:
182
+ - MIT
183
+ metadata: {}
184
+ post_install_message:
185
+ rdoc_options: []
186
+ require_paths:
187
+ - lib
188
+ required_ruby_version: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ required_rubygems_version: !ruby/object:Gem::Requirement
194
+ requirements:
195
+ - - ">="
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ requirements: []
199
+ rubyforge_project:
200
+ rubygems_version: 2.6.12
201
+ signing_key:
202
+ specification_version: 4
203
+ summary: Cucumber on steroids
204
+ test_files: []