metry 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +376 -0
- data/README.txt +62 -0
- data/Rakefile +23 -0
- data/TODO +10 -0
- data/example/example.rb +22 -0
- data/features/app_tracking.feature +11 -0
- data/features/basic_tracking.feature +88 -0
- data/features/sample_application.feature +12 -0
- data/features/step_definitions/tracking.rb +35 -0
- data/features/step_definitions/web.rb +31 -0
- data/features/support/env.rb +22 -0
- data/lib/metry.rb +19 -0
- data/lib/metry/experiment.rb +25 -0
- data/lib/metry/memory.rb +27 -0
- data/lib/metry/rack/tracking.rb +51 -0
- data/lib/metry/tokyo.rb +153 -0
- data/radiant/example/CHANGELOG +611 -0
- data/radiant/example/CONTRIBUTORS +168 -0
- data/radiant/example/INSTALL +38 -0
- data/radiant/example/LICENSE +21 -0
- data/radiant/example/README +60 -0
- data/radiant/example/Rakefile +21 -0
- data/radiant/example/config/boot.rb +161 -0
- data/radiant/example/config/database.yml +20 -0
- data/radiant/example/config/environment.rb +83 -0
- data/radiant/example/config/environments/cucumber.rb +18 -0
- data/radiant/example/config/environments/development.rb +17 -0
- data/radiant/example/config/environments/production.rb +19 -0
- data/radiant/example/config/environments/test.rb +36 -0
- data/radiant/example/config/routes.rb +1 -0
- data/radiant/example/db/schema.rb +112 -0
- data/radiant/example/features/metry.feature +139 -0
- data/radiant/example/features/step_definitions/experiments.rb +12 -0
- data/radiant/example/features/step_definitions/radiant.rb +14 -0
- data/radiant/example/features/step_definitions/tracking.rb +35 -0
- data/radiant/example/features/step_definitions/web.rb +22 -0
- data/radiant/example/features/support/env.rb +52 -0
- data/radiant/example/public/.htaccess +40 -0
- data/radiant/example/public/404.html +8 -0
- data/radiant/example/public/500.html +8 -0
- data/radiant/example/public/dispatch.cgi +10 -0
- data/radiant/example/public/dispatch.fcgi +24 -0
- data/radiant/example/public/dispatch.rb +10 -0
- data/radiant/example/public/favicon.ico +0 -0
- data/radiant/example/public/images/admin/add-child.png +0 -0
- data/radiant/example/public/images/admin/brown-bottom-line.gif +0 -0
- data/radiant/example/public/images/admin/clear-page-cache.png +0 -0
- data/radiant/example/public/images/admin/collapse.png +0 -0
- data/radiant/example/public/images/admin/expand.png +0 -0
- data/radiant/example/public/images/admin/layout.png +0 -0
- data/radiant/example/public/images/admin/minus.png +0 -0
- data/radiant/example/public/images/admin/new-homepage.png +0 -0
- data/radiant/example/public/images/admin/new-layout.png +0 -0
- data/radiant/example/public/images/admin/new-snippet.png +0 -0
- data/radiant/example/public/images/admin/new-user.png +0 -0
- data/radiant/example/public/images/admin/page.png +0 -0
- data/radiant/example/public/images/admin/plus.png +0 -0
- data/radiant/example/public/images/admin/remove-disabled.png +0 -0
- data/radiant/example/public/images/admin/remove.png +0 -0
- data/radiant/example/public/images/admin/snippet.png +0 -0
- data/radiant/example/public/images/admin/spinner.gif +0 -0
- data/radiant/example/public/images/admin/view-site.gif +0 -0
- data/radiant/example/public/images/admin/virtual-page.png +0 -0
- data/radiant/example/public/javascripts/admin/admin.js +149 -0
- data/radiant/example/public/javascripts/admin/ruledtable.js +13 -0
- data/radiant/example/public/javascripts/admin/sitemap.js +132 -0
- data/radiant/example/public/javascripts/admin/tabcontrol.js +133 -0
- data/radiant/example/public/javascripts/application.js +2 -0
- data/radiant/example/public/javascripts/controls.js +963 -0
- data/radiant/example/public/javascripts/dragdrop.js +973 -0
- data/radiant/example/public/javascripts/effects.js +1128 -0
- data/radiant/example/public/javascripts/pngfix.js +39 -0
- data/radiant/example/public/javascripts/prototype.js +4320 -0
- data/radiant/example/public/javascripts/string.js +17 -0
- data/radiant/example/public/robots.txt +1 -0
- data/radiant/example/public/stylesheets/admin/main.css +640 -0
- data/radiant/example/script/about +3 -0
- data/radiant/example/script/autospec +5 -0
- data/radiant/example/script/breakpointer +3 -0
- data/radiant/example/script/console +3 -0
- data/radiant/example/script/cucumber +8 -0
- data/radiant/example/script/dbconsole +3 -0
- data/radiant/example/script/extension +5 -0
- data/radiant/example/script/generate +18 -0
- data/radiant/example/script/performance/benchmarker +3 -0
- data/radiant/example/script/performance/profiler +3 -0
- data/radiant/example/script/performance/request +3 -0
- data/radiant/example/script/process/inspector +3 -0
- data/radiant/example/script/process/reaper +3 -0
- data/radiant/example/script/process/spawner +3 -0
- data/radiant/example/script/process/spinner +3 -0
- data/radiant/example/script/runner +3 -0
- data/radiant/example/script/server +3 -0
- data/radiant/example/script/spec +5 -0
- data/radiant/example/script/spec_server +116 -0
- data/radiant/example/script/version +5 -0
- data/radiant/extension/README +3 -0
- data/radiant/extension/Rakefile +120 -0
- data/radiant/extension/lib/metry_tags.rb +25 -0
- data/radiant/extension/lib/tasks/metry_extension_tasks.rake +28 -0
- data/radiant/extension/metry_extension.rb +24 -0
- data/test/shared.rb +6 -0
- data/test/test_tokyo.rb +14 -0
- data/vendor/rufus-tokyo/CHANGELOG.txt +112 -0
- data/vendor/rufus-tokyo/CREDITS.txt +27 -0
- data/vendor/rufus-tokyo/LICENSE.txt +21 -0
- data/vendor/rufus-tokyo/README.txt +310 -0
- data/vendor/rufus-tokyo/Rakefile +118 -0
- data/vendor/rufus-tokyo/TODO.txt +25 -0
- data/vendor/rufus-tokyo/doc/decision_table.numbers +0 -0
- data/vendor/rufus-tokyo/doc/rdoc-style.css +320 -0
- data/vendor/rufus-tokyo/lib/rufus-edo.rb +3 -0
- data/vendor/rufus-tokyo/lib/rufus-tokyo.rb +3 -0
- data/vendor/rufus-tokyo/lib/rufus/edo.rb +39 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/README.txt +106 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/cabcore.rb +333 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/cabinet/abstract.rb +219 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/cabinet/table.rb +159 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/error.rb +36 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/ntyrant.rb +4 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/ntyrant/abstract.rb +137 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/ntyrant/table.rb +141 -0
- data/vendor/rufus-tokyo/lib/rufus/edo/tabcore.rb +567 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo.rb +58 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/cabinet/abstract.rb +568 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/cabinet/lib.rb +230 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/cabinet/table.rb +753 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/cabinet/util.rb +425 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/config.rb +161 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/dystopia.rb +43 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/dystopia/lib.rb +65 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/dystopia/words.rb +71 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/hmethods.rb +111 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/query.rb +102 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/transactions.rb +74 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/ttcommons.rb +59 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/tyrant.rb +35 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/tyrant/abstract.rb +146 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/tyrant/lib.rb +153 -0
- data/vendor/rufus-tokyo/lib/rufus/tokyo/tyrant/table.rb +162 -0
- data/vendor/rufus-tokyo/rufus-tokyo.gemspec +25 -0
- data/vendor/rufus-tokyo/spec/cabinet_spec.rb +472 -0
- data/vendor/rufus-tokyo/spec/cabinetconfig_spec.rb +82 -0
- data/vendor/rufus-tokyo/spec/edo_cabinet_spec.rb +447 -0
- data/vendor/rufus-tokyo/spec/edo_ntyrant_spec.rb +299 -0
- data/vendor/rufus-tokyo/spec/edo_ntyrant_table_spec.rb +462 -0
- data/vendor/rufus-tokyo/spec/edo_table_spec.rb +560 -0
- data/vendor/rufus-tokyo/spec/hmethods_spec.rb +44 -0
- data/vendor/rufus-tokyo/spec/incr.lua +20 -0
- data/vendor/rufus-tokyo/spec/spec.rb +9 -0
- data/vendor/rufus-tokyo/spec/spec_base.rb +23 -0
- data/vendor/rufus-tokyo/spec/start_tyrants.sh +26 -0
- data/vendor/rufus-tokyo/spec/stop_tyrants.sh +9 -0
- data/vendor/rufus-tokyo/spec/table_spec.rb +567 -0
- data/vendor/rufus-tokyo/spec/tyrant_spec.rb +309 -0
- data/vendor/rufus-tokyo/spec/tyrant_table_spec.rb +479 -0
- data/vendor/rufus-tokyo/spec/util_list_spec.rb +200 -0
- data/vendor/rufus-tokyo/spec/util_map_spec.rb +132 -0
- data/vendor/rufus-tokyo/tasks/dev.rb +70 -0
- data/vendor/rufus-tokyo/test/bm0.rb +353 -0
- data/vendor/rufus-tokyo/test/bm1_compression.rb +54 -0
- data/vendor/rufus-tokyo/test/con0.rb +30 -0
- data/vendor/rufus-tokyo/test/mem.rb +49 -0
- data/vendor/rufus-tokyo/test/mem1.rb +44 -0
- data/vendor/rufus-tokyo/test/readme0.rb +17 -0
- data/vendor/rufus-tokyo/test/readme1.rb +21 -0
- data/vendor/rufus-tokyo/test/readme2.rb +15 -0
- data/vendor/rufus-tokyo/test/readme3.rb +24 -0
- data/vendor/rufus-tokyo/test/readmes_test.sh +17 -0
- data/vendor/webrat/.document +4 -0
- data/vendor/webrat/History.txt +358 -0
- data/vendor/webrat/MIT-LICENSE.txt +19 -0
- data/vendor/webrat/README.rdoc +85 -0
- data/vendor/webrat/Rakefile +200 -0
- data/vendor/webrat/install.rb +1 -0
- data/vendor/webrat/lib/webrat.rb +31 -0
- data/vendor/webrat/lib/webrat/core.rb +14 -0
- data/vendor/webrat/lib/webrat/core/configuration.rb +102 -0
- data/vendor/webrat/lib/webrat/core/elements/area.rb +31 -0
- data/vendor/webrat/lib/webrat/core/elements/element.rb +33 -0
- data/vendor/webrat/lib/webrat/core/elements/field.rb +411 -0
- data/vendor/webrat/lib/webrat/core/elements/form.rb +103 -0
- data/vendor/webrat/lib/webrat/core/elements/label.rb +31 -0
- data/vendor/webrat/lib/webrat/core/elements/link.rb +93 -0
- data/vendor/webrat/lib/webrat/core/elements/select_option.rb +35 -0
- data/vendor/webrat/lib/webrat/core/locators.rb +20 -0
- data/vendor/webrat/lib/webrat/core/locators/area_locator.rb +38 -0
- data/vendor/webrat/lib/webrat/core/locators/button_locator.rb +54 -0
- data/vendor/webrat/lib/webrat/core/locators/field_by_id_locator.rb +37 -0
- data/vendor/webrat/lib/webrat/core/locators/field_labeled_locator.rb +56 -0
- data/vendor/webrat/lib/webrat/core/locators/field_locator.rb +25 -0
- data/vendor/webrat/lib/webrat/core/locators/field_named_locator.rb +41 -0
- data/vendor/webrat/lib/webrat/core/locators/form_locator.rb +19 -0
- data/vendor/webrat/lib/webrat/core/locators/label_locator.rb +34 -0
- data/vendor/webrat/lib/webrat/core/locators/link_locator.rb +74 -0
- data/vendor/webrat/lib/webrat/core/locators/locator.rb +20 -0
- data/vendor/webrat/lib/webrat/core/locators/select_option_locator.rb +59 -0
- data/vendor/webrat/lib/webrat/core/logging.rb +24 -0
- data/vendor/webrat/lib/webrat/core/matchers.rb +4 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_content.rb +73 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_selector.rb +74 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_tag.rb +21 -0
- data/vendor/webrat/lib/webrat/core/matchers/have_xpath.rb +147 -0
- data/vendor/webrat/lib/webrat/core/methods.rb +63 -0
- data/vendor/webrat/lib/webrat/core/mime.rb +29 -0
- data/vendor/webrat/lib/webrat/core/save_and_open_page.rb +48 -0
- data/vendor/webrat/lib/webrat/core/scope.rb +350 -0
- data/vendor/webrat/lib/webrat/core/session.rb +290 -0
- data/vendor/webrat/lib/webrat/core/xml.rb +115 -0
- data/vendor/webrat/lib/webrat/core/xml/hpricot.rb +19 -0
- data/vendor/webrat/lib/webrat/core/xml/nokogiri.rb +76 -0
- data/vendor/webrat/lib/webrat/core/xml/rexml.rb +24 -0
- data/vendor/webrat/lib/webrat/core_extensions/blank.rb +58 -0
- data/vendor/webrat/lib/webrat/core_extensions/deprecate.rb +8 -0
- data/vendor/webrat/lib/webrat/core_extensions/detect_mapped.rb +12 -0
- data/vendor/webrat/lib/webrat/core_extensions/meta_class.rb +6 -0
- data/vendor/webrat/lib/webrat/core_extensions/nil_to_param.rb +5 -0
- data/vendor/webrat/lib/webrat/core_extensions/tcp_socket.rb +27 -0
- data/vendor/webrat/lib/webrat/mechanize.rb +74 -0
- data/vendor/webrat/lib/webrat/merb.rb +9 -0
- data/vendor/webrat/lib/webrat/merb_multipart_support.rb +27 -0
- data/vendor/webrat/lib/webrat/merb_session.rb +80 -0
- data/vendor/webrat/lib/webrat/rack.rb +24 -0
- data/vendor/webrat/lib/webrat/rack_test.rb +32 -0
- data/vendor/webrat/lib/webrat/rails.rb +105 -0
- data/vendor/webrat/lib/webrat/rspec-rails.rb +10 -0
- data/vendor/webrat/lib/webrat/selenium.rb +81 -0
- data/vendor/webrat/lib/webrat/selenium/application_server_factory.rb +40 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers.rb +5 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers/base.rb +46 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers/external.rb +26 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers/merb.rb +50 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers/rails.rb +44 -0
- data/vendor/webrat/lib/webrat/selenium/application_servers/sinatra.rb +37 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/button.js +19 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/label.js +16 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webrat.js +5 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlink.js +12 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js +15 -0
- data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js +5 -0
- data/vendor/webrat/lib/webrat/selenium/matchers.rb +4 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_content.rb +66 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_selector.rb +49 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_tag.rb +72 -0
- data/vendor/webrat/lib/webrat/selenium/matchers/have_xpath.rb +45 -0
- data/vendor/webrat/lib/webrat/selenium/selenium_extensions.js +6 -0
- data/vendor/webrat/lib/webrat/selenium/selenium_rc_server.rb +84 -0
- data/vendor/webrat/lib/webrat/selenium/selenium_session.rb +248 -0
- data/vendor/webrat/lib/webrat/selenium/silence_stream.rb +18 -0
- data/vendor/webrat/lib/webrat/sinatra.rb +44 -0
- data/vendor/webrat/spec/fakes/test_session.rb +34 -0
- data/vendor/webrat/spec/integration/merb/Rakefile +35 -0
- data/vendor/webrat/spec/integration/merb/app/controllers/application.rb +2 -0
- data/vendor/webrat/spec/integration/merb/app/controllers/exceptions.rb +13 -0
- data/vendor/webrat/spec/integration/merb/app/controllers/testing.rb +27 -0
- data/vendor/webrat/spec/integration/merb/app/views/exceptions/not_acceptable.html.erb +63 -0
- data/vendor/webrat/spec/integration/merb/app/views/exceptions/not_found.html.erb +47 -0
- data/vendor/webrat/spec/integration/merb/app/views/layout/application.html.erb +12 -0
- data/vendor/webrat/spec/integration/merb/app/views/testing/show_form.html.erb +27 -0
- data/vendor/webrat/spec/integration/merb/app/views/testing/upload.html.erb +9 -0
- data/vendor/webrat/spec/integration/merb/config/environments/development.rb +15 -0
- data/vendor/webrat/spec/integration/merb/config/environments/rake.rb +11 -0
- data/vendor/webrat/spec/integration/merb/config/environments/test.rb +14 -0
- data/vendor/webrat/spec/integration/merb/config/init.rb +25 -0
- data/vendor/webrat/spec/integration/merb/config/rack.rb +11 -0
- data/vendor/webrat/spec/integration/merb/config/router.rb +34 -0
- data/vendor/webrat/spec/integration/merb/spec/spec.opts +1 -0
- data/vendor/webrat/spec/integration/merb/spec/spec_helper.rb +24 -0
- data/vendor/webrat/spec/integration/merb/spec/webrat_spec.rb +39 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/app_script.rb +31 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/common.rb +64 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/gem_ext.rb +124 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/main.thor +150 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/ops.rb +93 -0
- data/vendor/webrat/spec/integration/merb/tasks/merb.thor/utils.rb +40 -0
- data/vendor/webrat/spec/integration/rack/Rakefile +5 -0
- data/vendor/webrat/spec/integration/rack/rack_app.rb +16 -0
- data/vendor/webrat/spec/integration/rack/test/test_helper.rb +20 -0
- data/vendor/webrat/spec/integration/rack/test/webrat_rack_test.rb +67 -0
- data/vendor/webrat/spec/integration/rails/Rakefile +30 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/application.rb +15 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/buttons_controller.rb +7 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/fields_controller.rb +4 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/links_controller.rb +7 -0
- data/vendor/webrat/spec/integration/rails/app/controllers/webrat_controller.rb +43 -0
- data/vendor/webrat/spec/integration/rails/app/helpers/buttons_helper.rb +2 -0
- data/vendor/webrat/spec/integration/rails/app/helpers/fields_helper.rb +2 -0
- data/vendor/webrat/spec/integration/rails/app/helpers/links_helper.rb +2 -0
- data/vendor/webrat/spec/integration/rails/app/views/buttons/show.html.erb +11 -0
- data/vendor/webrat/spec/integration/rails/app/views/fields/show.html.erb +9 -0
- data/vendor/webrat/spec/integration/rails/app/views/links/show.html.erb +5 -0
- data/vendor/webrat/spec/integration/rails/app/views/webrat/before_redirect_form.html.erb +4 -0
- data/vendor/webrat/spec/integration/rails/app/views/webrat/buttons.html.erb +11 -0
- data/vendor/webrat/spec/integration/rails/app/views/webrat/form.html.erb +28 -0
- data/vendor/webrat/spec/integration/rails/config/boot.rb +109 -0
- data/vendor/webrat/spec/integration/rails/config/environment.rb +12 -0
- data/vendor/webrat/spec/integration/rails/config/environments/development.rb +17 -0
- data/vendor/webrat/spec/integration/rails/config/environments/selenium.rb +22 -0
- data/vendor/webrat/spec/integration/rails/config/environments/test.rb +22 -0
- data/vendor/webrat/spec/integration/rails/config/initializers/inflections.rb +10 -0
- data/vendor/webrat/spec/integration/rails/config/initializers/mime_types.rb +5 -0
- data/vendor/webrat/spec/integration/rails/config/initializers/new_rails_defaults.rb +17 -0
- data/vendor/webrat/spec/integration/rails/config/locales/en.yml +5 -0
- data/vendor/webrat/spec/integration/rails/config/routes.rb +18 -0
- data/vendor/webrat/spec/integration/rails/public/404.html +30 -0
- data/vendor/webrat/spec/integration/rails/public/422.html +30 -0
- data/vendor/webrat/spec/integration/rails/public/500.html +33 -0
- data/vendor/webrat/spec/integration/rails/script/about +4 -0
- data/vendor/webrat/spec/integration/rails/script/console +3 -0
- data/vendor/webrat/spec/integration/rails/script/dbconsole +3 -0
- data/vendor/webrat/spec/integration/rails/script/destroy +3 -0
- data/vendor/webrat/spec/integration/rails/script/generate +3 -0
- data/vendor/webrat/spec/integration/rails/script/performance/benchmarker +3 -0
- data/vendor/webrat/spec/integration/rails/script/performance/profiler +3 -0
- data/vendor/webrat/spec/integration/rails/script/performance/request +3 -0
- data/vendor/webrat/spec/integration/rails/script/plugin +3 -0
- data/vendor/webrat/spec/integration/rails/script/process/inspector +3 -0
- data/vendor/webrat/spec/integration/rails/script/process/reaper +3 -0
- data/vendor/webrat/spec/integration/rails/script/process/spawner +3 -0
- data/vendor/webrat/spec/integration/rails/script/runner +3 -0
- data/vendor/webrat/spec/integration/rails/script/server +3 -0
- data/vendor/webrat/spec/integration/rails/test/integration/button_click_test.rb +80 -0
- data/vendor/webrat/spec/integration/rails/test/integration/fill_in_test.rb +24 -0
- data/vendor/webrat/spec/integration/rails/test/integration/link_click_test.rb +27 -0
- data/vendor/webrat/spec/integration/rails/test/integration/webrat_test.rb +97 -0
- data/vendor/webrat/spec/integration/rails/test/test_helper.rb +25 -0
- data/vendor/webrat/spec/integration/sinatra/Rakefile +5 -0
- data/vendor/webrat/spec/integration/sinatra/classic_app.rb +64 -0
- data/vendor/webrat/spec/integration/sinatra/modular_app.rb +16 -0
- data/vendor/webrat/spec/integration/sinatra/test/classic_app_test.rb +37 -0
- data/vendor/webrat/spec/integration/sinatra/test/modular_app_test.rb +18 -0
- data/vendor/webrat/spec/integration/sinatra/test/test_helper.rb +16 -0
- data/vendor/webrat/spec/private/core/configuration_spec.rb +116 -0
- data/vendor/webrat/spec/private/core/field_spec.rb +85 -0
- data/vendor/webrat/spec/private/core/link_spec.rb +24 -0
- data/vendor/webrat/spec/private/core/logging_spec.rb +10 -0
- data/vendor/webrat/spec/private/core/session_spec.rb +195 -0
- data/vendor/webrat/spec/private/mechanize/mechanize_session_spec.rb +81 -0
- data/vendor/webrat/spec/private/merb/attaches_file_spec.rb +93 -0
- data/vendor/webrat/spec/private/merb/merb_session_spec.rb +61 -0
- data/vendor/webrat/spec/private/nokogiri_spec.rb +77 -0
- data/vendor/webrat/spec/private/rails/attaches_file_spec.rb +81 -0
- data/vendor/webrat/spec/private/rails/rails_session_spec.rb +110 -0
- data/vendor/webrat/spec/private/selenium/application_servers/rails_spec.rb +26 -0
- data/vendor/webrat/spec/public/basic_auth_spec.rb +24 -0
- data/vendor/webrat/spec/public/check_spec.rb +191 -0
- data/vendor/webrat/spec/public/choose_spec.rb +118 -0
- data/vendor/webrat/spec/public/click_area_spec.rb +106 -0
- data/vendor/webrat/spec/public/click_button_spec.rb +496 -0
- data/vendor/webrat/spec/public/click_link_spec.rb +511 -0
- data/vendor/webrat/spec/public/fill_in_spec.rb +209 -0
- data/vendor/webrat/spec/public/locators/field_by_xpath_spec.rb +19 -0
- data/vendor/webrat/spec/public/locators/field_labeled_spec.rb +172 -0
- data/vendor/webrat/spec/public/locators/field_with_id_spec.rb +16 -0
- data/vendor/webrat/spec/public/matchers/contain_spec.rb +114 -0
- data/vendor/webrat/spec/public/matchers/have_selector_spec.rb +142 -0
- data/vendor/webrat/spec/public/matchers/have_tag_spec.rb +39 -0
- data/vendor/webrat/spec/public/matchers/have_xpath_spec.rb +136 -0
- data/vendor/webrat/spec/public/reload_spec.rb +10 -0
- data/vendor/webrat/spec/public/save_and_open_spec.rb +70 -0
- data/vendor/webrat/spec/public/select_date_spec.rb +112 -0
- data/vendor/webrat/spec/public/select_datetime_spec.rb +137 -0
- data/vendor/webrat/spec/public/select_spec.rb +249 -0
- data/vendor/webrat/spec/public/select_time_spec.rb +100 -0
- data/vendor/webrat/spec/public/selenium/application_server_factory_spec.rb +49 -0
- data/vendor/webrat/spec/public/selenium/application_servers/external_spec.rb +12 -0
- data/vendor/webrat/spec/public/selenium/selenium_session_spec.rb +37 -0
- data/vendor/webrat/spec/public/set_hidden_field_spec.rb +5 -0
- data/vendor/webrat/spec/public/submit_form_spec.rb +5 -0
- data/vendor/webrat/spec/public/visit_spec.rb +58 -0
- data/vendor/webrat/spec/public/within_spec.rb +177 -0
- data/vendor/webrat/spec/rcov.opts +1 -0
- data/vendor/webrat/spec/spec.opts +2 -0
- data/vendor/webrat/spec/spec_helper.rb +50 -0
- data/vendor/webrat/vendor/selenium-server.jar +0 -0
- metadata +442 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
require "webrat/core/elements/element"
|
2
|
+
|
3
|
+
module Webrat
|
4
|
+
class Area < Element #:nodoc:
|
5
|
+
|
6
|
+
def self.xpath_search
|
7
|
+
".//area"
|
8
|
+
end
|
9
|
+
|
10
|
+
def click(method = nil, options = {})
|
11
|
+
@session.request_page(absolute_href, :get, {})
|
12
|
+
end
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
def href
|
17
|
+
Webrat::XML.attribute(@element, "href")
|
18
|
+
end
|
19
|
+
|
20
|
+
def absolute_href
|
21
|
+
if href =~ /^\?/
|
22
|
+
"#{@session.current_url}#{href}"
|
23
|
+
elsif href !~ %r{^https?://[\w|.]+(/.*)} && (href !~ /^\//)
|
24
|
+
"#{@session.current_url}/#{href}"
|
25
|
+
else
|
26
|
+
href
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Webrat
|
2
|
+
|
3
|
+
class Element # :nodoc:
|
4
|
+
|
5
|
+
def self.load_all(session, dom)
|
6
|
+
Webrat::XML.xpath_search(dom, xpath_search).map do |element|
|
7
|
+
load(session, element)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.load(session, element)
|
12
|
+
return nil if element.nil?
|
13
|
+
session.elements[Webrat::XML.xpath_to(element)] ||= self.new(session, element)
|
14
|
+
end
|
15
|
+
|
16
|
+
attr_reader :element
|
17
|
+
|
18
|
+
def initialize(session, element)
|
19
|
+
@session = session
|
20
|
+
@element = element
|
21
|
+
end
|
22
|
+
|
23
|
+
def path
|
24
|
+
Webrat::XML.xpath_to(@element)
|
25
|
+
end
|
26
|
+
|
27
|
+
def inspect
|
28
|
+
"#<#{self.class} @element=#{element.inspect}>"
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
@@ -0,0 +1,411 @@
|
|
1
|
+
require "cgi"
|
2
|
+
require "webrat/core_extensions/blank"
|
3
|
+
require "webrat/core_extensions/nil_to_param"
|
4
|
+
|
5
|
+
require "webrat/core/elements/element"
|
6
|
+
|
7
|
+
module Webrat
|
8
|
+
# Raised when Webrat is asked to manipulate a disabled form field
|
9
|
+
class DisabledFieldError < WebratError
|
10
|
+
end
|
11
|
+
|
12
|
+
class Field < Element #:nodoc:
|
13
|
+
attr_reader :value
|
14
|
+
|
15
|
+
def self.xpath_search
|
16
|
+
[".//button", ".//input", ".//textarea", ".//select"]
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.xpath_search_excluding_hidden
|
20
|
+
[".//button", ".//input[ @type != 'hidden']", ".//textarea", ".//select"]
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.field_classes
|
24
|
+
@field_classes || []
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.inherited(klass)
|
28
|
+
@field_classes ||= []
|
29
|
+
@field_classes << klass
|
30
|
+
# raise args.inspect
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.load(session, element)
|
34
|
+
return nil if element.nil?
|
35
|
+
session.elements[Webrat::XML.xpath_to(element)] ||= field_class(element).new(session, element)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.field_class(element)
|
39
|
+
case element.name
|
40
|
+
when "button" then ButtonField
|
41
|
+
when "select" then SelectField
|
42
|
+
when "textarea" then TextareaField
|
43
|
+
else
|
44
|
+
case Webrat::XML.attribute(element, "type")
|
45
|
+
when "checkbox" then CheckboxField
|
46
|
+
when "hidden" then HiddenField
|
47
|
+
when "radio" then RadioField
|
48
|
+
when "password" then PasswordField
|
49
|
+
when "file" then FileField
|
50
|
+
when "reset" then ResetField
|
51
|
+
when "submit" then ButtonField
|
52
|
+
when "button" then ButtonField
|
53
|
+
when "image" then ButtonField
|
54
|
+
else TextField
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def initialize(*args)
|
60
|
+
super
|
61
|
+
@value = default_value
|
62
|
+
end
|
63
|
+
|
64
|
+
def label_text
|
65
|
+
return nil if labels.empty?
|
66
|
+
labels.first.text
|
67
|
+
end
|
68
|
+
|
69
|
+
def id
|
70
|
+
Webrat::XML.attribute(@element, "id")
|
71
|
+
end
|
72
|
+
|
73
|
+
def disabled?
|
74
|
+
@element.attributes.has_key?("disabled") && Webrat::XML.attribute(@element, "disabled") != 'false'
|
75
|
+
end
|
76
|
+
|
77
|
+
def raise_error_if_disabled
|
78
|
+
return unless disabled?
|
79
|
+
raise DisabledFieldError.new("Cannot interact with disabled form element (#{self})")
|
80
|
+
end
|
81
|
+
|
82
|
+
def to_param
|
83
|
+
return nil if disabled?
|
84
|
+
|
85
|
+
case Webrat.configuration.mode
|
86
|
+
when :rails
|
87
|
+
parse_rails_request_params("#{name}=#{escaped_value}")
|
88
|
+
when :merb
|
89
|
+
::Merb::Parse.query("#{name}=#{escaped_value}")
|
90
|
+
when :mechanize
|
91
|
+
{ name => value }
|
92
|
+
else
|
93
|
+
{ name => escaped_value }
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def set(value)
|
98
|
+
@value = value
|
99
|
+
end
|
100
|
+
|
101
|
+
def unset
|
102
|
+
@value = default_value
|
103
|
+
end
|
104
|
+
|
105
|
+
protected
|
106
|
+
|
107
|
+
def parse_rails_request_params(params)
|
108
|
+
if defined?(ActionController::AbstractRequest)
|
109
|
+
ActionController::AbstractRequest.parse_query_parameters(params)
|
110
|
+
elsif defined?(ActionController::UrlEncodedPairParser)
|
111
|
+
# For Rails > 2.2
|
112
|
+
ActionController::UrlEncodedPairParser.parse_query_parameters(params)
|
113
|
+
else
|
114
|
+
# For Rails > 2.3
|
115
|
+
Rack::Utils.parse_nested_query(params)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def form
|
120
|
+
Form.load(@session, form_element)
|
121
|
+
end
|
122
|
+
|
123
|
+
def form_element
|
124
|
+
parent = @element.parent
|
125
|
+
|
126
|
+
while parent.respond_to?(:parent)
|
127
|
+
return parent if parent.name == 'form'
|
128
|
+
parent = parent.parent
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def name
|
133
|
+
Webrat::XML.attribute(@element, "name")
|
134
|
+
end
|
135
|
+
|
136
|
+
def escaped_value
|
137
|
+
CGI.escape([*@value].first.to_s)
|
138
|
+
end
|
139
|
+
|
140
|
+
def labels
|
141
|
+
@labels ||= label_elements.map do |element|
|
142
|
+
Label.load(@session, element)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
def label_elements
|
147
|
+
return @label_elements unless @label_elements.nil?
|
148
|
+
@label_elements = []
|
149
|
+
|
150
|
+
parent = @element.parent
|
151
|
+
while parent.respond_to?(:parent)
|
152
|
+
if parent.name == 'label'
|
153
|
+
@label_elements.push parent
|
154
|
+
break
|
155
|
+
end
|
156
|
+
parent = parent.parent
|
157
|
+
end
|
158
|
+
|
159
|
+
unless id.blank?
|
160
|
+
@label_elements += Webrat::XML.xpath_search(form.element, ".//label[@for = '#{id}']")
|
161
|
+
end
|
162
|
+
|
163
|
+
@label_elements
|
164
|
+
end
|
165
|
+
|
166
|
+
def default_value
|
167
|
+
Webrat::XML.attribute(@element, "value")
|
168
|
+
end
|
169
|
+
|
170
|
+
def replace_param_value(params, oval, nval)
|
171
|
+
output = Hash.new
|
172
|
+
params.each do |key, value|
|
173
|
+
case value
|
174
|
+
when Hash
|
175
|
+
value = replace_param_value(value, oval, nval)
|
176
|
+
when Array
|
177
|
+
value = value.map { |o| o == oval ? nval : oval }
|
178
|
+
when oval
|
179
|
+
value = nval
|
180
|
+
end
|
181
|
+
output[key] = value
|
182
|
+
end
|
183
|
+
output
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
class ButtonField < Field #:nodoc:
|
188
|
+
|
189
|
+
def self.xpath_search
|
190
|
+
[".//button", ".//input[@type = 'submit']", ".//input[@type = 'button']", ".//input[@type = 'image']"]
|
191
|
+
end
|
192
|
+
|
193
|
+
def to_param
|
194
|
+
return nil if @value.nil?
|
195
|
+
super
|
196
|
+
end
|
197
|
+
|
198
|
+
def default_value
|
199
|
+
nil
|
200
|
+
end
|
201
|
+
|
202
|
+
def click
|
203
|
+
raise_error_if_disabled
|
204
|
+
set(Webrat::XML.attribute(@element, "value")) unless Webrat::XML.attribute(@element, "name").blank?
|
205
|
+
form.submit
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
|
210
|
+
class HiddenField < Field #:nodoc:
|
211
|
+
|
212
|
+
def self.xpath_search
|
213
|
+
".//input[@type = 'hidden']"
|
214
|
+
end
|
215
|
+
|
216
|
+
def to_param
|
217
|
+
if collection_name?
|
218
|
+
super
|
219
|
+
else
|
220
|
+
checkbox_with_same_name = form.field_named(name, CheckboxField)
|
221
|
+
|
222
|
+
if checkbox_with_same_name.to_param.blank?
|
223
|
+
super
|
224
|
+
else
|
225
|
+
nil
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
protected
|
231
|
+
|
232
|
+
def collection_name?
|
233
|
+
name =~ /\[\]/
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
237
|
+
|
238
|
+
class CheckboxField < Field #:nodoc:
|
239
|
+
|
240
|
+
def self.xpath_search
|
241
|
+
".//input[@type = 'checkbox']"
|
242
|
+
end
|
243
|
+
|
244
|
+
def to_param
|
245
|
+
return nil if @value.nil?
|
246
|
+
super
|
247
|
+
end
|
248
|
+
|
249
|
+
def check
|
250
|
+
raise_error_if_disabled
|
251
|
+
set(Webrat::XML.attribute(@element, "value") || "on")
|
252
|
+
end
|
253
|
+
|
254
|
+
def checked?
|
255
|
+
Webrat::XML.attribute(@element, "checked") == "checked"
|
256
|
+
end
|
257
|
+
|
258
|
+
def uncheck
|
259
|
+
raise_error_if_disabled
|
260
|
+
set(nil)
|
261
|
+
end
|
262
|
+
|
263
|
+
protected
|
264
|
+
|
265
|
+
def default_value
|
266
|
+
if Webrat::XML.attribute(@element, "checked") == "checked"
|
267
|
+
Webrat::XML.attribute(@element, "value") || "on"
|
268
|
+
else
|
269
|
+
nil
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
end
|
274
|
+
|
275
|
+
class PasswordField < Field #:nodoc:
|
276
|
+
|
277
|
+
def self.xpath_search
|
278
|
+
".//input[@type = 'password']"
|
279
|
+
end
|
280
|
+
|
281
|
+
end
|
282
|
+
|
283
|
+
class RadioField < Field #:nodoc:
|
284
|
+
|
285
|
+
def self.xpath_search
|
286
|
+
".//input[@type = 'radio']"
|
287
|
+
end
|
288
|
+
|
289
|
+
def to_param
|
290
|
+
return nil if @value.nil?
|
291
|
+
super
|
292
|
+
end
|
293
|
+
|
294
|
+
def choose
|
295
|
+
raise_error_if_disabled
|
296
|
+
other_options.each do |option|
|
297
|
+
option.set(nil)
|
298
|
+
end
|
299
|
+
|
300
|
+
set(Webrat::XML.attribute(@element, "value") || "on")
|
301
|
+
end
|
302
|
+
|
303
|
+
def checked?
|
304
|
+
Webrat::XML.attribute(@element, "checked") == "checked"
|
305
|
+
end
|
306
|
+
|
307
|
+
protected
|
308
|
+
|
309
|
+
def other_options
|
310
|
+
form.fields.select { |f| f.name == name }
|
311
|
+
end
|
312
|
+
|
313
|
+
def default_value
|
314
|
+
if Webrat::XML.attribute(@element, "checked") == "checked"
|
315
|
+
Webrat::XML.attribute(@element, "value") || "on"
|
316
|
+
else
|
317
|
+
nil
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
end
|
322
|
+
|
323
|
+
class TextareaField < Field #:nodoc:
|
324
|
+
|
325
|
+
def self.xpath_search
|
326
|
+
".//textarea"
|
327
|
+
end
|
328
|
+
|
329
|
+
protected
|
330
|
+
|
331
|
+
def default_value
|
332
|
+
Webrat::XML.inner_html(@element)
|
333
|
+
end
|
334
|
+
|
335
|
+
end
|
336
|
+
|
337
|
+
class FileField < Field #:nodoc:
|
338
|
+
|
339
|
+
def self.xpath_search
|
340
|
+
".//input[@type = 'file']"
|
341
|
+
end
|
342
|
+
|
343
|
+
attr_accessor :content_type
|
344
|
+
|
345
|
+
def set(value, content_type = nil)
|
346
|
+
super(value)
|
347
|
+
@content_type = content_type
|
348
|
+
end
|
349
|
+
|
350
|
+
def to_param
|
351
|
+
if @value.nil?
|
352
|
+
super
|
353
|
+
else
|
354
|
+
replace_param_value(super, @value, test_uploaded_file)
|
355
|
+
end
|
356
|
+
end
|
357
|
+
|
358
|
+
protected
|
359
|
+
|
360
|
+
def test_uploaded_file
|
361
|
+
case Webrat.configuration.mode
|
362
|
+
when :rails
|
363
|
+
if content_type
|
364
|
+
ActionController::TestUploadedFile.new(@value, content_type)
|
365
|
+
else
|
366
|
+
ActionController::TestUploadedFile.new(@value)
|
367
|
+
end
|
368
|
+
when :merb
|
369
|
+
# TODO: support content_type
|
370
|
+
File.new(@value)
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
end
|
375
|
+
|
376
|
+
class TextField < Field #:nodoc:
|
377
|
+
def self.xpath_search
|
378
|
+
[".//input[@type = 'text']", ".//input[not(@type)]"]
|
379
|
+
end
|
380
|
+
end
|
381
|
+
|
382
|
+
class ResetField < Field #:nodoc:
|
383
|
+
def self.xpath_search
|
384
|
+
".//input[@type = 'reset']"
|
385
|
+
end
|
386
|
+
end
|
387
|
+
|
388
|
+
class SelectField < Field #:nodoc:
|
389
|
+
|
390
|
+
def self.xpath_search
|
391
|
+
".//select"
|
392
|
+
end
|
393
|
+
|
394
|
+
def options
|
395
|
+
@options ||= SelectOption.load_all(@session, @element)
|
396
|
+
end
|
397
|
+
|
398
|
+
protected
|
399
|
+
|
400
|
+
def default_value
|
401
|
+
selected_options = Webrat::XML.xpath_search(@element, ".//option[@selected = 'selected']")
|
402
|
+
selected_options = Webrat::XML.xpath_search(@element, ".//option[position() = 1]") if selected_options.empty?
|
403
|
+
|
404
|
+
selected_options.map do |option|
|
405
|
+
return "" if option.nil?
|
406
|
+
Webrat::XML.attribute(option, "value") || Webrat::XML.inner_html(option)
|
407
|
+
end.uniq
|
408
|
+
end
|
409
|
+
|
410
|
+
end
|
411
|
+
end
|