easy-automation 0.0.2 → 0.0.3
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/README.markdown
CHANGED
@@ -3,16 +3,8 @@ Easy Automation
|
|
3
3
|
|
4
4
|
Friendly Automation Testing Framework, tired of update every single test when developers change an XPath, id, class, etc? This is for you.
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
This framework uses common patterns to make maintainability easy and scalable tests. It's divided in:
|
10
|
-
|
11
|
-
* Pages
|
12
|
-
* Page Elements
|
13
|
-
* Test
|
14
|
-
* Data for Tests
|
15
|
-
* Runner
|
6
|
+
Why another automation testing framework?
|
7
|
+
======
|
16
8
|
|
17
9
|
Challenges when developing automated tests
|
18
10
|
------
|
@@ -22,6 +14,18 @@ Challenges when developing automated tests
|
|
22
14
|
* Some tests depend in other
|
23
15
|
* If you need to update data used by test, you touch test code
|
24
16
|
|
17
|
+
Maintainability
|
18
|
+
------
|
19
|
+
|
20
|
+
This framework uses common patterns to make maintainability easy and scalable tests. It's divided in:
|
21
|
+
|
22
|
+
* Pages, mapped to actual pages on your systems
|
23
|
+
* Page Elements, defining every single element in your pages needed by tests, each element has actions
|
24
|
+
* Test, tests checking your site
|
25
|
+
* Data for Tests, do you want to modify login credentials or run it using different ones? change it in a single place, and you're done
|
26
|
+
* Runner, you can group multiples tests to perform full tests, run stable ones, smock check, etc.
|
27
|
+
* Hooks, do you want to call a service that resets the db before every single test? it's already implemented.
|
28
|
+
|
25
29
|
Design
|
26
30
|
------
|
27
31
|
|
@@ -91,6 +95,23 @@ You can change any behaviour using EasyAutomation::Runner.config helper, options
|
|
91
95
|
end
|
92
96
|
end
|
93
97
|
|
98
|
+
You can modify the behaviour via command line arguments, it's very useful when you want to run the same tests against different url, browser, etc, for example:
|
99
|
+
bundle exec ruby example.rb --url=http://google.com
|
100
|
+
This will run the example provided against http://google.com instead of http://www.google.com defined on the configure block, another example:
|
101
|
+
|
102
|
+
bundle exec ruby example.rb --url=http://images.google.com --browser=*safari
|
103
|
+
This will run example tests against images.google.com using safari browser
|
104
|
+
|
105
|
+
|
106
|
+
Installation
|
107
|
+
-------
|
108
|
+
Bundler:
|
109
|
+
echo "gem 'easy-automation' " >> Gemfile
|
110
|
+
bundle install
|
111
|
+
|
112
|
+
Gems:
|
113
|
+
gem install easy-automation
|
114
|
+
|
94
115
|
Example
|
95
116
|
-------
|
96
117
|
Structure:
|
@@ -166,6 +187,7 @@ Roadmap
|
|
166
187
|
* More hooks [before|after] [:all|:each] [:test|:suite]
|
167
188
|
* Update Selenium gem to use latest selenium-RC and fix weird firefox crashes.
|
168
189
|
* Multi browser
|
190
|
+
* Arguments via command line, done
|
169
191
|
* Wait for element to be loaded event
|
170
192
|
* Rake integration
|
171
193
|
* Retry on failed tests
|
@@ -187,11 +209,18 @@ From 0.0.1 to 0.0.2
|
|
187
209
|
* [before|after] [:all|:each] [:test|:suite] hooks
|
188
210
|
* Remote Selenium RC
|
189
211
|
|
212
|
+
From 0.0.2 to 0.0.3
|
213
|
+
-------
|
214
|
+
* Arguments support
|
215
|
+
|
216
|
+
|
190
217
|
From 0.0.2 to 0.1.0
|
191
218
|
-------
|
192
219
|
* Retry failed tests
|
220
|
+
* Better test reporting
|
193
221
|
* Selenium Grid integration
|
194
222
|
|
223
|
+
|
195
224
|
Contributing
|
196
225
|
------------
|
197
226
|
|
@@ -201,3 +230,12 @@ Contributing
|
|
201
230
|
4. Push to the branch (`git push origin my_branch`)
|
202
231
|
5. Create an [Issue][1] with a link to your branch
|
203
232
|
6. Enjoy a refreshing Beer and wait
|
233
|
+
|
234
|
+
|
235
|
+
About the Author
|
236
|
+
------------
|
237
|
+
[Crowd Interactive](http://www.crowdint.com) is a Ruby and Rails consultancy firm
|
238
|
+
powered by a team of enthusiast engineers who love programming.
|
239
|
+
We turn your ideas into web applications, and we like challenging projects. We also have
|
240
|
+
a lot of experience in retail, so it doesn't matter if your idea is about
|
241
|
+
something you'd like to sell, we can surely help you.
|
data/lib/easy-automation.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
module EasyAutomation
|
2
|
+
class Args
|
3
|
+
class << self
|
4
|
+
def parse args
|
5
|
+
Args.usage if args.include?('--help')
|
6
|
+
args.each do |arg|
|
7
|
+
var_name = arg.split('=')
|
8
|
+
begin
|
9
|
+
eval(%{
|
10
|
+
EasyAutomation::Runner.configuration.#{var_name[0].gsub('--', '')} = "#{var_name[1]}"
|
11
|
+
})
|
12
|
+
rescue Exception => e
|
13
|
+
Args.usage
|
14
|
+
break
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def usage
|
21
|
+
puts "Easy Automation"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -8,7 +8,7 @@ describe EasyAutomation::Runner do
|
|
8
8
|
context "selenium params" do
|
9
9
|
it "should default params" do
|
10
10
|
EasyAutomation::Runner.configuration.selenium_port.should be(4444)
|
11
|
-
EasyAutomation::Runner.configuration.selenium_timeout.should be(
|
11
|
+
EasyAutomation::Runner.configuration.selenium_timeout.should be(4000)
|
12
12
|
EasyAutomation::Runner.configuration.browsers.should == ["* firefox"]
|
13
13
|
EasyAutomation::Runner.configuration.url.should == "http://www.google.com"
|
14
14
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
|
4
|
+
describe EasyAutomation::Args do
|
5
|
+
subject {Args}
|
6
|
+
|
7
|
+
describe "When specifying no args" do
|
8
|
+
it "should not alter configuration" do
|
9
|
+
EasyAutomation::Runner.configure do |config|
|
10
|
+
config.url = "not_modified"
|
11
|
+
end
|
12
|
+
argv = []
|
13
|
+
EasyAutomation::Args.parse(argv)
|
14
|
+
EasyAutomation::Runner.configuration.url.should == "not_modified"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
describe "When specifying args" do
|
18
|
+
it "should not alter configuration" do
|
19
|
+
argv = ["--url=testing_args"]
|
20
|
+
EasyAutomation::Args.parse(argv)
|
21
|
+
EasyAutomation::Runner.configuration.url.should == "testing_args"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "when specifying wrong params" do
|
26
|
+
it "should not raise any exception" do
|
27
|
+
EasyAutomation::Args.should_receive(:usage).and_return(true)
|
28
|
+
argv = ["--wrong_param=testing_args"]
|
29
|
+
EasyAutomation::Args.parse(argv)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy-automation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Edwin Cruz
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-29 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- Rakefile
|
66
66
|
- easy-automation.gemspec
|
67
67
|
- lib/easy-automation.rb
|
68
|
+
- lib/easy_automation/args.rb
|
68
69
|
- lib/easy_automation/config.rb
|
69
70
|
- lib/easy_automation/data_elements.rb
|
70
71
|
- lib/easy_automation/load_data.rb
|
@@ -84,6 +85,7 @@ files:
|
|
84
85
|
- spec/lib/easy-automation/runner_spec.rb
|
85
86
|
- spec/lib/easy-automation/suite_spec.rb
|
86
87
|
- spec/lib/easy-automation/test_spec.rb
|
88
|
+
- spec/lib/easy-automation/zz_args_spec.rb
|
87
89
|
- spec/spec_helper.rb
|
88
90
|
- spec/support/browser.rb
|
89
91
|
- spec/support/data/hometest.yml
|
@@ -131,6 +133,7 @@ test_files:
|
|
131
133
|
- spec/lib/easy-automation/runner_spec.rb
|
132
134
|
- spec/lib/easy-automation/suite_spec.rb
|
133
135
|
- spec/lib/easy-automation/test_spec.rb
|
136
|
+
- spec/lib/easy-automation/zz_args_spec.rb
|
134
137
|
- spec/spec_helper.rb
|
135
138
|
- spec/support/browser.rb
|
136
139
|
- spec/support/data/hometest.yml
|