megadriver 0.0.1
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/.document +5 -0
- data/Gemfile +12 -0
- data/LICENSE.txt +20 -0
- data/README.md +72 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/lib/megadriver.rb +13 -0
- data/test/helper.rb +18 -0
- data/test/test_megadriver.rb +7 -0
- metadata +141 -0
data/.document
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Pedro Menezes
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
## Welcome to MegaDriver
|
2
|
+
|
3
|
+
With MegaDriver, you can simulate *multiple clients in the same [Cucu](http://en.wikipedia.org/wiki/Cucumber)[mber](https://github.com/cucumber/cucumber) scenario*.
|
4
|
+
|
5
|
+
It is a [Capybara](https://github.com/jnicklas/capybara) Driver extended from [Selenium](http://seleniumhq.org/) Capybara Driver with some Cucumber Steps.
|
6
|
+
|
7
|
+
## Getting Started
|
8
|
+
|
9
|
+
1. *Install* MegaDriver at the command prompt if you haven't yet:
|
10
|
+
|
11
|
+
gem install megadriver
|
12
|
+
|
13
|
+
2. *Copy* MegaDriver's step definitions to your step definitions directory
|
14
|
+
|
15
|
+
PS: we have in pt-BR besides English
|
16
|
+
|
17
|
+
3. *Set up* MegaDriver as your Capybara driver:
|
18
|
+
|
19
|
+
* Add "Capybara.default_driver = :megadriver" to your features/support/env.rb
|
20
|
+
* *OR* tag your Cucumber scenarios with @megadriver
|
21
|
+
|
22
|
+
## Example
|
23
|
+
|
24
|
+
Feature: Chat
|
25
|
+
|
26
|
+
Scenario: Exchange messages
|
27
|
+
Given "Falcon" is in control
|
28
|
+
And I am in the chatroom
|
29
|
+
|
30
|
+
Given "Humbert" is in control
|
31
|
+
And I am in the chatroom
|
32
|
+
When I type "Hi" in the message box
|
33
|
+
And press enter
|
34
|
+
|
35
|
+
Given "Falcon" is in control
|
36
|
+
Then I should see "Hi"
|
37
|
+
|
38
|
+
Scenario: Other exchange message example
|
39
|
+
Given "Falcon" is in control
|
40
|
+
And I am in the chatroom
|
41
|
+
|
42
|
+
Given another client is in control
|
43
|
+
And I am in the chatroom
|
44
|
+
When I type "Hi" in the message box
|
45
|
+
And press enter
|
46
|
+
|
47
|
+
Given "Falcon" is in control
|
48
|
+
Then I should see "Hi"
|
49
|
+
|
50
|
+
|
51
|
+
## Observation
|
52
|
+
|
53
|
+
* You can use your old steps with MegaDriver awesomeness
|
54
|
+
* *Be careful*: browsers opened by MegaDriver will close only when the process exits
|
55
|
+
* You should reuse your client names
|
56
|
+
|
57
|
+
|
58
|
+
## TODO
|
59
|
+
|
60
|
+
Make possible to select the browser type
|
61
|
+
|
62
|
+
|
63
|
+
## Thanks
|
64
|
+
|
65
|
+
* [Pedro Teixeira](https://github.com/pedroteixeira);
|
66
|
+
* [Sergio Azevedo](https://github.com/sergiojunior);
|
67
|
+
* everybody from [Intelie](http://intelie.com.br/).
|
68
|
+
|
69
|
+
## Copyright
|
70
|
+
|
71
|
+
Copyright (c) 2011 Pedro Menezes. See LICENSE.txt for
|
72
|
+
further details.
|
data/Rakefile
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "megadriver"
|
18
|
+
gem.homepage = "http://github.com/pedromenezes/megadriver"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Multiple Selenium clients in Cucumber scenarios with Capybara}
|
21
|
+
gem.description = %Q{Capybara Driver and Cucumber Steps to use multiple clients in the same scenario}
|
22
|
+
gem.email = "pedrojudo@gmail.com"
|
23
|
+
gem.authors = ["Pedro Menezes"]
|
24
|
+
end
|
25
|
+
Jeweler::RubygemsDotOrgTasks.new
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
Rake::TestTask.new(:test) do |test|
|
29
|
+
test.libs << 'lib' << 'test'
|
30
|
+
test.pattern = 'test/**/test_*.rb'
|
31
|
+
test.verbose = true
|
32
|
+
end
|
33
|
+
|
34
|
+
require 'rcov/rcovtask'
|
35
|
+
Rcov::RcovTask.new do |test|
|
36
|
+
test.libs << 'test'
|
37
|
+
test.pattern = 'test/**/test_*.rb'
|
38
|
+
test.verbose = true
|
39
|
+
test.rcov_opts << '--exclude "gems/*"'
|
40
|
+
end
|
41
|
+
|
42
|
+
task :default => :test
|
43
|
+
|
44
|
+
require 'rake/rdoctask'
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
47
|
+
|
48
|
+
rdoc.rdoc_dir = 'rdoc'
|
49
|
+
rdoc.title = "megadriver #{version}"
|
50
|
+
rdoc.rdoc_files.include('README*')
|
51
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
52
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
data/lib/megadriver.rb
ADDED
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'megadriver'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: megadriver
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Pedro Menezes
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-05-27 00:00:00 -03:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: shoulda
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
type: :development
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ~>
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 1.0.0
|
36
|
+
type: :development
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: jeweler
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.6.0
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rcov
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
type: :development
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: capybara
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
69
|
+
type: :development
|
70
|
+
version_requirements: *id005
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: cucumber
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: "0"
|
80
|
+
type: :development
|
81
|
+
version_requirements: *id006
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: selenium-webdriver
|
84
|
+
prerelease: false
|
85
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: "0"
|
91
|
+
type: :development
|
92
|
+
version_requirements: *id007
|
93
|
+
description: Capybara Driver and Cucumber Steps to use multiple clients in the same scenario
|
94
|
+
email: pedrojudo@gmail.com
|
95
|
+
executables: []
|
96
|
+
|
97
|
+
extensions: []
|
98
|
+
|
99
|
+
extra_rdoc_files:
|
100
|
+
- LICENSE.txt
|
101
|
+
- README.md
|
102
|
+
files:
|
103
|
+
- .document
|
104
|
+
- Gemfile
|
105
|
+
- LICENSE.txt
|
106
|
+
- Rakefile
|
107
|
+
- VERSION
|
108
|
+
- lib/megadriver.rb
|
109
|
+
- test/helper.rb
|
110
|
+
- test/test_megadriver.rb
|
111
|
+
- README.md
|
112
|
+
has_rdoc: true
|
113
|
+
homepage: http://github.com/pedromenezes/megadriver
|
114
|
+
licenses:
|
115
|
+
- MIT
|
116
|
+
post_install_message:
|
117
|
+
rdoc_options: []
|
118
|
+
|
119
|
+
require_paths:
|
120
|
+
- lib
|
121
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: "0"
|
127
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
|
+
none: false
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: "0"
|
133
|
+
requirements: []
|
134
|
+
|
135
|
+
rubyforge_project:
|
136
|
+
rubygems_version: 1.6.2
|
137
|
+
signing_key:
|
138
|
+
specification_version: 3
|
139
|
+
summary: Multiple Selenium clients in Cucumber scenarios with Capybara
|
140
|
+
test_files: []
|
141
|
+
|