watirmark 5.14.16 → 5.27.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/bin/watirmark +2 -8
  3. data/generators/new_project/generator.rb +58 -0
  4. data/{app_generators/create_project/templates/project → generators/new_project/templates}/config.yml.erb +0 -0
  5. data/{app_generators/create_project → generators/new_project}/templates/features/env.rb.erb +0 -0
  6. data/{app_generators/create_project → generators/new_project}/templates/features/model_steps.rb.erb +0 -0
  7. data/{app_generators/create_project → generators/new_project}/templates/features/post_error_steps.rb.erb +0 -0
  8. data/{app_generators/create_project → generators/new_project}/templates/features/sample.feature.erb +0 -0
  9. data/{app_generators/create_project → generators/new_project}/templates/features/site_steps.rb.erb +0 -0
  10. data/generators/new_project/templates/gemfile.rb.erb +10 -0
  11. data/generators/new_project/templates/generators/mvc/generator.rb.erb +61 -0
  12. data/generators/new_project/templates/generators/mvc/templates/controller.rb.erb +9 -0
  13. data/generators/new_project/templates/generators/mvc/templates/model.rb.erb +7 -0
  14. data/generators/new_project/templates/generators/mvc/templates/view.rb.erb +16 -0
  15. data/{app_generators/create_project/templates/library → generators/new_project/templates/lib}/configuration.rb.erb +0 -0
  16. data/{app_generators/create_project/templates/library → generators/new_project/templates/lib}/core_libraries.rb.erb +0 -0
  17. data/{app_generators/create_project/templates/library → generators/new_project/templates/lib}/loader.rb.erb +0 -0
  18. data/{app_generators/create_project/templates/library → generators/new_project/templates/lib/name/checkers}/page_load_checker.rb.erb +0 -0
  19. data/{app_generators/create_project/templates/library → generators/new_project/templates/lib/name/checkers}/post_errors_checker.rb.erb +0 -0
  20. data/{app_generators/create_project/templates/library → generators/new_project/templates/lib/name/site}/base_controller.rb.erb +0 -0
  21. data/{app_generators/create_project/templates/library → generators/new_project/templates/lib/name/site}/base_view.rb.erb +0 -0
  22. data/{app_generators/create_project/templates/library → generators/new_project/templates/lib/name/site}/search_controller.rb.erb +0 -0
  23. data/{app_generators/create_project/templates/library/project_require_file.rb.erb → generators/new_project/templates/lib/name.rb.erb} +0 -0
  24. data/{app_generators/create_project/templates/library → generators/new_project/templates/lib}/workflows.rb.erb +0 -0
  25. data/{app_generators/create_project/templates/project → generators/new_project/templates}/rakefile.rb.erb +1 -1
  26. data/generators/new_project/templates/script/generate.rb.erb +4 -0
  27. data/lib/watirmark/at_exit.rb +5 -9
  28. data/lib/watirmark/configuration.rb +7 -2
  29. data/lib/watirmark/controller/actions.rb +35 -12
  30. data/lib/watirmark/controller/controller.rb +8 -4
  31. data/lib/watirmark/controller/dialogs.rb +3 -3
  32. data/lib/watirmark/cucumber/email_helper.rb +19 -0
  33. data/lib/watirmark/cucumber/env.rb +6 -5
  34. data/lib/watirmark/cucumber/hook_helper.rb +38 -0
  35. data/lib/watirmark/cucumber/hooks.rb +13 -8
  36. data/lib/watirmark/cucumber/load_cached_models.rb +9 -0
  37. data/lib/watirmark/cucumber/model_helper.rb +4 -4
  38. data/lib/watirmark/cucumber/transforms.rb +3 -1
  39. data/lib/watirmark/extensions/ruby_extensions.rb +8 -0
  40. data/lib/watirmark/extensions/webdriver_extensions.rb +38 -3
  41. data/lib/watirmark/formatters/snapshot_formatter.rb +3 -0
  42. data/lib/watirmark/models/cucumber_helper.rb +12 -5
  43. data/lib/watirmark/models/factory.rb +35 -2
  44. data/lib/watirmark/page/page.rb +1 -0
  45. data/lib/watirmark/page/page_definition.rb +7 -5
  46. data/lib/watirmark/profile.rb +2 -2
  47. data/lib/watirmark/rake/smoketest.rb +6 -4
  48. data/lib/watirmark/screenshot.rb +3 -8
  49. data/lib/watirmark/session.rb +105 -9
  50. data/lib/watirmark/version.rb +1 -1
  51. data/lib/watirmark.rb +1 -8
  52. data/spec/config_spec.rb +45 -37
  53. data/spec/controller_actions_spec.rb +70 -7
  54. data/spec/controller_spec.rb +103 -83
  55. data/spec/model_factory_spec.rb +191 -8
  56. data/spec/model_traits_spec.rb +5 -0
  57. data/spec/page_spec.rb +10 -2
  58. data/spec/process_page_spec.rb +3 -3
  59. data/spec/session_spec.rb +56 -0
  60. data/spec/spec_helper.rb +1 -1
  61. metadata +146 -142
  62. data/app_generators/create_project/create_project_generator.rb +0 -115
  63. data/app_generators/create_project/templates/generators/controller.rb.erb +0 -9
  64. data/app_generators/create_project/templates/generators/generate.rb.erb +0 -9
  65. data/app_generators/create_project/templates/generators/model.rb.erb +0 -7
  66. data/app_generators/create_project/templates/generators/mvc_generator.rb.erb +0 -100
  67. data/app_generators/create_project/templates/generators/rbeautify.rb.erb +0 -212
  68. data/app_generators/create_project/templates/generators/view.rb.erb +0 -16
  69. data/app_generators/create_project/templates/generators/workflow_loader.rb.erb +0 -1
  70. data/app_generators/create_project/templates/project/gemfile.rb.erb +0 -11
  71. data/bin/etapestry/Gemfile +0 -11
  72. data/bin/etapestry/config.yml +0 -3
  73. data/bin/etapestry/features/etapestry_home.feature +0 -5
  74. data/bin/etapestry/features/step_definitions/model_steps.rb +0 -9
  75. data/bin/etapestry/features/step_definitions/post_error_steps.rb +0 -15
  76. data/bin/etapestry/features/step_definitions/site_steps.rb +0 -7
  77. data/bin/etapestry/features/support/env.rb +0 -8
  78. data/bin/etapestry/generators/mvc/mvc_generator.rb +0 -100
  79. data/bin/etapestry/generators/mvc/rbeautify.rb +0 -212
  80. data/bin/etapestry/generators/mvc/templates/controller.rb.erb +0 -9
  81. data/bin/etapestry/generators/mvc/templates/model.rb.erb +0 -7
  82. data/bin/etapestry/generators/mvc/templates/view.rb.erb +0 -16
  83. data/bin/etapestry/generators/mvc/templates/workflow_loader.rb.erb +0 -1
  84. data/bin/etapestry/lib/etapestry/checkers/page_load_checker.rb +0 -11
  85. data/bin/etapestry/lib/etapestry/checkers/post_errors_checker.rb +0 -23
  86. data/bin/etapestry/lib/etapestry/configuration.rb +0 -6
  87. data/bin/etapestry/lib/etapestry/core_libraries.rb +0 -9
  88. data/bin/etapestry/lib/etapestry/loader.rb +0 -23
  89. data/bin/etapestry/lib/etapestry/site/base_controller.rb +0 -9
  90. data/bin/etapestry/lib/etapestry/site/base_view.rb +0 -6
  91. data/bin/etapestry/lib/etapestry/site/search_controller.rb +0 -12
  92. data/bin/etapestry/lib/etapestry/workflows.rb +0 -0
  93. data/bin/etapestry/lib/etapestry.rb +0 -8
  94. data/bin/etapestry/rakefile.rb +0 -21
  95. data/bin/etapestry/script/generate.rb +0 -9
  96. data/bin/twitter/features/hashtag_search.feature +0 -93
  97. data/bin/twitter/features/step_definitions/hashtag_steps.rb +0 -9
  98. data/bin/twitter/lib/twitter/workflows/search/result_controller.rb +0 -13
  99. data/bin/twitter/lib/twitter/workflows/search/result_model.rb +0 -5
  100. data/bin/twitter/lib/twitter/workflows/search/result_view.rb +0 -19
@@ -1,23 +0,0 @@
1
- require 'watirmark/session'
2
-
3
- module Watirmark
4
- class Session
5
-
6
- # Post errors are basically any error messages that
7
- # appear to the user when a form submission fails. This catches that
8
- # error and allows the cucumber to catch the error (@@buffer_post_failure)
9
- # or just throw an exception when an error is seen after a post
10
- def self.post_errors
11
- #if Page.browser.table(:class, 'error').present?
12
- # message = Page.browser.table(:class, 'error').text
13
- # if @@buffer_post_failure
14
- # @@post_failure = message.strip
15
- # else
16
- # raise Watirmark::PostFailure, message.strip
17
- # end
18
- #end
19
- end
20
-
21
- Watirmark::Session::POST_WAIT_CHECKERS << Proc.new { Watirmark::Session::post_errors }
22
- end
23
- end
@@ -1,6 +0,0 @@
1
- require 'watirmark/configuration'
2
-
3
- Watirmark::Configuration.instance.defaults = {
4
- :configfile => "#{File.dirname(__FILE__) + '/../..'}/config.yml",
5
- }
6
- Watirmark::Configuration.instance.reload
@@ -1,9 +0,0 @@
1
- require 'etapestry/site/base_view'
2
- require 'etapestry/site/base_controller'
3
- require 'etapestry/site/search_controller'
4
- Watirmark.loader do
5
- base_directory File.dirname(__FILE__)
6
- product 'Etapestry'
7
- load_files 'checkers/**/*.rb'
8
- end
9
-
@@ -1,23 +0,0 @@
1
- require 'watirmark/loader'
2
- module Etapestry
3
- class Loader
4
- class << self
5
- @@loaded = {}
6
-
7
- def load_workflow(name)
8
- load_files name, "*{_view}.rb"
9
- load_files name, "*{_model}.rb"
10
- load_files name, "*{_controller}.rb"
11
- load_files name, "*.rb"
12
- end
13
-
14
- def load_files(name, files)
15
- Watirmark.loader do
16
- base_directory File.dirname(__FILE__)
17
- product 'Etapestry'
18
- load_files "workflows/#{name}#{files}"
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,9 +0,0 @@
1
- module Etapestry
2
- class BaseController < Watirmark::WebPage::Controller
3
-
4
- # default way of submitting a form
5
- def submit
6
- # @view.save_button.click
7
- end
8
- end
9
- end
@@ -1,6 +0,0 @@
1
- module Etapestry
2
- class BaseView < Watirmark::Page
3
- class << self
4
- end
5
- end
6
- end
@@ -1,12 +0,0 @@
1
- module Etapestry
2
- class SearchController < BaseController
3
-
4
- def current_record_visible?
5
- raise "Method needs to be defined in the subclass and return a true/false value"
6
- end
7
-
8
- def populate_data
9
- super unless current_record_visible?
10
- end
11
- end
12
- end
File without changes
@@ -1,8 +0,0 @@
1
- module Etapestry; end
2
-
3
- require 'etapestry/configuration'
4
- require 'watirmark'
5
- require 'etapestry/loader'
6
- require 'etapestry/core_libraries'
7
- require 'etapestry/workflows'
8
-
@@ -1,21 +0,0 @@
1
- $: << File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
2
-
3
- # Run a bundle install if running from Jenkins
4
- begin
5
- sh "bundle install" if File.dirname(__FILE__) =~ /\/(hudson|mnt)\/workspace\//
6
- rescue Gem::RemoteFetcher::FetchError
7
- puts "Unable to connect - retrying #{Time.now}"
8
- retry
9
- end
10
-
11
- require 'bundler/setup'
12
- require 'cucumber/rake/task'
13
-
14
- module RakeHelper
15
- def self.cucumber_task(task_name, files=nil)
16
- Cucumber::Rake::Task.new(task_name) do |t|
17
- t.cucumber_opts = "-r features #{FileList[files]} -b --format html -o reports/report.html --format pretty"
18
- end
19
- end
20
- end
21
-
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- require 'rubigen'
5
- require 'rubigen/scripts/generate'
6
-
7
- ARGV.shift if %w(--help -h).include?(ARGV[0])
8
- RubiGen::Base.use_component_sources! [:rubygems]
9
- RubiGen::Scripts::Generate.new.run(ARGV)
@@ -1,93 +0,0 @@
1
- Feature: Searches using the hashtag symbol(#) should return a list of tweets containing that hashtag
2
- Given I am logged in as a twitter user
3
- When I enter a search using a hashtag
4
- Then I expect to see a list of results for that hashtag
5
-
6
- Background:
7
- Given I go to the home page
8
-
9
-
10
-
11
- # This is the test we're going to automate
12
-
13
- Scenario: Searching for a hashtag should only return results containing that hashtag
14
- When I search for "#trest"
15
- Then I should only see tweets containing the term "#blackbaud"
16
-
17
-
18
-
19
-
20
- Scenario: Hashtags in tweets should show as links
21
- When I create a new tweet "This is a tweet with a #test hashtag"
22
- Then the tweet should contain "#test"
23
-
24
- Scenario: Clicking hashtags in tweets should show search results for the hashtag
25
- When I create a new tweet "This is a tweet to follow with a #test hashtag"
26
- And I click the hashtag "#test" in the last tweet
27
- Then I should only see tweets containing the term "#test"
28
-
29
- Scenario: Multiple hashtags should return results containing *all* hashtags defined (AND search)
30
- When I search for "#blackbaud #winning"
31
- Then I should only see tweets containing the terms "#blackbaud" and "#winning"
32
-
33
- Scenario: Saving a hashtag search should preserve the hashtag in the search
34
- When I search for "#blackbaud"
35
- And I save the search
36
- Then I should see the search in the dropdown saved searches list
37
- And I should be able to select the search from that list
38
- And I should only see tweets containing the term "#blackbaud"
39
-
40
- Scenario: New tweets should periodically show 'N new tweets' at the top of the list
41
- When I search for "#blackbaud"
42
- And I create a new tweet "This is a tweet with a #test hashtag using the API" using the API
43
- Then I should see the new tweets header with "1 new tweet"
44
- When I click the new tweets header
45
- Then I should see the tweet "This is a tweet with a #test hashtag using the API"
46
-
47
- Scenario: Empty search results should display the "No tweet results" message
48
- When I search for "#this_is_an_empty_search_test"
49
- Then I should see the search message "No tweet results for #this_is_an_empty_search_test"
50
-
51
- Scenario: "Top" Tweets should be the default search list
52
- When I search for "#blackbaud"
53
- Then the selected search filter should be "Top"
54
-
55
- Scenario: Clicking "Top" should show the most popular tweets on that hashtag
56
- When I search for "#blackbaud"
57
- And I select the search filter "All"
58
- And I select the search filter "Top"
59
- Then the selected search filter should be "Top"
60
- And the tweets should pull from the most popular list for "#blackbaud"
61
-
62
- Scenario: Clicking "All" should show the most recent tweets on that hashtag
63
- When I search for "#blackbaud"
64
- And I select the search filter "All"
65
- Then the selected search filter should be "All"
66
- And the tweets should pull from the full list for "#blackbaud"
67
-
68
- Scenario: Clicking "People you follow" should only show hashtag tweets from your follow list
69
- When I search for "#blackbaud"
70
- And I select the search filter "People you follow"
71
- Then the selected search filter should be "People you follow"
72
- And the tweets should pull from the people list for "#blackbaud"
73
-
74
- Scenario: Scrolling to the end of the list should autoload the next 20 matches
75
- When I search for "#blackbaud"
76
- And I scroll to the bottom of the page
77
- Then the next 20 results should load
78
- And the search should contain more than 20 results
79
-
80
- Scenario: The max size of the list should be 20 items
81
- When I search for "#blackbaud"
82
- Then the search should contain at most 20 results
83
-
84
- Scenario: Advanced searches should honor a single hashtag
85
-
86
- Scenario: Advanced searches should honor a multiple hashtags
87
-
88
- Scenario: Promoted tweets should show regardless of the search terms
89
-
90
- Scenario: Hitting the enter button should return the same set of results as clicking the looking glass
91
-
92
- Scenario: Searching for a string (not hashtag) should return results matching the hashtag or the string
93
-
@@ -1,9 +0,0 @@
1
- # use generators
2
-
3
- When /^I search for "(.*?)"$/ do |arg1|
4
- Search::Query.new(:search_term => arg1).create
5
- end
6
-
7
- Then /^I should only see tweets containing the term "(.*?)"$/ do |arg1|
8
- Search::Result.each { |result| result.should =~ /#{arg1}/i }
9
- end
@@ -1,13 +0,0 @@
1
- module Twitter
2
- module Search
3
- class Result < BaseController
4
- @model = ResultModel
5
- @view = ResultView
6
-
7
- def self.each
8
- @view.results.each {|item| yield item}
9
- end
10
- end
11
- end
12
- end
13
-
@@ -1,5 +0,0 @@
1
- module Twitter
2
- module Search
3
- ResultModel = Watirmark::Model::Base.new(*ResultView.keywords)
4
- end
5
- end
@@ -1,19 +0,0 @@
1
- module Twitter
2
- module Search
3
- class ResultView < BaseView
4
- private_keyword(:result_container) { browser.div(:id => 'stream-items-id')}
5
- private_keyword(:results) { result_container.divs(:class, 'content').map(&:text)}
6
-
7
- class << self
8
- def home(model)
9
- end
10
-
11
- def create(model)
12
- end
13
-
14
- def edit(model)
15
- end
16
- end
17
- end
18
- end
19
- end