makevoid-taza 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +74 -0
- data/Manifest.txt +61 -0
- data/README +79 -0
- data/README.textile +1 -0
- data/VERSION.yml +4 -0
- data/bin/taza +17 -0
- data/generators/flow/flow_generator.rb +57 -0
- data/generators/flow/templates/flow.rb.erb +9 -0
- data/generators/page/page_generator.rb +58 -0
- data/generators/page/templates/functional_page_spec.rb.erb +8 -0
- data/generators/page/templates/page.rb.erb +8 -0
- data/generators/partial/partial_generator.rb +57 -0
- data/generators/partial/templates/partial.rb.erb +7 -0
- data/generators/site/site_generator.rb +56 -0
- data/generators/site/templates/site.rb.erb +10 -0
- data/generators/site/templates/site.yml.erb +3 -0
- data/lib/app_generators/taza/taza_generator.rb +74 -0
- data/lib/app_generators/taza/templates/config.yml.erb +3 -0
- data/lib/app_generators/taza/templates/rakefile.rb.erb +10 -0
- data/lib/app_generators/taza/templates/spec_helper.rb.erb +11 -0
- data/lib/extensions/array.rb +10 -0
- data/lib/extensions/hash.rb +15 -0
- data/lib/extensions/object.rb +33 -0
- data/lib/extensions/string.rb +11 -0
- data/lib/taza.rb +24 -0
- data/lib/taza/browser.rb +53 -0
- data/lib/taza/entity.rb +55 -0
- data/lib/taza/fixture.rb +68 -0
- data/lib/taza/fixtures.rb +24 -0
- data/lib/taza/flow.rb +40 -0
- data/lib/taza/page.rb +128 -0
- data/lib/taza/settings.rb +33 -0
- data/lib/taza/site.rb +150 -0
- data/lib/taza/tasks.rb +54 -0
- data/spec/array_spec.rb +17 -0
- data/spec/browser_spec.rb +86 -0
- data/spec/entity_spec.rb +35 -0
- data/spec/fixture_spec.rb +51 -0
- data/spec/fixtures_spec.rb +47 -0
- data/spec/flow_generator_spec.rb +50 -0
- data/spec/hash_spec.rb +15 -0
- data/spec/object_spec.rb +29 -0
- data/spec/page_generator_spec.rb +56 -0
- data/spec/page_module_spec.rb +165 -0
- data/spec/page_spec.rb +105 -0
- data/spec/partial_generator_spec.rb +38 -0
- data/spec/project_generator_spec.rb +56 -0
- data/spec/sandbox/config.yml +3 -0
- data/spec/sandbox/config/config.yml +1 -0
- data/spec/sandbox/config/site_name.yml +5 -0
- data/spec/sandbox/fixtures/examples.yml +15 -0
- data/spec/sandbox/fixtures/foo_site/bars.yml +2 -0
- data/spec/sandbox/fixtures/foos.yml +3 -0
- data/spec/sandbox/fixtures/users.yml +3 -0
- data/spec/sandbox/flows/batman.rb +5 -0
- data/spec/sandbox/flows/robin.rb +4 -0
- data/spec/sandbox/pages/foo/bar.rb +9 -0
- data/spec/sandbox/pages/foo/bay.rb +10 -0
- data/spec/sandbox/pages/foo/baz.rb +11 -0
- data/spec/sandbox/pages/foo/partials/partial_the_reckoning.rb +2 -0
- data/spec/settings_spec.rb +92 -0
- data/spec/site_fixtures_spec.rb +17 -0
- data/spec/site_generator_spec.rb +56 -0
- data/spec/site_spec.rb +268 -0
- data/spec/spec_helper.rb +57 -0
- data/spec/string_spec.rb +8 -0
- data/spec/taza_bin_spec.rb +13 -0
- data/spec/taza_tasks_spec.rb +56 -0
- data/taza.gemspec +46 -0
- metadata +196 -0
data/History.txt
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
=== 0.8.7
|
2
|
+
|
3
|
+
* Added script/console Utility
|
4
|
+
* Integration with user_choices
|
5
|
+
* Attach to open IE instance
|
6
|
+
|
7
|
+
=== 0.8.6
|
8
|
+
|
9
|
+
* Added feature to keep browser open after tests
|
10
|
+
* Added access to multiple levels in Fixtures
|
11
|
+
* Added feature to return a Hash in Fixtures
|
12
|
+
* lib/flows is no longer generated
|
13
|
+
* Page module filters for elements inside page modules
|
14
|
+
|
15
|
+
=== 0.8.5
|
16
|
+
|
17
|
+
* Fixed Fixtures bugs
|
18
|
+
* Fixture entities can be accessed like hashes(foo[:bar])
|
19
|
+
* Functional tests are now 'isolation' tests
|
20
|
+
* Added Page-Module feature
|
21
|
+
|
22
|
+
=== 0.8.4
|
23
|
+
|
24
|
+
* Added one to many relationship in fixtures
|
25
|
+
* Added Templating of fixtures
|
26
|
+
* Added Site Secific fixtures
|
27
|
+
* Spec Rake Tasks are now generated Recursively
|
28
|
+
|
29
|
+
=== 0.8.2 / 2009-01-11
|
30
|
+
|
31
|
+
* Added Partials
|
32
|
+
* Added Preliminary Fixture Support
|
33
|
+
* Fixed horrible infinite loop bug in Filters
|
34
|
+
* Added Configurability to a Taza projects Rakefile
|
35
|
+
|
36
|
+
=== 0.8.0 / 2008-11-23
|
37
|
+
|
38
|
+
Taza is a web application testing framework meant to be used with browsed-based testing libraries like WATIR or Selenium
|
39
|
+
|
40
|
+
Not all web applications can be written in Ruby, unfortunately. When you aren't testing an application that was written with testing in mind Taza can provide a structured and opionated way to do browser-based testing.
|
41
|
+
|
42
|
+
* Sites have Pages
|
43
|
+
* Sites have Flows that move through Pages
|
44
|
+
* Pages have elements and filters to define simple ways of interacting with them
|
45
|
+
* Pages have tests/specs that help chip away at the dreaded 0% Coverage Beast™
|
46
|
+
|
47
|
+
* Features
|
48
|
+
* Generate a Taza project easily
|
49
|
+
* Generate Sites, Pages, and Flows using a familiar format(./script/generate)
|
50
|
+
* Automatically generate specs when generating a site to push you
|
51
|
+
* Easily switch browser and/or driver
|
52
|
+
* Automatic opening and cleanup of browser
|
53
|
+
* Included rake spec commands generated for sites and pages
|
54
|
+
* Rake spec commands will create an RSpec HTML report by default
|
55
|
+
* Easily tie-in special functionality like getting a DOM dump of each browser before it closes
|
56
|
+
|
57
|
+
* Todo
|
58
|
+
0.8.x
|
59
|
+
* Add a taza_example to easily generate a fully-functional example of how a taza project might look
|
60
|
+
* Provide more documentation
|
61
|
+
0.9
|
62
|
+
* Add more thorough Selenium support
|
63
|
+
* Easily allow overwriting of spec options for included rake tasks
|
64
|
+
* Provide better conventions around cross-site testing
|
65
|
+
1.0
|
66
|
+
* Using Selenium with WATIR syntax(Easily switch between Selenium and WATIR without having to change any Page code)
|
67
|
+
* Provide more advanced documentation
|
68
|
+
|
69
|
+
=== 0.5.0 / 2008-10-03
|
70
|
+
|
71
|
+
* 1 major enhancement
|
72
|
+
|
73
|
+
* Birthday!
|
74
|
+
|
data/Manifest.txt
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
README.txt
|
4
|
+
Rakefile
|
5
|
+
bin/taza
|
6
|
+
generators/flow/flow_generator.rb
|
7
|
+
generators/flow/templates/flow.rb.erb
|
8
|
+
generators/page/page_generator.rb
|
9
|
+
generators/page/templates/functional_page_spec.rb.erb
|
10
|
+
generators/page/templates/page.rb.erb
|
11
|
+
generators/partial/partial_generator.rb
|
12
|
+
generators/partial/templates/partial.rb.erb
|
13
|
+
generators/site/site_generator.rb
|
14
|
+
generators/site/templates/site.rb.erb
|
15
|
+
generators/site/templates/site.yml.erb
|
16
|
+
lib/app_generators/taza/taza_generator.rb
|
17
|
+
lib/app_generators/taza/templates/config.yml.erb
|
18
|
+
lib/app_generators/taza/templates/rakefile.rb.erb
|
19
|
+
lib/app_generators/taza/templates/spec_helper.rb.erb
|
20
|
+
lib/extensions/object.rb
|
21
|
+
lib/extensions/string.rb
|
22
|
+
lib/extensions/hash.rb
|
23
|
+
lib/extensions/array.rb
|
24
|
+
lib/taza.rb
|
25
|
+
lib/taza/fixture.rb
|
26
|
+
lib/taza/entity.rb
|
27
|
+
lib/taza/browser.rb
|
28
|
+
lib/taza/browsers/ie_watir.rb
|
29
|
+
lib/taza/browsers/safari_watir.rb
|
30
|
+
lib/taza/flow.rb
|
31
|
+
lib/taza/page.rb
|
32
|
+
lib/taza/settings.rb
|
33
|
+
lib/taza/site.rb
|
34
|
+
lib/taza/tasks.rb
|
35
|
+
spec/browser_spec.rb
|
36
|
+
spec/entity_spec.rb
|
37
|
+
spec/flow_generator_spec.rb
|
38
|
+
spec/fixture_spec.rb
|
39
|
+
spec/fixtures_spec.rb
|
40
|
+
spec/object_spec.rb
|
41
|
+
spec/page_generator_spec.rb
|
42
|
+
spec/page_spec.rb
|
43
|
+
spec/partial_generator_spec.rb
|
44
|
+
spec/platform/osx/browser_spec.rb
|
45
|
+
spec/platform/windows/browser_spec.rb
|
46
|
+
spec/project_generator_spec.rb
|
47
|
+
spec/sandbox/config.yml
|
48
|
+
spec/sandbox/config/config.yml
|
49
|
+
spec/sandbox/config/site_name.yml
|
50
|
+
spec/sandbox/flows/batman.rb
|
51
|
+
spec/sandbox/flows/robin.rb
|
52
|
+
spec/sandbox/pages/foo/bar.rb
|
53
|
+
spec/sandbox/pages/foo/partials/partial_the_reckoning.rb
|
54
|
+
spec/settings_spec.rb
|
55
|
+
spec/site_generator_spec.rb
|
56
|
+
spec/site_spec.rb
|
57
|
+
spec/spec_helper.rb
|
58
|
+
spec/taza_bin_spec.rb
|
59
|
+
spec/taza_spec.rb
|
60
|
+
spec/taza_tasks_spec.rb
|
61
|
+
spec/unit_helper_spec.rb
|
data/README
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
= taza
|
2
|
+
|
3
|
+
* http://github.com/scudco/taza/tree/master
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Taza is meant to make acceptance testing more sane for developers(or QA where applicable) and customers.
|
8
|
+
|
9
|
+
== FEATURES:
|
10
|
+
|
11
|
+
* Generate a project for browser-based testing
|
12
|
+
* Generate pages and sites for different applications
|
13
|
+
* Create flows that move through a site
|
14
|
+
* Use filters to control which elements are accessible on a page depending on its state
|
15
|
+
* Taza automatically creates and cleans up the browser for each site just like a File block
|
16
|
+
* Manage tests by tags
|
17
|
+
* Cross-site testing
|
18
|
+
|
19
|
+
== ISSUES:
|
20
|
+
|
21
|
+
* Taza has only been used in the wild with WATIR(Safari/Firefox/IE), but Selenium support is built-in
|
22
|
+
* Taza's generators currently generate RSpec specs, Test::Unit and other test framework support is planned
|
23
|
+
|
24
|
+
== SYNOPSIS:
|
25
|
+
|
26
|
+
Taza is meant to be a refreshing way to look at browser testing. Taza provides a few ways to abstract browser-based testing into three simple ideas.
|
27
|
+
* Sites
|
28
|
+
* Pages
|
29
|
+
* Flows
|
30
|
+
|
31
|
+
Sites have Pages.
|
32
|
+
Pages have elements and filters.
|
33
|
+
Flows are common actions on a site such as logging in or performing a search.
|
34
|
+
|
35
|
+
Here's an example for starting a project around the Google sites
|
36
|
+
|
37
|
+
$ taza google
|
38
|
+
$ cd google/
|
39
|
+
$ ./script/generate site google
|
40
|
+
$ ./script/generate page home_page google
|
41
|
+
$ ./script/generate flow search google
|
42
|
+
$ rake spec:functional:google
|
43
|
+
|
44
|
+
That will generate an RSpec HTML report at artifacts/functional/google/index.html
|
45
|
+
|
46
|
+
|
47
|
+
== REQUIREMENTS:
|
48
|
+
|
49
|
+
* taglob
|
50
|
+
|
51
|
+
== INSTALL:
|
52
|
+
|
53
|
+
* sudo gem install taza
|
54
|
+
* gem install taza
|
55
|
+
|
56
|
+
== LICENSE:
|
57
|
+
|
58
|
+
(The MIT License)
|
59
|
+
|
60
|
+
Copyright (c) 2008 Charley Baker
|
61
|
+
|
62
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
63
|
+
a copy of this software and associated documentation files (the
|
64
|
+
'Software'), to deal in the Software without restriction, including
|
65
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
66
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
67
|
+
permit persons to whom the Software is furnished to do so, subject to
|
68
|
+
the following conditions:
|
69
|
+
|
70
|
+
The above copyright notice and this permission notice shall be
|
71
|
+
included in all copies or substantial portions of the Software.
|
72
|
+
|
73
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
74
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
75
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
76
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
77
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
78
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
79
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.textile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"Taza Wiki":http://github.com/scudco/taza/wikis
|
data/VERSION.yml
ADDED
data/bin/taza
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rubigen'
|
5
|
+
|
6
|
+
if %w(-v --version).include? ARGV.first
|
7
|
+
require 'taza'
|
8
|
+
puts "#{File.basename($0)} #{Taza::VERSION}"
|
9
|
+
exit(0)
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'rubigen/scripts/generate'
|
13
|
+
source = RubiGen::PathSource.new(:application,
|
14
|
+
File.join(File.dirname(__FILE__), "../lib/app_generators"))
|
15
|
+
RubiGen::Base.reset_sources
|
16
|
+
RubiGen::Base.append_sources source
|
17
|
+
RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'taza')
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubigen'
|
3
|
+
require 'activesupport'
|
4
|
+
|
5
|
+
class FlowGenerator < RubiGen::Base
|
6
|
+
default_options :author => nil
|
7
|
+
attr_reader :site_name,:name
|
8
|
+
|
9
|
+
def initialize(runtime_args, runtime_options = {})
|
10
|
+
super
|
11
|
+
usage if args.size != 2
|
12
|
+
@name = args.shift
|
13
|
+
@site_name=args.shift
|
14
|
+
check_if_site_exists
|
15
|
+
extract_options
|
16
|
+
end
|
17
|
+
|
18
|
+
def check_if_site_exists
|
19
|
+
unless File.directory?(File.join(destination_root,'lib','sites',site_name.underscore))
|
20
|
+
$stderr.puts "******No such site #{site_name} exists.******"
|
21
|
+
usage
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def manifest
|
26
|
+
record do |m|
|
27
|
+
m.template "flow.rb.erb", File.join('lib','sites', site_name.underscore, "flows", "#{name.underscore}.rb")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
protected
|
32
|
+
def banner
|
33
|
+
<<-EOS
|
34
|
+
Creates a taza flow for a given taza site, site you are making a flow for must exist first.
|
35
|
+
|
36
|
+
USAGE: #{$0} #{spec.name} flow_name site_name
|
37
|
+
EOS
|
38
|
+
end
|
39
|
+
|
40
|
+
def add_options!(opts)
|
41
|
+
# opts.separator ''
|
42
|
+
# opts.separator 'Options:'
|
43
|
+
# For each option below, place the default
|
44
|
+
# at the top of the file next to "default_options"
|
45
|
+
# opts.on("-a", "--author=\"Your Name\"", String,
|
46
|
+
# "Some comment about this option",
|
47
|
+
# "Default: none") { |options[:author]| }
|
48
|
+
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
49
|
+
end
|
50
|
+
|
51
|
+
def extract_options
|
52
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
53
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
54
|
+
# raw instance variable value.
|
55
|
+
# @author = options[:author]
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubigen'
|
3
|
+
require 'activesupport'
|
4
|
+
|
5
|
+
class PageGenerator < RubiGen::Base
|
6
|
+
default_options :author => nil
|
7
|
+
attr_reader :site_name,:name
|
8
|
+
|
9
|
+
def initialize(runtime_args, runtime_options = {})
|
10
|
+
super
|
11
|
+
usage if args.size != 2
|
12
|
+
@name = args.shift
|
13
|
+
@site_name=args.shift
|
14
|
+
check_if_site_exists
|
15
|
+
extract_options
|
16
|
+
end
|
17
|
+
|
18
|
+
def check_if_site_exists
|
19
|
+
unless File.directory?(File.join(destination_root,'lib','sites',site_name.underscore))
|
20
|
+
$stderr.puts "******No such site #{site_name} exists.******"
|
21
|
+
usage
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def manifest
|
26
|
+
record do |m|
|
27
|
+
m.template "page.rb.erb", File.join('lib','sites', site_name.underscore, "pages", "#{name.underscore}_page.rb")
|
28
|
+
m.template "functional_page_spec.rb.erb", File.join('spec','isolation',site_name.underscore,"#{name.underscore}_page_spec.rb")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
protected
|
33
|
+
def banner
|
34
|
+
<<-EOS
|
35
|
+
Creates a taza page for a given taza site, site you are making a page for must exist first.
|
36
|
+
|
37
|
+
USAGE: #{$0} #{spec.name} page_name site_name
|
38
|
+
EOS
|
39
|
+
end
|
40
|
+
|
41
|
+
def add_options!(opts)
|
42
|
+
# opts.separator ''
|
43
|
+
# opts.separator 'Options:'
|
44
|
+
# For each option below, place the default
|
45
|
+
# at the top of the file next to "default_options"
|
46
|
+
# opts.on("-a", "--author=\"Your Name\"", String,
|
47
|
+
# "Some comment about this option",
|
48
|
+
# "Default: none") { |options[:author]| }
|
49
|
+
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
50
|
+
end
|
51
|
+
|
52
|
+
def extract_options
|
53
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
54
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
55
|
+
# raw instance variable value.
|
56
|
+
# @author = options[:author]
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubigen'
|
3
|
+
require 'activesupport'
|
4
|
+
|
5
|
+
class PartialGenerator < RubiGen::Base
|
6
|
+
default_options :author => nil
|
7
|
+
attr_reader :site_name,:name
|
8
|
+
|
9
|
+
def initialize(runtime_args, runtime_options = {})
|
10
|
+
super
|
11
|
+
usage if args.size != 2
|
12
|
+
@name = args.shift
|
13
|
+
@site_name=args.shift
|
14
|
+
check_if_site_exists
|
15
|
+
extract_options
|
16
|
+
end
|
17
|
+
|
18
|
+
def check_if_site_exists
|
19
|
+
unless File.directory?(File.join(destination_root,'lib','sites',site_name.underscore))
|
20
|
+
$stderr.puts "******No such site #{site_name} exists.******"
|
21
|
+
usage
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def manifest
|
26
|
+
record do |m|
|
27
|
+
m.template "partial.rb.erb", File.join('lib','sites', site_name.underscore, "pages", "partials", "#{name.underscore}.rb")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
protected
|
32
|
+
def banner
|
33
|
+
<<-EOS
|
34
|
+
Creates a taza partial for a given taza site, site you are making a partial for must exist first.
|
35
|
+
|
36
|
+
USAGE: #{$0} #{spec.name} partial_name site_name
|
37
|
+
EOS
|
38
|
+
end
|
39
|
+
|
40
|
+
def add_options!(opts)
|
41
|
+
# opts.separator ''
|
42
|
+
# opts.separator 'Options:'
|
43
|
+
# For each option below, place the default
|
44
|
+
# at the top of the file next to "default_options"
|
45
|
+
# opts.on("-a", "--author=\"Your Name\"", String,
|
46
|
+
# "Some comment about this option",
|
47
|
+
# "Default: none") { |options[:author]| }
|
48
|
+
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
49
|
+
end
|
50
|
+
|
51
|
+
def extract_options
|
52
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
53
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
54
|
+
# raw instance variable value.
|
55
|
+
# @author = options[:author]
|
56
|
+
end
|
57
|
+
end
|