ui_changed 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/app/assets/javascripts/ui_changed/application.js +17 -0
- data/app/assets/javascripts/ui_changed/screenshots.js +280 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/assets/stylesheets/ui_changed/application.css.scss +17 -0
- data/app/assets/stylesheets/ui_changed/screenshot_ignore_urls.css +4 -0
- data/app/assets/stylesheets/ui_changed/screenshots.css +24 -0
- data/app/controllers/ui_changed/application_controller.rb +4 -0
- data/app/controllers/ui_changed/screenshot_ignore_urls_controller.rb +61 -0
- data/app/controllers/ui_changed/screenshots_controller.rb +266 -0
- data/app/controllers/ui_changed/screenshots_controller_base.rb +26 -0
- data/app/helpers/ui_changed/application_helper.rb +45 -0
- data/app/helpers/ui_changed/screenshot_ignore_urls_helper.rb +4 -0
- data/app/helpers/ui_changed/screenshots_helper.rb +4 -0
- data/app/mailers/ui_changed/notifications_mailer.rb +57 -0
- data/app/models/ui_changed/all_screenshot.rb +11 -0
- data/app/models/ui_changed/config_helper.rb +12 -0
- data/app/models/ui_changed/screenshot.rb +258 -0
- data/app/models/ui_changed/screenshot_ignore_url.rb +15 -0
- data/app/views/layouts/ui_changed/application.html.haml +15 -0
- data/app/views/ui_changed/screenshot_ignore_urls/index.haml +21 -0
- data/app/views/ui_changed/screenshots/_side_nav.haml +32 -0
- data/app/views/ui_changed/screenshots/_top_buttons.haml +36 -0
- data/app/views/ui_changed/screenshots/diff.haml +17 -0
- data/app/views/ui_changed/screenshots/diffs.haml +35 -0
- data/app/views/ui_changed/screenshots/index.haml +31 -0
- data/app/views/ui_changed/screenshots/screenshots.haml +30 -0
- data/app/workers/ui_changed/compare.rb +11 -0
- data/app/workers/ui_changed/crawl_control.rb +11 -0
- data/app/workers/ui_changed/crawl_test.rb +11 -0
- data/app/workers/ui_changed/worker_base.rb +206 -0
- data/config/initializers/load_config.rb +1 -0
- data/config/routes.rb +40 -0
- data/db/migrate/20130203000059_create_ui_changed_screenshots.rb +18 -0
- data/db/migrate/20130203001050_create_ui_changed_screenshot_ignore_urls.rb +9 -0
- data/lib/generators/ui_changed/resque_generator.rb +11 -0
- data/lib/generators/ui_changed/templates/resque.rb +7 -0
- data/lib/tasks/ui_changed_tasks.rake +42 -0
- data/lib/ui_changed/engine.rb +18 -0
- data/lib/ui_changed/railtie.rb +12 -0
- data/lib/ui_changed/version.rb +3 -0
- data/lib/ui_changed.rb +5 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/chromedriver.log +486 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +20 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config/ui_changed.yml +25 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +37 -0
- data/spec/dummy/log/development.log +28757 -0
- data/spec/dummy/log/test.log +47119 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/tmp/cache/assets/C25/650/sprockets%2F2146cc379ac52d93283881b087238840 +0 -0
- data/spec/dummy/tmp/cache/assets/C88/A00/sprockets%2F1576563f31b9463de3b98380b65316ec +0 -0
- data/spec/dummy/tmp/cache/assets/C9B/6B0/sprockets%2F14ad16343013da7f4c5807074f60da43 +0 -0
- data/spec/dummy/tmp/cache/assets/CB1/9B0/sprockets%2F11e63881c7fd93eb64b28b031752f184 +0 -0
- data/spec/dummy/tmp/cache/assets/CB6/C00/sprockets%2Fb3476726ad470583738cd4b345f805fa +0 -0
- data/spec/dummy/tmp/cache/assets/CB7/210/sprockets%2F138a8a31cd8188425abf378b7580856b +0 -0
- data/spec/dummy/tmp/cache/assets/CC0/7C0/sprockets%2Fdb1c954004648bf1999b7ef93c470907 +0 -0
- data/spec/dummy/tmp/cache/assets/CC1/7E0/sprockets%2F552f5b296379701887bf62b61e1eef55 +0 -0
- data/spec/dummy/tmp/cache/assets/CC2/E90/sprockets%2F5ca8fbc29937906ce87a35703a588175 +0 -0
- data/spec/dummy/tmp/cache/assets/CCE/6B0/sprockets%2F3c43115c074131cc27dff45ad1436d39 +0 -0
- data/spec/dummy/tmp/cache/assets/CE1/C50/sprockets%2Fb8c09b0556e29fb12b443f9491758ba1 +0 -0
- data/spec/dummy/tmp/cache/assets/CE2/4F0/sprockets%2F6cf98982c6e31026cd1b25b10d91d955 +0 -0
- data/spec/dummy/tmp/cache/assets/CE2/C60/sprockets%2F05ee6fb6374ce346eb036fa585800159 +0 -0
- data/spec/dummy/tmp/cache/assets/CE4/590/sprockets%2F3f8762728eca1e27313d667a68da61d2 +0 -0
- data/spec/dummy/tmp/cache/assets/CE7/120/sprockets%2F91db081288bd6181c67f7f600d8ac179 +0 -0
- data/spec/dummy/tmp/cache/assets/CE9/6D0/sprockets%2F8eeb2f4e707f4444d25caf8597182412 +0 -0
- data/spec/dummy/tmp/cache/assets/CF1/2F0/sprockets%2F84b5d275d61e77e4c8e971305e71b4d9 +0 -0
- data/spec/dummy/tmp/cache/assets/CF5/010/sprockets%2Ff9d2179a39f51f93bc6f88003845d72f +0 -0
- data/spec/dummy/tmp/cache/assets/D05/6A0/sprockets%2F8d3a80f374b4052fa19d7903c0615dda +0 -0
- data/spec/dummy/tmp/cache/assets/D06/890/sprockets%2F078f78e2e12080050f3bc2eab77b24d8 +0 -0
- data/spec/dummy/tmp/cache/assets/D0E/710/sprockets%2F98ad5b57d4c0b614b15d44e16c20988c +0 -0
- data/spec/dummy/tmp/cache/assets/D18/E30/sprockets%2F373b25f3feb8e02173177a3258fa9f8f +0 -0
- data/spec/dummy/tmp/cache/assets/D1B/200/sprockets%2Feb488fd44186315924274c9fbddf26c1 +0 -0
- data/spec/dummy/tmp/cache/assets/D2B/650/sprockets%2F17e0bd2471845003ab1d326b9df4fb2d +0 -0
- data/spec/dummy/tmp/cache/assets/D33/A80/sprockets%2Fe0e3c435fb1e0437fd54f6118152dbd4 +0 -0
- data/spec/dummy/tmp/cache/assets/D51/3D0/sprockets%2F0b8889dd27a294e91ac45d88f45ab19e +0 -0
- data/spec/dummy/tmp/cache/assets/D52/FC0/sprockets%2Fc7ee307174bd9ce8d84a7a714989de50 +0 -0
- data/spec/dummy/tmp/cache/assets/D57/590/sprockets%2Fa5889cfed7da6867603309e46febf336 +0 -0
- data/spec/dummy/tmp/cache/assets/D62/A70/sprockets%2F9da26ba4665f1bd1946b15f4fb7c00a2 +0 -0
- data/spec/dummy/tmp/cache/assets/D64/280/sprockets%2F41468fda40a48db35907717ec1cae4aa +0 -0
- data/spec/dummy/tmp/cache/assets/D65/BE0/sprockets%2Facc8f0cfb7c0b17255efd15087505b18 +0 -0
- data/spec/dummy/tmp/cache/assets/D6C/9E0/sprockets%2F8168f977dd050ba2afddd02af6139c71 +0 -0
- data/spec/dummy/tmp/cache/assets/D70/3A0/sprockets%2Fe4a9a1e8cb76dfec37b1f404f8519240 +0 -0
- data/spec/dummy/tmp/cache/assets/D74/BE0/sprockets%2Fd7aee2b6e1730859c0e0467f1d7cce93 +0 -0
- data/spec/dummy/tmp/cache/assets/D78/BC0/sprockets%2F207af09f77a5d6abe8dc1e03949835fc +0 -0
- data/spec/dummy/tmp/cache/assets/D84/D90/sprockets%2Fb8af3475f4baf9fd7b6a7c46c7451868 +0 -0
- data/spec/dummy/tmp/cache/assets/D8B/A20/sprockets%2F3ed551887fcdca6e97a755b75f945c6d +0 -0
- data/spec/dummy/tmp/cache/assets/D8E/0D0/sprockets%2F8742e2ef2bd56a3d1d0bb872b3cc217a +0 -0
- data/spec/dummy/tmp/cache/assets/D9F/BC0/sprockets%2F2f95d2d7024aadccb97622d868ec4db2 +0 -0
- data/spec/dummy/tmp/cache/assets/D9F/DC0/sprockets%2F37e94b5bc0f9440b90d05da4e4feee63 +0 -0
- data/spec/dummy/tmp/cache/assets/DB5/B70/sprockets%2F9b6928fa917be6edb53695facf9037db +0 -0
- data/spec/dummy/tmp/cache/assets/DC6/940/sprockets%2Facd26daf8801a48cf5d6b0d441da38d6 +0 -0
- data/spec/dummy/tmp/cache/assets/DED/010/sprockets%2F63ff0e07c5aa4b10d7defd921c0cf41d +0 -0
- data/spec/dummy/tmp/cache/assets/DFB/070/sprockets%2F827a36ec30d2db41fb4174a9c3dfeffe +0 -0
- data/spec/dummy/tmp/cache/assets/DFD/DD0/sprockets%2F20e429deffdda56940cc5c6cab9d73a3 +0 -0
- data/spec/dummy/tmp/cache/assets/E89/3E0/sprockets%2Fea640cb8bbbf5cfa9435ddeebd7b42a8 +0 -0
- data/spec/dummy/tmp/cache/sass/2d87c55fb19cbf8c06f79a1d11d9921f7ccdf621/bootstrap-responsive.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/2d87c55fb19cbf8c06f79a1d11d9921f7ccdf621/bootstrap.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_accordion.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_alerts.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_breadcrumbs.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_button-groups.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_buttons.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_carousel.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_close.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_code.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_component-animations.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_dropdowns.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_forms.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_grid.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_hero-unit.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_labels-badges.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_layouts.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_media.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_mixins.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_modals.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_navbar.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_navs.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_pager.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_pagination.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_popovers.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_progress-bars.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_reset.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_responsive-1200px-min.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_responsive-767px-max.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_responsive-768px-979px.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_responsive-navbar.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_responsive-utilities.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_scaffolding.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_sprites.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_tables.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_thumbnails.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_tooltip.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_type.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_utilities.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_variables.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/_wells.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/bootstrap.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/90f0768cf7e8daaf11afd7e1e4fcba1811609e39/responsive.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/94c49ca37a72afd14b662ec7a424412bc283c3cf/application.css.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/a83afe1449c73975e2fd619cb5f810eada3c2894/_font-awesome.sassc +0 -0
- data/spec/models/screenshot_actions_spec.rb +126 -0
- data/spec/models/screenshots_ignore_url_spec.rb +24 -0
- data/spec/models/screenshots_spec.rb +144 -0
- data/spec/routing/screenshots_spec.rb +71 -0
- data/spec/spec_helper.rb +66 -0
- data/spec/support/factories/screenshot.rb +14 -0
- data/spec/support/factories/screenshot_ignore_url.rb +5 -0
- data/spec/test_screenshots/control/image_1.png +0 -0
- data/spec/test_screenshots/control/image_1_small.png +0 -0
- data/spec/test_screenshots/control/image_2.png +0 -0
- data/spec/test_screenshots/control/image_2_small.png +0 -0
- data/spec/test_screenshots/control/image_3.png +0 -0
- data/spec/test_screenshots/control/image_3_small.png +0 -0
- data/spec/test_screenshots/control/image_4.png +0 -0
- data/spec/test_screenshots/control/image_4_small.png +0 -0
- data/spec/test_screenshots/control/image_5.png +0 -0
- data/spec/test_screenshots/control/image_5_small.png +0 -0
- data/spec/test_screenshots/test/image_10.png +0 -0
- data/spec/test_screenshots/test/image_10_small.png +0 -0
- data/spec/test_screenshots/test/image_6.png +0 -0
- data/spec/test_screenshots/test/image_6_small.png +0 -0
- data/spec/test_screenshots/test/image_7.png +0 -0
- data/spec/test_screenshots/test/image_7_small.png +0 -0
- data/spec/test_screenshots/test/image_8.png +0 -0
- data/spec/test_screenshots/test/image_8_small.png +0 -0
- data/spec/test_screenshots/test/image_9.png +0 -0
- data/spec/test_screenshots/test/image_9_small.png +0 -0
- metadata +610 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module UiChanged
|
|
2
|
+
class ScreenshotIgnoreUrl < ActiveRecord::Base
|
|
3
|
+
attr_accessible :url
|
|
4
|
+
|
|
5
|
+
validates :url, :presence => true, :format => URI::regexp(%w(http https))
|
|
6
|
+
|
|
7
|
+
self.per_page = 10
|
|
8
|
+
|
|
9
|
+
class << self
|
|
10
|
+
def search(search)
|
|
11
|
+
UiChanged::ScreenshotIgnoreUrl.where('ui_changed_screenshot_ignore_urls.url LIKE ?', "%#{search}%")
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!DOCTYPE HTML>
|
|
2
|
+
%html
|
|
3
|
+
%head
|
|
4
|
+
%title UiChanged
|
|
5
|
+
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
|
|
6
|
+
%meta{:charset => "utf-8"}
|
|
7
|
+
= stylesheet_link_tag "ui_changed/application", :media => "all"
|
|
8
|
+
= javascript_include_tag "ui_changed/application"
|
|
9
|
+
= csrf_meta_tags
|
|
10
|
+
%script{:src => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"}
|
|
11
|
+
%body
|
|
12
|
+
.container
|
|
13
|
+
.row
|
|
14
|
+
.span3= render :partial => "ui_changed/screenshots/side_nav"
|
|
15
|
+
.span9= yield
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
= render :partial => "ui_changed/screenshots/top_buttons", :locals => {:screenshots => @ignored_urls}
|
|
2
|
+
.page-header
|
|
3
|
+
%h1 Ignored Urls
|
|
4
|
+
-if @ignored_urls.length > 0
|
|
5
|
+
%input.f_remove_url{:type => "hidden", :value => "/ui_changed/screenshot_ignore_urls/"}
|
|
6
|
+
%table.table.table-striped.screenshots
|
|
7
|
+
%thead
|
|
8
|
+
%tr
|
|
9
|
+
%th
|
|
10
|
+
%th URL
|
|
11
|
+
%tbody
|
|
12
|
+
-@ignored_urls.each do |url|
|
|
13
|
+
%tr
|
|
14
|
+
%input.f_id{:type => "hidden", :value => url.id}
|
|
15
|
+
%td
|
|
16
|
+
%input.f_checkall_child{:type => "checkbox"}
|
|
17
|
+
%td
|
|
18
|
+
%a{:href => url.url}= url.url
|
|
19
|
+
= will_paginate @ignored_urls
|
|
20
|
+
-else
|
|
21
|
+
%span No ignored urls
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.well
|
|
2
|
+
%ul.nav.nav-list
|
|
3
|
+
%li{:class => request.fullpath == screenshots_path ? "active" : ""}
|
|
4
|
+
%a{:href => screenshots_path}
|
|
5
|
+
%i.icon-home
|
|
6
|
+
Home
|
|
7
|
+
%li.divider
|
|
8
|
+
%li.f_sidenav_diffs{:class => request.fullpath.include?(screenshot_diffs_path) ? "active" : ""}
|
|
9
|
+
%a{:href => screenshot_diffs_path}
|
|
10
|
+
%i.icon-warning-sign
|
|
11
|
+
%span Diffs
|
|
12
|
+
%span.pull-right= @diff_count
|
|
13
|
+
%li.f_sidenav_controls{:class => request.fullpath.include?(screenshot_controls_path) ? "active" : ""}
|
|
14
|
+
%a{:href => screenshot_controls_path}
|
|
15
|
+
%i.icon-picture
|
|
16
|
+
%span Controls
|
|
17
|
+
%span.pull-right= @control_count
|
|
18
|
+
%li.f_sidenav_tests{:class => request.fullpath.include?(screenshot_tests_path) ? "active" : ""}
|
|
19
|
+
%a{:href => screenshot_tests_path}
|
|
20
|
+
%i.icon-picture
|
|
21
|
+
%span Tests
|
|
22
|
+
%span.pull-right= @test_count
|
|
23
|
+
%li.f_sidenav_compares{:class => request.fullpath.include?(screenshot_compares_path) ? "active" : ""}
|
|
24
|
+
%a{:href => screenshot_compares_path}
|
|
25
|
+
%i.icon-resize-small
|
|
26
|
+
%span Compares
|
|
27
|
+
%span.pull-right= @compare_count
|
|
28
|
+
%li{:class => request.fullpath.include?(screenshot_ignore_urls_path) ? "active" : ""}
|
|
29
|
+
%a{:href => screenshot_ignore_urls_path}
|
|
30
|
+
%i.icon-flag
|
|
31
|
+
%span Ignored Urls
|
|
32
|
+
%span.pull-right= @ignore_count
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.btn-toolbar
|
|
2
|
+
-if screenshots && screenshots.length > 0
|
|
3
|
+
.btn-group
|
|
4
|
+
%label.btn.btn-toggle{:for => "checkall"}
|
|
5
|
+
%input#f_checkall{:type => "checkbox"}
|
|
6
|
+
.btn-group.f_actions
|
|
7
|
+
-if show_remove_test_and_diff request.fullpath
|
|
8
|
+
%button.btn.f_remove_test_and_diff{"data-href" => remove_diff_and_test_path, "data-original-title" => "Remove Test & Diff", :rel => "tooltip"} Remove Test & Diff
|
|
9
|
+
-if show_remove request.fullpath
|
|
10
|
+
%button.btn.f_remove{"data-original-title" => "Remove", :rel => "tooltip"} Remove
|
|
11
|
+
-if show_ignore_url request.fullpath
|
|
12
|
+
%button.btn.f_ignore{"data-original-title" => "Ignore", :rel => "tooltip"} Ignore Url
|
|
13
|
+
-if show_set_test_as_control request.fullpath
|
|
14
|
+
%button.btn.f_set_test_as_control{"data-original-title" => "Set as Control", :rel => "tooltip"} Set Test as Control
|
|
15
|
+
.btn-group
|
|
16
|
+
%button.btn.dropdown-toggle{"data-toggle" => "dropdown"}
|
|
17
|
+
Bulk Actions
|
|
18
|
+
%span.caret
|
|
19
|
+
%ul.dropdown-menu.f_bulk_actions
|
|
20
|
+
-if show_remove_test_and_diff request.fullpath
|
|
21
|
+
%li
|
|
22
|
+
%a.f_remove_all_diffs_and_tests{:href => "javascript:void(0);", "data-href" => remove_all_diffs_and_tests_path, "data-original-title" => "Remove All Diffs & Tests", :rel => "tooltip"} Remove All Tests & Diffs
|
|
23
|
+
-if show_remove request.fullpath
|
|
24
|
+
%li
|
|
25
|
+
%a.f_remove_all{:href => "javascript:void(0);", "data-href" => remove_all_path(request.fullpath), "data-original-title" => "Remove All", :rel => "tooltip"} Remove All
|
|
26
|
+
-if show_ignore_url request.fullpath
|
|
27
|
+
%li
|
|
28
|
+
%a.f_ignore_all_urls{:href => "javascript:void(0);", "data-href" => ignore_all_urls_path(request.fullpath), "data-original-title" => "Ignore All", :rel => "tooltip"} Ignore All Urls
|
|
29
|
+
-if show_set_test_as_control request.fullpath
|
|
30
|
+
%li
|
|
31
|
+
%a.f_set_all_tests_as_control{:href => "javascript:void(0);", "data-href" => screenshot_set_all_tests_as_control_path, "data-original-title" => "Set All Tests as Control", :rel => "tooltip"} Set All Tests as Control
|
|
32
|
+
.btn-group.pull-right
|
|
33
|
+
%form
|
|
34
|
+
.input-append
|
|
35
|
+
%input{:type => "text", :name => "search", :placeholder => "Search...", :value => @search}
|
|
36
|
+
%button.btn{:type => "submit"} Search
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
= render :partial => "ui_changed/screenshots/top_buttons", :locals => {:screenshots => nil, :show_buttons => true}
|
|
2
|
+
%h1 Diff Screenshot
|
|
3
|
+
%h3
|
|
4
|
+
%a{:href => @control.url}= @control.url
|
|
5
|
+
.diff_screenshots
|
|
6
|
+
.span3
|
|
7
|
+
-img_loc = "#{@control.displayable_image_path_full}"
|
|
8
|
+
%a{:href => img_loc}
|
|
9
|
+
= image_tag(img_loc)
|
|
10
|
+
.span3
|
|
11
|
+
-img_loc = "#{@test.displayable_image_path_full}"
|
|
12
|
+
%a{:href => img_loc}
|
|
13
|
+
= image_tag(img_loc)
|
|
14
|
+
.span3
|
|
15
|
+
-img_loc = "#{@diff.displayable_image_path_full}"
|
|
16
|
+
%a{:href => img_loc}
|
|
17
|
+
= image_tag(img_loc)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
= render :partial => "ui_changed/screenshots/top_buttons", :locals => {:screenshots => @all_screenshots}
|
|
2
|
+
.page-header
|
|
3
|
+
%h1 Diff Screenshots
|
|
4
|
+
-if @all_screenshots.length > 0
|
|
5
|
+
%table.table.table-striped.screenshots.diffs
|
|
6
|
+
-if @search
|
|
7
|
+
%span= "Showing search results for \"#{@search}\""
|
|
8
|
+
%thead
|
|
9
|
+
%tr
|
|
10
|
+
%th
|
|
11
|
+
%th Control
|
|
12
|
+
%th Test
|
|
13
|
+
%th Diff
|
|
14
|
+
%th URL
|
|
15
|
+
%tbody
|
|
16
|
+
-@all_screenshots.each do |screenshots|
|
|
17
|
+
%tr
|
|
18
|
+
%input.f_id{:type => "hidden", :value => screenshots.diff_ss.id}
|
|
19
|
+
%input.diff_url{:type => "hidden", :value => screenshot_diff_path + "?diff_id=#{screenshots.diff_ss.id}"}
|
|
20
|
+
%td
|
|
21
|
+
%input.f_checkall_child{:type => "checkbox"}
|
|
22
|
+
%td
|
|
23
|
+
%a{:href => "#{screenshots.control_ss.displayable_image_path_full}"}
|
|
24
|
+
= image_tag("#{screenshots.control_ss.displayable_image_path_small_full}")
|
|
25
|
+
%td
|
|
26
|
+
%a{:href => "#{screenshots.test_ss.displayable_image_path_full}"}
|
|
27
|
+
= image_tag("#{screenshots.test_ss.displayable_image_path_small_full}")
|
|
28
|
+
%td
|
|
29
|
+
%a{:href => "#{screenshots.diff_ss.displayable_image_path_full}"}
|
|
30
|
+
= image_tag("#{screenshots.diff_ss.displayable_image_path_small_full}")
|
|
31
|
+
%td
|
|
32
|
+
%a{:href => screenshots.control_ss.url}= screenshots.control_ss.url
|
|
33
|
+
= will_paginate @diffs
|
|
34
|
+
-else
|
|
35
|
+
No screenshots
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
%input.f_crawl_working{:type => "hidden", :value => @crawl_working}
|
|
2
|
+
%input.f_on_home_page{:type => "hidden", :value => (request.fullpath == screenshots_path ? "true" : "false")}
|
|
3
|
+
.btn-group.crawl_btns
|
|
4
|
+
%button.btn.btn-large.btn-success.f_crawl_action{"data-action" => screenshot_start_all_path, "data-original-title" => "Start control, then test, then compare", :rel => "tooltip"} Start All
|
|
5
|
+
%button.btn.btn-large.btn-success.dropdown-toggle{"data-toggle" => "dropdown"}
|
|
6
|
+
%span.caret
|
|
7
|
+
%ul.dropdown-menu
|
|
8
|
+
%li
|
|
9
|
+
%a.f_crawl_action{:href => "javascript:void(0);", "data-action" => screenshot_start_control_test_path, "data-original-title" => "Start control, then test", :rel => "tooltip"} Start Control & Test
|
|
10
|
+
%li
|
|
11
|
+
%a.f_crawl_action{:href => "javascript:void(0);", "data-action" => screenshot_start_control_compare_path, "data-original-title" => "Start control, then compare", :rel => "tooltip"} Start Control & Compare
|
|
12
|
+
%li
|
|
13
|
+
%a.f_crawl_action{:href => "javascript:void(0);", "data-action" => screenshot_start_test_compare_path, "data-original-title" => "Start test, then compare", :rel => "tooltip"} Start Test & Compare
|
|
14
|
+
.btn-group.crawl_btns
|
|
15
|
+
%button.btn.btn-large.f_crawl_action{"data-action" => screenshot_start_control_path, "data-type" => "control"} Start Control
|
|
16
|
+
%button.btn.btn-large.f_crawl_action{"data-action" => screenshot_start_test_path, "data-type" => "test"} Start Test
|
|
17
|
+
%button.btn.btn-large.f_crawl_action{"data-action" => screenshot_start_compare_path, "data-type" => "compare"} Start Compare
|
|
18
|
+
-cancel_style = @crawl_working == "false" ? "display: none;" : ""
|
|
19
|
+
.btn-group.crawl_btns
|
|
20
|
+
%button.btn.btn-large.btn-danger.f_crawl_action.f_cancel{"data-action" => screenshot_cancel_path, :style => cancel_style} Cancel
|
|
21
|
+
.cmd_status_msg
|
|
22
|
+
.crawling
|
|
23
|
+
%ul.urls
|
|
24
|
+
%a.last_img
|
|
25
|
+
.no_diff_found
|
|
26
|
+
%span No differences found
|
|
27
|
+
%i.icon.icon-ok
|
|
28
|
+
.diff_found
|
|
29
|
+
%span Differences found:
|
|
30
|
+
%img
|
|
31
|
+
.url
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
= render :partial => "ui_changed/screenshots/top_buttons", :locals => {:screenshots => @screenshots, :show_buttons => !@screenshots.empty?}
|
|
2
|
+
.page-header
|
|
3
|
+
%h1= "#{@type} Screenshots"
|
|
4
|
+
-if @screenshots.length > 0
|
|
5
|
+
%input.f_remove_url{:type => "hidden", :value => "/ui_changed/screenshots/"}
|
|
6
|
+
%input.f_set_test_as_control_url{:type => "hidden", :value => "#{screenshot_set_test_as_control_path}"}
|
|
7
|
+
%table.table.table-striped.screenshots
|
|
8
|
+
-if @search
|
|
9
|
+
%span= "Showing search results for \"#{@search}\""
|
|
10
|
+
%thead
|
|
11
|
+
%tr
|
|
12
|
+
%th
|
|
13
|
+
%th= @type
|
|
14
|
+
%th URL
|
|
15
|
+
%th Date
|
|
16
|
+
%tbody
|
|
17
|
+
-@screenshots.each do |screenshot|
|
|
18
|
+
%tr
|
|
19
|
+
%input.f_id{:type => "hidden", :value => screenshot.id}
|
|
20
|
+
%td
|
|
21
|
+
%input.f_checkall_child{:type => "checkbox"}
|
|
22
|
+
%td
|
|
23
|
+
%a{:href => "#{screenshot.displayable_image_path_full}"}
|
|
24
|
+
= image_tag("#{screenshot.displayable_image_path_small_full}")
|
|
25
|
+
%td
|
|
26
|
+
%a{:href => screenshot.url}= screenshot.url
|
|
27
|
+
%td= screenshot.updated_at.strftime("%m-%d-%Y %H:%M")
|
|
28
|
+
= will_paginate @screenshots
|
|
29
|
+
-else
|
|
30
|
+
%span No screenshots
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
module UiChanged
|
|
2
|
+
class WorkerBase
|
|
3
|
+
|
|
4
|
+
class << self
|
|
5
|
+
def remove_folder_contents_or_create(path)
|
|
6
|
+
# does control/test directory exist?
|
|
7
|
+
puts 'checking if dir exists: ' + path
|
|
8
|
+
if Dir.exists?(path)
|
|
9
|
+
path_contents = path + '*'
|
|
10
|
+
puts 'removing directory contents of :' + path_contents
|
|
11
|
+
FileUtils.rm_rf(Dir.glob(path_contents))
|
|
12
|
+
else
|
|
13
|
+
# create control/test folder
|
|
14
|
+
create_folders(path)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def create_folders(path)
|
|
19
|
+
unless Dir.exists?(path)
|
|
20
|
+
puts 'creating dir path: ' + path.to_s
|
|
21
|
+
FileUtils.mkdir_p path
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
protected
|
|
27
|
+
|
|
28
|
+
def crawl_by_is_control(is_control)
|
|
29
|
+
if is_control
|
|
30
|
+
image_dir = UiChanged::ConfigHelper.control_path
|
|
31
|
+
crawl_url = UiChanged::ConfigHelper.control_url
|
|
32
|
+
else
|
|
33
|
+
image_dir = UiChanged::ConfigHelper.test_path
|
|
34
|
+
crawl_url = UiChanged::ConfigHelper.test_url
|
|
35
|
+
end
|
|
36
|
+
crawl_by_image_dir_and_is_control_and_url(image_dir, is_control, crawl_url)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def crawl_by_is_control_and_url(is_control, crawl_url)
|
|
40
|
+
if is_control
|
|
41
|
+
image_dir = UiChanged::ConfigHelper.control_path
|
|
42
|
+
else
|
|
43
|
+
image_dir = UiChanged::ConfigHelper.test_path
|
|
44
|
+
end
|
|
45
|
+
crawl_by_image_dir_and_is_control_and_url(image_dir, is_control, crawl_url)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def crawl_by_image_dir_and_is_control_and_url(image_dir, is_control, crawl_url)
|
|
49
|
+
status_msg = "removing all matching db entries & images: (is_control: " + is_control.to_s + ")"
|
|
50
|
+
tick(status_msg)
|
|
51
|
+
puts status_msg
|
|
52
|
+
is_control ? UiChanged::Screenshot.delete_all_controls : UiChanged::Screenshot.delete_all_tests
|
|
53
|
+
|
|
54
|
+
# not super ideal
|
|
55
|
+
# ideally we do this after crawling and deleting
|
|
56
|
+
# only screenshot rows where is_compare => true
|
|
57
|
+
# and where control_id or test_id is dangling (no longer exists)
|
|
58
|
+
UiChanged::Screenshot.delete_all_compares
|
|
59
|
+
|
|
60
|
+
puts "is_control: " + is_control.to_s
|
|
61
|
+
|
|
62
|
+
# does control/test directory exist?
|
|
63
|
+
# if so remove everything in it
|
|
64
|
+
# if not, create it
|
|
65
|
+
UiChanged::WorkerBase.remove_folder_contents_or_create(image_dir)
|
|
66
|
+
|
|
67
|
+
driver = Selenium::WebDriver.for :chrome
|
|
68
|
+
driver.manage.window.resize_to(1024, 768) # this doesn't work (i dont think)
|
|
69
|
+
driver.manage.timeouts.implicit_wait = 60 # seconds
|
|
70
|
+
|
|
71
|
+
urls_to_skip = Regexp.new(UiChanged::ConfigHelper.skip_url_reg_exp)
|
|
72
|
+
puts urls_to_skip.to_s
|
|
73
|
+
|
|
74
|
+
skip_query_strings = UiChanged::ConfigHelper.skip_query_strings ||= false
|
|
75
|
+
puts 'skip query strings: ' + skip_query_strings.to_s
|
|
76
|
+
|
|
77
|
+
STDOUT.flush
|
|
78
|
+
count = 0
|
|
79
|
+
Anemone.crawl(crawl_url, :skip_query_strings => skip_query_strings) do |anemone|
|
|
80
|
+
anemone.skip_links_like urls_to_skip
|
|
81
|
+
anemone.on_every_page do |page|
|
|
82
|
+
|
|
83
|
+
status_msg = "browsing to " + page.url.to_s + " --- " + count.to_s
|
|
84
|
+
tick(status_msg)
|
|
85
|
+
puts status_msg
|
|
86
|
+
|
|
87
|
+
crawl_and_save_single_url(image_dir, is_control, page.url, driver)
|
|
88
|
+
|
|
89
|
+
count += 1
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# here you need to
|
|
94
|
+
# delete all screenshots
|
|
95
|
+
# where is_compare = true AND control_id
|
|
96
|
+
|
|
97
|
+
if is_control
|
|
98
|
+
UiChanged::NotificationsMailer.new_controls_message.deliver
|
|
99
|
+
else
|
|
100
|
+
UiChanged::NotificationsMailer.new_tests_message.deliver
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
driver.quit
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def crawl_and_save_single_url(image_dir, is_control, page_url, driver)
|
|
107
|
+
if is_control
|
|
108
|
+
ss = UiChanged::Screenshot.find_or_initialize_by_url_and_is_control(page_url.to_s, true)
|
|
109
|
+
else
|
|
110
|
+
ss = UiChanged::Screenshot.find_or_initialize_by_url_and_is_test(page_url.to_s, true)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# save without validation because we need the id in the file names
|
|
114
|
+
ss.save(:validate => false)
|
|
115
|
+
|
|
116
|
+
puts 'found or created ss id: ' + ss.id.to_s
|
|
117
|
+
image_file_name = "image_" + ss.id.to_s
|
|
118
|
+
image_file_name_small = image_file_name + "_small"
|
|
119
|
+
image_path = image_dir + image_file_name + ".png"
|
|
120
|
+
image_path_small = image_dir + image_file_name_small + ".png"
|
|
121
|
+
|
|
122
|
+
driver.get page_url.to_s
|
|
123
|
+
begin
|
|
124
|
+
puts "generating ss: " + image_file_name
|
|
125
|
+
driver.save_screenshot image_path
|
|
126
|
+
rescue Selenium::WebDriver::Error::UnknownError
|
|
127
|
+
#sometimes the page body is null???
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# create the icon version of the image
|
|
131
|
+
puts "generating small ss: " + image_file_name_small
|
|
132
|
+
`convert #{image_path} -resize 30x30 #{image_path_small}`
|
|
133
|
+
|
|
134
|
+
ss.update_attributes(:image_file_name => image_file_name,
|
|
135
|
+
:image_content_type => "png",
|
|
136
|
+
:image_file_size => File.size(image_path))
|
|
137
|
+
ss.save
|
|
138
|
+
|
|
139
|
+
STDOUT.flush
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def start_comparing
|
|
143
|
+
tick("starting compare")
|
|
144
|
+
compare_image_dir = UiChanged::ConfigHelper.compare_path
|
|
145
|
+
|
|
146
|
+
if !Dir.exists?(UiChanged::ConfigHelper.control_path) || !Dir.exists?(UiChanged::ConfigHelper.test_path)
|
|
147
|
+
# can't do any comparison! later.
|
|
148
|
+
return
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
puts 'removing all diff database entries...'
|
|
152
|
+
UiChanged::Screenshot.delete_all(["is_compare = ?", true])
|
|
153
|
+
|
|
154
|
+
# does compare directory exist?
|
|
155
|
+
# if so remove everything in it
|
|
156
|
+
# if not, create it
|
|
157
|
+
UiChanged::WorkerBase.remove_folder_contents_or_create(compare_image_dir)
|
|
158
|
+
|
|
159
|
+
control_images = UiChanged::Screenshot.where(:is_control => true)
|
|
160
|
+
control_images.each do |control_image|
|
|
161
|
+
puts "comparing screenshots of url: " + control_image.url.to_s
|
|
162
|
+
test_image = UiChanged::Screenshot.find_by_url_and_is_test(control_image.url, true)
|
|
163
|
+
control_image_path = control_image.image_path_full
|
|
164
|
+
test_image_path = test_image.image_path_full
|
|
165
|
+
|
|
166
|
+
diff_image_file_name = "image_" + control_image.id.to_s + "_" + test_image.id.to_s
|
|
167
|
+
diff_image_path = compare_image_dir + diff_image_file_name + ".png"
|
|
168
|
+
diff_image_path_small = compare_image_dir + diff_image_file_name + "_small.png"
|
|
169
|
+
diff_found = compare(control_image_path, test_image_path, diff_image_path, diff_image_path_small)
|
|
170
|
+
|
|
171
|
+
ss = UiChanged::Screenshot.find_or_initialize_by_control_id_and_test_id(control_image.id, test_image.id)
|
|
172
|
+
ss.update_attributes(:image_file_name => diff_image_file_name,
|
|
173
|
+
:image_content_type => "png",
|
|
174
|
+
:url => control_image.url,
|
|
175
|
+
:is_control => false,
|
|
176
|
+
:is_test => false,
|
|
177
|
+
:is_compare => true,
|
|
178
|
+
:diff_found => diff_found,
|
|
179
|
+
:image_file_size => File.size(diff_image_path))
|
|
180
|
+
ss.save
|
|
181
|
+
status_msg = "generating compare ss: " + diff_image_file_name
|
|
182
|
+
tick(status_msg)
|
|
183
|
+
puts status_msg
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
UiChanged::NotificationsMailer.new_compares_message.deliver
|
|
187
|
+
UiChanged::NotificationsMailer.new_diffs_message.deliver
|
|
188
|
+
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
private
|
|
192
|
+
|
|
193
|
+
def compare(control_img, test_img, diff_img, diff_img_small)
|
|
194
|
+
args = "-compose Src -highlight-color #FF0000 #{control_img} #{test_img} #{diff_img}"
|
|
195
|
+
puts args
|
|
196
|
+
`compare #{args}`
|
|
197
|
+
|
|
198
|
+
# create the icon version of the diff image
|
|
199
|
+
puts "generating small ss: " + diff_img_small
|
|
200
|
+
`convert #{diff_img} -resize 30x30 #{diff_img_small}`
|
|
201
|
+
|
|
202
|
+
diff_found = `convert #{diff_img} -format %c -depth 8 histogram:info:-`
|
|
203
|
+
return diff_found.include? "#FF0000"
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MTC_CONFIG = YAML.load_file(Rails.root.join('config', 'ui_changed.yml'))[Rails.env]
|
data/config/routes.rb
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
UiChanged::Engine.routes.draw do
|
|
2
|
+
|
|
3
|
+
root :to => "screenshots#index"
|
|
4
|
+
|
|
5
|
+
match '/screenshots/crawl_status' => 'screenshots#crawl_status', :as => :screenshot_crawl_status
|
|
6
|
+
|
|
7
|
+
match '/screenshots/diffs' => 'screenshots#diffs', :as => :screenshot_diffs
|
|
8
|
+
match '/screenshots/compares' => 'screenshots#compares', :as => :screenshot_compares
|
|
9
|
+
match '/screenshots/controls' => 'screenshots#controls', :as => :screenshot_controls
|
|
10
|
+
match '/screenshots/tests' => 'screenshots#tests', :as => :screenshot_tests
|
|
11
|
+
match '/screenshots/diff' => 'screenshots#diff', :as => :screenshot_diff
|
|
12
|
+
|
|
13
|
+
match '/screenshots/remove_diff_and_test' => 'screenshots#remove_diff_and_test', :as => :remove_diff_and_test, :via => :delete
|
|
14
|
+
match '/screenshots/remove_all_diffs_and_tests' => 'screenshots#remove_all_diffs_and_tests', :as => :remove_all_diffs_and_tests, :via => :delete
|
|
15
|
+
match '/screenshots/set_test_as_control' => 'screenshots#set_test_as_control', :as => :screenshot_set_test_as_control, :via => :post
|
|
16
|
+
match '/screenshots/set_all_tests_as_control' => 'screenshots#set_all_tests_as_control', :as => :screenshot_set_all_tests_as_control, :via => :post
|
|
17
|
+
match '/screenshots/destroy_all_controls' => 'screenshots#destroy_all_controls', :as => :screenshot_destroy_all_controls, :via => :delete
|
|
18
|
+
match '/screenshots/destroy_all_tests' => 'screenshots#destroy_all_tests', :as => :screenshot_destroy_all_tests, :via => :delete
|
|
19
|
+
match '/screenshots/destroy_all_compares' => 'screenshots#destroy_all_compares', :as => :screenshot_destroy_all_compares, :via => :delete
|
|
20
|
+
|
|
21
|
+
match '/screenshots/start_all' => 'screenshots#start_all', :as => :screenshot_start_all, :via => :post
|
|
22
|
+
match '/screenshots/start_control' => 'screenshots#start_control', :as => :screenshot_start_control, :via => :post
|
|
23
|
+
match '/screenshots/start_test' => 'screenshots#start_test', :as => :screenshot_start_test, :via => :post
|
|
24
|
+
match '/screenshots/start_control_test' => 'screenshots#start_control_test', :as => :screenshot_start_control_test, :via => :post
|
|
25
|
+
match '/screenshots/start_control_compare' => 'screenshots#start_control_compare', :as => :screenshot_start_control_compare, :via => :post
|
|
26
|
+
match '/screenshots/start_test_compare' => 'screenshots#start_test_compare', :as => :screenshot_start_test_compare, :via => :post
|
|
27
|
+
match '/screenshots/start_compare' => 'screenshots#start_compare', :as => :screenshot_start_compare, :via => :post
|
|
28
|
+
match '/screenshots/cancel' => 'screenshots#cancel', :as => :screenshot_cancel, :via => :post
|
|
29
|
+
|
|
30
|
+
match '/screenshot_ignore_urls/add' => 'screenshot_ignore_urls#add', :via => :post
|
|
31
|
+
match '/screenshot_ignore_urls/add_all_controls' => 'screenshot_ignore_urls#add_all_controls', :as => :screenshot_ignore_url_add_all_controls, :via => :post
|
|
32
|
+
match '/screenshot_ignore_urls/add_all_tests' => 'screenshot_ignore_urls#add_all_tests', :as => :screenshot_ignore_url_add_all_tests, :via => :post
|
|
33
|
+
match '/screenshot_ignore_urls/add_all_compares' => 'screenshot_ignore_urls#add_all_compares', :as => :screenshot_ignore_url_add_all_compares, :via => :post
|
|
34
|
+
match '/screenshot_ignore_urls/add_all_diffs' => 'screenshot_ignore_urls#add_all_diffs', :as => :screenshot_ignore_url_add_all_diffs, :via => :post
|
|
35
|
+
match '/screenshot_ignore_urls/destroy_all' => 'screenshot_ignore_urls#destroy_all', :as => :screenshot_ignore_url_destroy_all, :via => :delete
|
|
36
|
+
|
|
37
|
+
resources :screenshot_ignore_urls, :only => [:index, :destroy]
|
|
38
|
+
resources :screenshots, :only => [:index, :destroy]
|
|
39
|
+
|
|
40
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class CreateUiChangedScreenshots < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :ui_changed_screenshots do |t|
|
|
4
|
+
t.text :url
|
|
5
|
+
t.boolean :is_control
|
|
6
|
+
t.boolean :is_test
|
|
7
|
+
t.boolean :is_compare
|
|
8
|
+
t.boolean :diff_found
|
|
9
|
+
t.integer :control_id
|
|
10
|
+
t.integer :test_id
|
|
11
|
+
t.string :image_file_name
|
|
12
|
+
t.string :image_content_type
|
|
13
|
+
t.integer :image_file_size
|
|
14
|
+
|
|
15
|
+
t.timestamps
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# desc "Explaining what the task does"
|
|
2
|
+
# task :ui_changed do
|
|
3
|
+
# # Task goes here
|
|
4
|
+
# end
|
|
5
|
+
require 'ui_changed'
|
|
6
|
+
require 'resque/tasks'
|
|
7
|
+
|
|
8
|
+
# this doesn't seem to like being inside the ui_changed namespace
|
|
9
|
+
task "resque:setup" => :environment
|
|
10
|
+
|
|
11
|
+
namespace :ui_changed do
|
|
12
|
+
|
|
13
|
+
# rake ss:crawl_for_control
|
|
14
|
+
task :crawl_for_control => :environment do
|
|
15
|
+
UiChanged::Screenshot.start_async_crawl_for_control
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# rake ss:crawl_for_test
|
|
19
|
+
task :crawl_for_test => :environment do
|
|
20
|
+
UiChanged::Screenshot.start_async_crawl_for_test
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# rake ss:crawl_for_control_and_test
|
|
24
|
+
task :crawl_for_control_and_test => :environment do
|
|
25
|
+
UiChanged::Screenshot.crawl_for_control_and_test
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# rake ss:crawl_for_control_and_compare
|
|
29
|
+
task :crawl_for_control_and_compare => :environment do
|
|
30
|
+
UiChanged::Screenshot.start_async_crawl_for_control_and_compare
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# rake ss:crawl_for_test_and_compare
|
|
34
|
+
task :crawl_for_test_and_compare => :environment do
|
|
35
|
+
UiChanged::Screenshot.start_async_crawl_for_test_and_compare
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# rake ss:compare
|
|
39
|
+
task :compare => :environment do
|
|
40
|
+
UiChanged::Screenshot.start_async_compare
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require "rails"
|
|
2
|
+
require "bootstrap-sass"
|
|
3
|
+
require 'will_paginate'
|
|
4
|
+
require 'bootstrap-will_paginate'
|
|
5
|
+
require "haml-rails"
|
|
6
|
+
require 'anemone'
|
|
7
|
+
require 'selenium-webdriver'
|
|
8
|
+
require "jquery-rails"
|
|
9
|
+
require 'font-awesome-sass-rails'
|
|
10
|
+
require 'resque'
|
|
11
|
+
require 'resque_mailer'
|
|
12
|
+
require 'resque-status'
|
|
13
|
+
|
|
14
|
+
module UiChanged
|
|
15
|
+
class Engine < ::Rails::Engine
|
|
16
|
+
isolate_namespace UiChanged
|
|
17
|
+
end
|
|
18
|
+
end
|