bddfire 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +46 -7
- data/bddfire.gemspec +4 -2
- data/lib/bddfire/api/rest-api.rb +92 -0
- data/lib/bddfire/require.rb +1 -0
- data/lib/bddfire/version.rb +1 -1
- data/pre-defined-steps/rest_api_steps.md +41 -0
- data/scaffold/config_files/Gemfile +1 -0
- data/scaffold/config_files/README.md +24 -59
- data/scaffold/config_files/Rakefile +4 -0
- data/scaffold/config_files/cucumber.yml +1 -0
- data/scaffold/features/api.feature +104 -0
- data/scaffold/features/support/env.rb +1 -0
- metadata +50 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6392e919e43057fd4d845d80e4fd2b6f70ef73ff
|
4
|
+
data.tar.gz: b7a340e94ffd768c56b8ed2bec8e7947421e5ff4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd8313c1072d27bc8b60e72af79b358124a53d8907eed2fb956d691834fcf98601f5216b8c7ec18c0fc1a84782a658fde5f95f3ace6ae3a319bdcc3c43d7a87b
|
7
|
+
data.tar.gz: 63bcfb6a7b83a0b1781d096eca87ddd60529a5a402c4f4491336ba30b0c548263c875c169741de84f4b15c6561ee517b36bc5a9c56a7f054d8865040bae28131
|
data/README.markdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# bddfire
|
2
2
|
|
3
|
-
BDDfire: Automate Mobile & Web apps with less code. An instant Ruby-Cucumber BDD framework which supports various popular open-source libraries like Capybara, Selenium-WebDriver, Poltergeist, Relish, Cuke_sniffer, Rubocop, Appium, Saucelabs, Browserstack. Generate default toolkit around BDD with cucumber and friends. It also added support for Docker, Gatling, Axe Accessibility Engine
|
3
|
+
BDDfire: Automate Mobile & Web apps with less code. An instant Ruby-Cucumber BDD framework which supports various popular open-source libraries like Capybara, Selenium-WebDriver, Poltergeist, Relish, Cuke_sniffer, Rubocop, Appium, Saucelabs, Browserstack. Generate default toolkit around BDD with cucumber and friends. BDDfire can do API testing with RestClient. It also added support for Docker, Gatling, Axe Accessibility Engine
|
4
4
|
|
5
5
|
### BDDfire: Instant Ruby-Cucumber Framework with Docker, Gatling, Accessibility Support
|
6
6
|
|
@@ -21,13 +21,23 @@ or include it into the Gemfile
|
|
21
21
|
$ bddfire fire_cucumber
|
22
22
|
|
23
23
|
|
24
|
-
This will create 'cucumber' directory and one command will install Ruby Cucumber framework with all possibly supported tools in the 'cucumber' directory.
|
24
|
+
This will create 'cucumber' directory and one command will install Ruby Cucumber framework with all possibly supported tools in the 'cucumber' directory.
|
25
|
+
|
26
|
+
It will look like this :
|
27
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_setup.gif)
|
28
|
+
|
29
|
+
And running your first cucumber test with BDDfire as simpe as this :
|
30
|
+
|
31
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_cucumber.gif)
|
32
|
+
|
33
|
+
This will create all the directories and files to support following tools
|
25
34
|
* Capybara
|
26
35
|
* Selenium-Webdriver
|
27
36
|
* Poltergeist: PhantomJS based headless driver for capybara
|
28
37
|
* Docker support to execute scenarios inside docker containers
|
29
38
|
* Run scenarios in parallel 10 processes and rerun failed scenarios.
|
30
39
|
* Appium : Mobile test automation Framework
|
40
|
+
* API Testing : BDDfire uses RestClient to perform API testing
|
31
41
|
* Saucelabs : Cloud testing framework
|
32
42
|
* Browserstack : Cloud testing framework
|
33
43
|
* TestingBot : Cloud testing framework
|
@@ -36,11 +46,18 @@ This will create 'cucumber' directory and one command will install Ruby Cucumber
|
|
36
46
|
* Rubocop : Ruby code review tool
|
37
47
|
* CI Support Script
|
38
48
|
|
49
|
+
## API Testing
|
50
|
+
|
51
|
+
BDDfire has inbuilt support for the API Testing. BDDfire uses RestClient to make requests to URI.
|
52
|
+
|
53
|
+
You can use predefined API Steps [API based](https://github.com/Shashikant86/bddfire/blob/master/pre-defined-steps/rest_api_steps.md)
|
54
|
+
|
39
55
|
## Load Testing : Gatling
|
40
56
|
You can optionally install Gatling load testing setup.
|
41
57
|
|
42
58
|
$ bddfire fire_load
|
43
59
|
It will setup Load testing environment with gatling. It will create 'load' directory. It's optional but BDDfire will support it to execute your load tests.
|
60
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_load.gif)
|
44
61
|
|
45
62
|
## Accessibility Testing : Axe Engine
|
46
63
|
You can optionally setup Accessibility Testing setup support Axe Engine
|
@@ -48,11 +65,14 @@ You can optionally setup Accessibility Testing setup support Axe Engine
|
|
48
65
|
$ bddfire fire_accessibility
|
49
66
|
|
50
67
|
It will setup accessibility frameworks in the 'accessibility' directory. It uses Axe engine to run accessibility tests.
|
68
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_accessibility.gif)
|
51
69
|
|
52
70
|
## Docker Support
|
53
71
|
|
54
72
|
BDDfire allow you execute your cucumber scenarios inside Docker containers. Scenarios with Poltergeist driver can be ran inside containers. One script will do everything for you !
|
55
73
|
|
74
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_docker.gif)
|
75
|
+
|
56
76
|
|
57
77
|
### Install & Run BDDfire framework
|
58
78
|
|
@@ -62,7 +82,7 @@ Install your skeleton framework with BDDfire
|
|
62
82
|
$ bddfire fire_load
|
63
83
|
$ bddfire fire_accessibility
|
64
84
|
|
65
|
-
#####
|
85
|
+
##### YOUTUBE VIDEO :
|
66
86
|
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/qr8jLmOd-mM/0.jpg)](http://www.youtube.com/watch?v=qr8jLmOd-mM)
|
67
87
|
|
68
88
|
Now you should have your framework ready inside 'cucumber' directory. Just install predefine Gems or you can add your own Gems.
|
@@ -72,6 +92,8 @@ Now you should have your framework ready inside 'cucumber' directory. Just insta
|
|
72
92
|
|
73
93
|
Once installed, you can run cucumber with multiple cabybara driver
|
74
94
|
|
95
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_cucumber.gif)
|
96
|
+
|
75
97
|
#Usage
|
76
98
|
## BDDfire Pre-defined-steps
|
77
99
|
BDDfire allow us to use predefined steps so that we don't have to write more code while writing cucumber steps. BDDfire has following predefined steps which can be used anytime during your project.
|
@@ -83,6 +105,10 @@ You can use[Browser based](https://github.com/Shashikant86/bddfire/blob/master/p
|
|
83
105
|
### Poltergeist Based Pre-defined-steps
|
84
106
|
You can use headless Poltergeist based [headless Poltergeist based](https://github.com/Shashikant86/bddfire/blob/master/pre-defined-steps/headless_steps.md) steps
|
85
107
|
|
108
|
+
### API Based Pre-defined Steps
|
109
|
+
|
110
|
+
Just tag your scenario/feature with @api and You can use inbuilt predefined API Steps [API based](https://github.com/Shashikant86/bddfire/blob/master/pre-defined-steps/rest_api_steps.md)
|
111
|
+
|
86
112
|
### Accessibility related Pre-defined-steps
|
87
113
|
|
88
114
|
You can also use [Accessibility steps](https://github.com/Shashikant86/bddfire/blob/major-refactor/pre-defined-steps/accessibility_steps.md)
|
@@ -109,6 +135,16 @@ You can run your scenarios in Google Chrome
|
|
109
135
|
|
110
136
|
$ bundle exec rake chrome
|
111
137
|
|
138
|
+
### REST API Testing
|
139
|
+
You can run your scenarios in Google Chrome
|
140
|
+
|
141
|
+
$ bundle exec rake api
|
142
|
+
|
143
|
+
|
144
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_rest_api.gif)
|
145
|
+
|
146
|
+
|
147
|
+
|
112
148
|
###Cloud Testing Frameworks
|
113
149
|
Please enter your USERNAME and KEY in the env.rb file
|
114
150
|
|
@@ -153,9 +189,10 @@ This will report all the offence in rubocop.
|
|
153
189
|
We can run our cucumber scenario inside Docker containers. Assuming you have Docker installed. Check your Docker installation before using.
|
154
190
|
|
155
191
|
$ bundle exec rake docker
|
156
|
-
This will build Docker image 'bddfire-ci' and run cucumber scenarios inside container 'bddfire-ci'.
|
192
|
+
This will build Docker image 'bddfire-ci' and run cucumber scenarios inside container 'bddfire-ci'.
|
193
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_docker.gif)
|
157
194
|
|
158
|
-
#####
|
195
|
+
##### YOUTUBE VIDEO
|
159
196
|
|
160
197
|
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/MQub3qHRwkM/0.jpg)](http://www.youtube.com/watch?v=MQub3qHRwkM)
|
161
198
|
|
@@ -166,10 +203,11 @@ You can use Gatling setup to execute load tests against your endpoints. Simply c
|
|
166
203
|
$ cd load
|
167
204
|
$ sh gatling_local.sh
|
168
205
|
This will run load tests against your url. You are free to record new simulations. Once finished there will be link to HTML report at the end.
|
206
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_load.gif)
|
169
207
|
|
170
208
|
There is CI integration to plug it with jenkins.
|
171
209
|
|
172
|
-
#####
|
210
|
+
##### YOUTUBE VIDEO
|
173
211
|
|
174
212
|
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/h6MBXGAeUVY/0.jpg)](http://www.youtube.com/watch?v=h6MBXGAeUVY)
|
175
213
|
|
@@ -181,7 +219,8 @@ We can run accessibility checks on our web page using BDDfire. You have to pass
|
|
181
219
|
$ cd accessibility
|
182
220
|
$ bundle exec cucumber -r features URL="http://www.google.co.uk"
|
183
221
|
|
184
|
-
|
222
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_accessibility.gif)
|
223
|
+
##### YOUTUBE VIDEO
|
185
224
|
|
186
225
|
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/aGPO_Bt5nmw/0.jpg)](http://www.youtube.com/watch?v=qr8jLmOd-mM)
|
187
226
|
|
data/bddfire.gemspec
CHANGED
@@ -12,18 +12,20 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.license = 'MIT'
|
13
13
|
s.required_ruby_version = '>= 1.9.3'
|
14
14
|
s.summary = 'BDDfire: Automate Mobile & Web apps with less code. An instant Ruby-Cucumber BDD framework'
|
15
|
-
s.description = '
|
15
|
+
s.description = 'A Wholesale framework for web, mobile, api, load, accessibility testing. Get you going in a minute. An instant setup of Ruby, Cucumber, Capybara, selenium, REST API Appium, Docker, Gatling and Axe Engine'
|
16
16
|
s.add_runtime_dependency "bundler"
|
17
17
|
s.add_runtime_dependency "cucumber", '~> 2.3', '>= 2.3'
|
18
18
|
s.add_runtime_dependency "capybara", '~> 2.6', '>= 2.4'
|
19
19
|
s.add_runtime_dependency "rspec", '~> 3.4', '>= 3.0.0'
|
20
20
|
s.add_runtime_dependency "selenium-webdriver", '~> 2.52', '>= 2.52'
|
21
21
|
s.add_runtime_dependency "axe-matchers", '~> 1.1.1', '>= 1.0.0'
|
22
|
+
s.add_runtime_dependency 'rest-client', '~> 1.8.0', '>= 1.7.3'
|
23
|
+
s.add_runtime_dependency 'json', '~> 1.8.3', '>= 1.7.3'
|
22
24
|
s.add_runtime_dependency 'be_valid_asset', '~> 1.3', '>= 1.3.0'
|
23
25
|
s.add_runtime_dependency 'require_all', '~> 1.3.1', '>= 1.3.0'
|
24
26
|
s.files = `git ls-files`.split("\n")
|
25
27
|
s.test_files = `git ls-files -- {features}/*`.split("\n")
|
26
28
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
27
29
|
s.require_paths = ['lib']
|
28
|
-
s.post_install_message = 'Thanks for installing BDDfire
|
30
|
+
s.post_install_message = '======== Thanks for installing BDDfire. You can now perform Web, API, Mobile, Accessibility, Load Testing with single framework !!==================== '
|
29
31
|
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
|
2
|
+
When /^I send a (GET|PUT|POST|DELETE) request (?:for|to) "([^"]*)"(?: with the following:)?$/ do |*args|
|
3
|
+
request_type = args.shift.downcase
|
4
|
+
url = args.shift
|
5
|
+
payload = args.shift
|
6
|
+
|
7
|
+
if (payload.nil? && request_type == 'get')
|
8
|
+
@response = RestClient.get url
|
9
|
+
elsif (payload.nil? && request_type == 'delete')
|
10
|
+
@response = RestClient.delete url
|
11
|
+
elsif (payload && request_type == 'get')
|
12
|
+
@response = RestClient.get url, payload
|
13
|
+
elsif (payload && request_type == 'post')
|
14
|
+
@response = RestClient.post url, payload
|
15
|
+
elsif (payload && request_type == 'put')
|
16
|
+
@response = RestClient.post url, payload
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
Then(/^the response should be JSON$/) do
|
21
|
+
@data = JSON.parse(@response)
|
22
|
+
expect(@data).not_to be_empty
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
Then(/^the response status code should be '(\d+)'$/) do |code|
|
27
|
+
status_code = @response.code
|
28
|
+
expect(status_code).to be == code.to_i
|
29
|
+
end
|
30
|
+
|
31
|
+
Then(/^the JSON response should have '(\d+)' properties$/) do |count|
|
32
|
+
expect(@data.keys.count).to be == count.to_i
|
33
|
+
end
|
34
|
+
|
35
|
+
Then(/^the JSON response has a "([^"]*)" property$/) do |property|
|
36
|
+
json_property = @data.has_key?(property)
|
37
|
+
expect(json_property).to be_truthy
|
38
|
+
end
|
39
|
+
|
40
|
+
Then(/^the JSON "([^"]*)" property equals "([^"]*)"$/) do |property, value|
|
41
|
+
expect(@data[property]).to be == value
|
42
|
+
end
|
43
|
+
|
44
|
+
Then(/^the JSON response header has key "([^"]*)" with value of "([^"]*)"$/) do |key, value|
|
45
|
+
@headers = @response.headers
|
46
|
+
expect(@headers.keys).to include(key.to_sym)
|
47
|
+
expect(@headers.values).to include(value)
|
48
|
+
end
|
49
|
+
|
50
|
+
Then(/^the JSON response should be$/) do |string|
|
51
|
+
actual = JSON.parse(string)
|
52
|
+
expect(@data).to be == actual
|
53
|
+
end
|
54
|
+
|
55
|
+
Then(/^the response should be XML$/) do
|
56
|
+
@xml_data = Nokogiri::XML(@response)
|
57
|
+
expect(@xml_data).not_to be_empty
|
58
|
+
end
|
59
|
+
|
60
|
+
Then /^the XML response should (not)?\s?have "([^"]*)"$/ do |negative, xpath|
|
61
|
+
parsed_response = Nokogiri::XML(@response)
|
62
|
+
elements = parsed_response.xpath(xpath)
|
63
|
+
if self.respond_to?(:expect)
|
64
|
+
if negative.present?
|
65
|
+
expect(elements).to be_empty
|
66
|
+
else
|
67
|
+
expect(elements).not_to be_empty
|
68
|
+
end
|
69
|
+
else
|
70
|
+
if negative.present?
|
71
|
+
assert elements.empty?
|
72
|
+
else
|
73
|
+
assert !elements.empty?
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
Then /^the XML response should have "([^"]*)" with the text "([^"]*)"$/ do |xpath, text|
|
79
|
+
parsed_response = Nokogiri::XML(@response)
|
80
|
+
elements = parsed_response.xpath(xpath)
|
81
|
+
if self.respond_to?(:expect)
|
82
|
+
expect(elements).not_to be_empty, "could not find #{xpath} in:\n#{last_response.body}"
|
83
|
+
expect(elements.find { |e| e.text == text }).not_to be_nil, "found elements but could not find #{text} in:\n#{elements.inspect}"
|
84
|
+
else
|
85
|
+
assert !elements.empty?, "could not find #{xpath} in:\n#{last_response.body}"
|
86
|
+
assert elements.find { |e| e.text == text }, "found elements but could not find #{text} in:\n#{elements.inspect}"
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
data/lib/bddfire/require.rb
CHANGED
@@ -3,3 +3,4 @@ Dir[File.dirname(__FILE__) + '/mobile/*.rb'].each { |file| require file }
|
|
3
3
|
Dir[File.dirname(__FILE__) + '/assertions/*.rb'].each { |file| require file }
|
4
4
|
Dir[File.dirname(__FILE__) + '/page-objects/*.rb'].each { |file| require file }
|
5
5
|
Dir[File.dirname(__FILE__) + '/accessibility/*.rb'].each { |file| require file }
|
6
|
+
Dir[File.dirname(__FILE__) + '/api/*.rb'].each { |file| require file }
|
data/lib/bddfire/version.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
# REST API Testing
|
2
|
+
|
3
|
+
You need to tag your feature/scenario with @api to use
|
4
|
+
|
5
|
+
## TEST JSON RESPONSE
|
6
|
+
|
7
|
+
Given I send a GET request for "<your_uri>"
|
8
|
+
|
9
|
+
Given I send a GET/PUT/POST/DELETE request for "<your_uri>" with the following:
|
10
|
+
"""
|
11
|
+
<your_payload>
|
12
|
+
"""
|
13
|
+
|
14
|
+
Then the response should be JSON
|
15
|
+
|
16
|
+
Then the response status code should be '200'
|
17
|
+
|
18
|
+
Then the JSON response should have '<number_of_properties>' properties
|
19
|
+
|
20
|
+
Then the JSON response has a "<id_of_property>" property
|
21
|
+
|
22
|
+
Then the JSON "<id_of_property>" property equals "<value_of_property>"
|
23
|
+
|
24
|
+
Then the JSON response header has key "<header_name>" with value of "<header_name>"
|
25
|
+
|
26
|
+
Then /^the JSON response should be:
|
27
|
+
"""
|
28
|
+
<your_json>
|
29
|
+
"""
|
30
|
+
|
31
|
+
## TEST XML RESPONSE
|
32
|
+
|
33
|
+
Given I send a GET request for "<your_uri>"
|
34
|
+
|
35
|
+
Then the XML response should have "<your_tag>" with text "<your_text>"
|
36
|
+
|
37
|
+
Then the response status code should be '200'
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
@@ -1,33 +1,15 @@
|
|
1
1
|
# bddfire
|
2
2
|
|
3
|
-
|
3
|
+
Thanks for installing your Ruby-Cucumber framework with BDDfire.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Assuming you got Ruby installed. You can run
|
10
|
-
|
11
|
-
$ gem install bddfire
|
12
|
-
|
13
|
-
or include it into the Gemfile
|
14
|
-
|
15
|
-
gem 'bddfire'
|
16
|
-
|
17
|
-
## Usage
|
18
|
-
|
19
|
-
### Instant Ruby Cucumber Framework
|
20
|
-
|
21
|
-
$ bddfire fire_cucumber
|
22
|
-
|
23
|
-
|
24
|
-
This will create 'cucumber' directory and one command will install Ruby Cucumber framework with all possibly supported tools in the 'cucumber' directory. This will create all the directories and files to support following tools
|
5
|
+
This will create all the directories and files to support following tools
|
25
6
|
* Capybara
|
26
7
|
* Selenium-Webdriver
|
27
8
|
* Poltergeist: PhantomJS based headless driver for capybara
|
28
9
|
* Docker support to execute scenarios inside docker containers
|
29
10
|
* Run scenarios in parallel 10 processes and rerun failed scenarios.
|
30
11
|
* Appium : Mobile test automation Framework
|
12
|
+
* API Testing : BDDfire uses RestClient to perform API testing
|
31
13
|
* Saucelabs : Cloud testing framework
|
32
14
|
* Browserstack : Cloud testing framework
|
33
15
|
* TestingBot : Cloud testing framework
|
@@ -36,34 +18,6 @@ This will create 'cucumber' directory and one command will install Ruby Cucumber
|
|
36
18
|
* Rubocop : Ruby code review tool
|
37
19
|
* CI Support Script
|
38
20
|
|
39
|
-
## Load Testing : Gatling
|
40
|
-
You can optionally install Gatling load testing setup.
|
41
|
-
|
42
|
-
$ bddfire fire_load
|
43
|
-
It will setup Load testing environment with gatling. It will create 'load' directory. It's optional but BDDfire will support it to execute your load tests.
|
44
|
-
|
45
|
-
## Accessibility Testing : Axe Engine
|
46
|
-
You can optionally setup Accessibility Testing setup support Axe Engine
|
47
|
-
|
48
|
-
$ bddfire fire_accessibility
|
49
|
-
|
50
|
-
It will setup accessibility frameworks in the 'accessibility' directory. It uses Axe engine to run accessibility tests.
|
51
|
-
|
52
|
-
## Docker Support
|
53
|
-
|
54
|
-
BDDfire allow you execute your cucumber scenarios inside Docker containers. Scenarios with Poltergeist driver can be ran inside containers. One script will do everything for you !
|
55
|
-
|
56
|
-
|
57
|
-
### Install & Run BDDfire framework
|
58
|
-
|
59
|
-
Install your skeleton framework with BDDfire
|
60
|
-
|
61
|
-
$ bddfire fire_cucumber
|
62
|
-
$ bddfire fire_load
|
63
|
-
$ bddfire fire_accessibility
|
64
|
-
|
65
|
-
##### Watch it in action :
|
66
|
-
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/qr8jLmOd-mM/0.jpg)](http://www.youtube.com/watch?v=qr8jLmOd-mM)
|
67
21
|
|
68
22
|
Now you should have your framework ready inside 'cucumber' directory. Just install predefine Gems or you can add your own Gems.
|
69
23
|
|
@@ -72,6 +26,8 @@ Now you should have your framework ready inside 'cucumber' directory. Just insta
|
|
72
26
|
|
73
27
|
Once installed, you can run cucumber with multiple cabybara driver
|
74
28
|
|
29
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_cucumber.gif)
|
30
|
+
|
75
31
|
#Usage
|
76
32
|
## BDDfire Pre-defined-steps
|
77
33
|
BDDfire allow us to use predefined steps so that we don't have to write more code while writing cucumber steps. BDDfire has following predefined steps which can be used anytime during your project.
|
@@ -83,6 +39,10 @@ You can use[Browser based](https://github.com/Shashikant86/bddfire/blob/master/p
|
|
83
39
|
### Poltergeist Based Pre-defined-steps
|
84
40
|
You can use headless Poltergeist based [headless Poltergeist based](https://github.com/Shashikant86/bddfire/blob/master/pre-defined-steps/headless_steps.md) steps
|
85
41
|
|
42
|
+
### API Based Pre-defined Steps
|
43
|
+
|
44
|
+
Just tag your scenario/feature with @api and You can use inbuilt predefined API Steps [API based](https://github.com/Shashikant86/bddfire/blob/master/pre-defined-steps/rest_api_steps.md)
|
45
|
+
|
86
46
|
### Accessibility related Pre-defined-steps
|
87
47
|
|
88
48
|
You can also use [Accessibility steps](https://github.com/Shashikant86/bddfire/blob/major-refactor/pre-defined-steps/accessibility_steps.md)
|
@@ -109,6 +69,14 @@ You can run your scenarios in Google Chrome
|
|
109
69
|
|
110
70
|
$ bundle exec rake chrome
|
111
71
|
|
72
|
+
### REST API Testing
|
73
|
+
You can run your scenarios in Google Chrome
|
74
|
+
|
75
|
+
$ bundle exec rake api
|
76
|
+
|
77
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_rest_api.gif
|
78
|
+
|
79
|
+
|
112
80
|
###Cloud Testing Frameworks
|
113
81
|
Please enter your USERNAME and KEY in the env.rb file
|
114
82
|
|
@@ -148,16 +116,14 @@ You can use rubocop to detect ruby errors in your Ruby file
|
|
148
116
|
This will report all the offence in rubocop.
|
149
117
|
|
150
118
|
|
119
|
+
|
151
120
|
## Docker
|
152
121
|
|
153
122
|
We can run our cucumber scenario inside Docker containers. Assuming you have Docker installed. Check your Docker installation before using.
|
154
123
|
|
155
124
|
$ bundle exec rake docker
|
156
|
-
This will build Docker image 'bddfire-ci' and run cucumber scenarios inside container 'bddfire-ci'.
|
157
|
-
|
158
|
-
##### Watch it in action
|
159
|
-
|
160
|
-
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/MQub3qHRwkM/0.jpg)](http://www.youtube.com/watch?v=MQub3qHRwkM)
|
125
|
+
This will build Docker image 'bddfire-ci' and run cucumber scenarios inside container 'bddfire-ci'.
|
126
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_docker.gif)
|
161
127
|
|
162
128
|
## Gatling
|
163
129
|
|
@@ -166,12 +132,10 @@ You can use Gatling setup to execute load tests against your endpoints. Simply c
|
|
166
132
|
$ cd load
|
167
133
|
$ sh gatling_local.sh
|
168
134
|
This will run load tests against your url. You are free to record new simulations. Once finished there will be link to HTML report at the end.
|
135
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_load.gif)
|
169
136
|
|
170
137
|
There is CI integration to plug it with jenkins.
|
171
138
|
|
172
|
-
##### Watch it in action
|
173
|
-
|
174
|
-
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/h6MBXGAeUVY/0.jpg)](http://www.youtube.com/watch?v=h6MBXGAeUVY)
|
175
139
|
|
176
140
|
|
177
141
|
## Accessibility Testing : Axe
|
@@ -181,6 +145,7 @@ We can run accessibility checks on our web page using BDDfire. You have to pass
|
|
181
145
|
$ cd accessibility
|
182
146
|
$ bundle exec cucumber -r features URL="http://www.google.co.uk"
|
183
147
|
|
184
|
-
|
148
|
+
![image](https://github.com/Shashikant86/bddfire-gifs/blob/master/bddfire_accessibility.gif)
|
149
|
+
|
150
|
+
|
185
151
|
|
186
|
-
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/aGPO_Bt5nmw/0.jpg)](http://www.youtube.com/watch?v=qr8jLmOd-mM)
|
@@ -0,0 +1,104 @@
|
|
1
|
+
@api
|
2
|
+
Feature: GitHub RestFul Api Testing with BDDfire
|
3
|
+
|
4
|
+
Scenario: GitHub Demo
|
5
|
+
Given I send a GET request for "https://api.github.com/repos/Shashikant86/lazycuke"
|
6
|
+
Then the response should be JSON
|
7
|
+
And the response status code should be '200'
|
8
|
+
And the JSON response should have '70' properties
|
9
|
+
And the JSON response has a "name" property
|
10
|
+
And the JSON "name" property equals "lazycuke"
|
11
|
+
And the JSON response header has key "content_type" with value of "application/json; charset=utf-8"
|
12
|
+
And the JSON response should be
|
13
|
+
"""
|
14
|
+
{
|
15
|
+
"id": 33383308,
|
16
|
+
"name": "lazycuke",
|
17
|
+
"full_name": "Shashikant86/lazycuke",
|
18
|
+
"owner": {
|
19
|
+
"login": "Shashikant86",
|
20
|
+
"id": 683799,
|
21
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/683799?v=3",
|
22
|
+
"gravatar_id": "",
|
23
|
+
"url": "https://api.github.com/users/Shashikant86",
|
24
|
+
"html_url": "https://github.com/Shashikant86",
|
25
|
+
"followers_url": "https://api.github.com/users/Shashikant86/followers",
|
26
|
+
"following_url": "https://api.github.com/users/Shashikant86/following{/other_user}",
|
27
|
+
"gists_url": "https://api.github.com/users/Shashikant86/gists{/gist_id}",
|
28
|
+
"starred_url": "https://api.github.com/users/Shashikant86/starred{/owner}{/repo}",
|
29
|
+
"subscriptions_url": "https://api.github.com/users/Shashikant86/subscriptions",
|
30
|
+
"organizations_url": "https://api.github.com/users/Shashikant86/orgs",
|
31
|
+
"repos_url": "https://api.github.com/users/Shashikant86/repos",
|
32
|
+
"events_url": "https://api.github.com/users/Shashikant86/events{/privacy}",
|
33
|
+
"received_events_url": "https://api.github.com/users/Shashikant86/received_events",
|
34
|
+
"type": "User",
|
35
|
+
"site_admin": false
|
36
|
+
},
|
37
|
+
"private": false,
|
38
|
+
"html_url": "https://github.com/Shashikant86/lazycuke",
|
39
|
+
"description": "Lazycuke gem",
|
40
|
+
"fork": false,
|
41
|
+
"url": "https://api.github.com/repos/Shashikant86/lazycuke",
|
42
|
+
"forks_url": "https://api.github.com/repos/Shashikant86/lazycuke/forks",
|
43
|
+
"keys_url": "https://api.github.com/repos/Shashikant86/lazycuke/keys{/key_id}",
|
44
|
+
"collaborators_url": "https://api.github.com/repos/Shashikant86/lazycuke/collaborators{/collaborator}",
|
45
|
+
"teams_url": "https://api.github.com/repos/Shashikant86/lazycuke/teams",
|
46
|
+
"hooks_url": "https://api.github.com/repos/Shashikant86/lazycuke/hooks",
|
47
|
+
"issue_events_url": "https://api.github.com/repos/Shashikant86/lazycuke/issues/events{/number}",
|
48
|
+
"events_url": "https://api.github.com/repos/Shashikant86/lazycuke/events",
|
49
|
+
"assignees_url": "https://api.github.com/repos/Shashikant86/lazycuke/assignees{/user}",
|
50
|
+
"branches_url": "https://api.github.com/repos/Shashikant86/lazycuke/branches{/branch}",
|
51
|
+
"tags_url": "https://api.github.com/repos/Shashikant86/lazycuke/tags",
|
52
|
+
"blobs_url": "https://api.github.com/repos/Shashikant86/lazycuke/git/blobs{/sha}",
|
53
|
+
"git_tags_url": "https://api.github.com/repos/Shashikant86/lazycuke/git/tags{/sha}",
|
54
|
+
"git_refs_url": "https://api.github.com/repos/Shashikant86/lazycuke/git/refs{/sha}",
|
55
|
+
"trees_url": "https://api.github.com/repos/Shashikant86/lazycuke/git/trees{/sha}",
|
56
|
+
"statuses_url": "https://api.github.com/repos/Shashikant86/lazycuke/statuses/{sha}",
|
57
|
+
"languages_url": "https://api.github.com/repos/Shashikant86/lazycuke/languages",
|
58
|
+
"stargazers_url": "https://api.github.com/repos/Shashikant86/lazycuke/stargazers",
|
59
|
+
"contributors_url": "https://api.github.com/repos/Shashikant86/lazycuke/contributors",
|
60
|
+
"subscribers_url": "https://api.github.com/repos/Shashikant86/lazycuke/subscribers",
|
61
|
+
"subscription_url": "https://api.github.com/repos/Shashikant86/lazycuke/subscription",
|
62
|
+
"commits_url": "https://api.github.com/repos/Shashikant86/lazycuke/commits{/sha}",
|
63
|
+
"git_commits_url": "https://api.github.com/repos/Shashikant86/lazycuke/git/commits{/sha}",
|
64
|
+
"comments_url": "https://api.github.com/repos/Shashikant86/lazycuke/comments{/number}",
|
65
|
+
"issue_comment_url": "https://api.github.com/repos/Shashikant86/lazycuke/issues/comments{/number}",
|
66
|
+
"contents_url": "https://api.github.com/repos/Shashikant86/lazycuke/contents/{+path}",
|
67
|
+
"compare_url": "https://api.github.com/repos/Shashikant86/lazycuke/compare/{base}...{head}",
|
68
|
+
"merges_url": "https://api.github.com/repos/Shashikant86/lazycuke/merges",
|
69
|
+
"archive_url": "https://api.github.com/repos/Shashikant86/lazycuke/{archive_format}{/ref}",
|
70
|
+
"downloads_url": "https://api.github.com/repos/Shashikant86/lazycuke/downloads",
|
71
|
+
"issues_url": "https://api.github.com/repos/Shashikant86/lazycuke/issues{/number}",
|
72
|
+
"pulls_url": "https://api.github.com/repos/Shashikant86/lazycuke/pulls{/number}",
|
73
|
+
"milestones_url": "https://api.github.com/repos/Shashikant86/lazycuke/milestones{/number}",
|
74
|
+
"notifications_url": "https://api.github.com/repos/Shashikant86/lazycuke/notifications{?since,all,participating}",
|
75
|
+
"labels_url": "https://api.github.com/repos/Shashikant86/lazycuke/labels{/name}",
|
76
|
+
"releases_url": "https://api.github.com/repos/Shashikant86/lazycuke/releases{/id}",
|
77
|
+
"deployments_url": "https://api.github.com/repos/Shashikant86/lazycuke/deployments",
|
78
|
+
"created_at": "2015-04-03T21:20:06Z",
|
79
|
+
"updated_at": "2015-04-03T21:21:56Z",
|
80
|
+
"pushed_at": "2015-04-03T21:21:56Z",
|
81
|
+
"git_url": "git://github.com/Shashikant86/lazycuke.git",
|
82
|
+
"ssh_url": "git@github.com:Shashikant86/lazycuke.git",
|
83
|
+
"clone_url": "https://github.com/Shashikant86/lazycuke.git",
|
84
|
+
"svn_url": "https://github.com/Shashikant86/lazycuke",
|
85
|
+
"homepage": null,
|
86
|
+
"size": 124,
|
87
|
+
"stargazers_count": 0,
|
88
|
+
"watchers_count": 0,
|
89
|
+
"language": "Ruby",
|
90
|
+
"has_issues": true,
|
91
|
+
"has_downloads": true,
|
92
|
+
"has_wiki": true,
|
93
|
+
"has_pages": false,
|
94
|
+
"forks_count": 0,
|
95
|
+
"mirror_url": null,
|
96
|
+
"open_issues_count": 0,
|
97
|
+
"forks": 0,
|
98
|
+
"open_issues": 0,
|
99
|
+
"watchers": 0,
|
100
|
+
"default_branch": "master",
|
101
|
+
"network_count": 0,
|
102
|
+
"subscribers_count": 1
|
103
|
+
}
|
104
|
+
"""
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bddfire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shashikant Jagtap
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -124,6 +124,46 @@ dependencies:
|
|
124
124
|
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: 1.0.0
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: rest-client
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - "~>"
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 1.8.0
|
134
|
+
- - ">="
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: 1.7.3
|
137
|
+
type: :runtime
|
138
|
+
prerelease: false
|
139
|
+
version_requirements: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - "~>"
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: 1.8.0
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: 1.7.3
|
147
|
+
- !ruby/object:Gem::Dependency
|
148
|
+
name: json
|
149
|
+
requirement: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - "~>"
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 1.8.3
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: 1.7.3
|
157
|
+
type: :runtime
|
158
|
+
prerelease: false
|
159
|
+
version_requirements: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - "~>"
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: 1.8.3
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 1.7.3
|
127
167
|
- !ruby/object:Gem::Dependency
|
128
168
|
name: be_valid_asset
|
129
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,8 +204,9 @@ dependencies:
|
|
164
204
|
- - ">="
|
165
205
|
- !ruby/object:Gem::Version
|
166
206
|
version: 1.3.0
|
167
|
-
description:
|
168
|
-
|
207
|
+
description: A Wholesale framework for web, mobile, api, load, accessibility testing.
|
208
|
+
Get you going in a minute. An instant setup of Ruby, Cucumber, Capybara, selenium,
|
209
|
+
REST API Appium, Docker, Gatling and Axe Engine
|
169
210
|
email:
|
170
211
|
- shashikant.jagtap@aol.co.uk
|
171
212
|
executables:
|
@@ -186,6 +227,7 @@ files:
|
|
186
227
|
- features/support/support_code.rb
|
187
228
|
- lib/bddfire.rb
|
188
229
|
- lib/bddfire/accessibility/axe.rb
|
230
|
+
- lib/bddfire/api/rest-api.rb
|
189
231
|
- lib/bddfire/assertions/assert.rb
|
190
232
|
- lib/bddfire/mobile/mobile_methods.rb
|
191
233
|
- lib/bddfire/mobile/mobile_steps.rb
|
@@ -199,6 +241,7 @@ files:
|
|
199
241
|
- pre-defined-steps/accessibility_steps.md
|
200
242
|
- pre-defined-steps/capybara_steps.md
|
201
243
|
- pre-defined-steps/headless_steps.md
|
244
|
+
- pre-defined-steps/rest_api_steps.md
|
202
245
|
- scaffold/accessibility/features/01_validation.feature
|
203
246
|
- scaffold/accessibility/features/02_javascript.feature
|
204
247
|
- scaffold/accessibility/features/03_language.feature
|
@@ -237,6 +280,7 @@ files:
|
|
237
280
|
- scaffold/config_files/cucumber.yml
|
238
281
|
- scaffold/config_files/docker.sh
|
239
282
|
- scaffold/config_files/package.json
|
283
|
+
- scaffold/features/api.feature
|
240
284
|
- scaffold/features/google.feature
|
241
285
|
- scaffold/features/pages/HomePage.rb
|
242
286
|
- scaffold/features/step_definitions/google_steps.rb
|
@@ -265,8 +309,8 @@ homepage: https://github.com/Shashikant86/bddfire
|
|
265
309
|
licenses:
|
266
310
|
- MIT
|
267
311
|
metadata: {}
|
268
|
-
post_install_message: Thanks for installing BDDfire
|
269
|
-
|
312
|
+
post_install_message: "======== Thanks for installing BDDfire. You can now perform
|
313
|
+
Web, API, Mobile, Accessibility, Load Testing with single framework !!==================== "
|
270
314
|
rdoc_options: []
|
271
315
|
require_paths:
|
272
316
|
- lib
|