watchdoge 0.1.4 → 0.1.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3e163dcbfe0adf1bdd0cad7294c47475d7007792820a79a80d150cc86d58227
4
- data.tar.gz: 8c03e0dff98141f87e822ac561a47b3267754e258425424d968aa5aef05c2c87
3
+ metadata.gz: 6bbea0942ea0ec77d65de759549b4fe4424fad15ed93b90334c4ce55bb82a19b
4
+ data.tar.gz: bf7a691395dfb78b147d3fc0cd26c1f182268c484f240c4ad641e6b44058a07f
5
5
  SHA512:
6
- metadata.gz: 1f6f3564b357805882226d960aa97b69ab4f11d3a1d8f82d5a176995f5b15d9e42fbfadf9c38c9fed09b43cf2c33dda79abe7c316b277e599c0ae4def9d853e6
7
- data.tar.gz: 8a7af25b9f84fe6475471dd5bd98207f51d3253f2197b37749126712125e052ed1732081eb479d582d3bb07e9cd98fe35006924d8beab30c73dacc8fa42cff5b
6
+ metadata.gz: b57a2f32f4b698d0166e9ec65603cfe3dc28e5c0b4c121392d9259bf8a7d73273a8f0098274a26b81dbed7422d1fd5c6cadd466c0ed13c575804c13870f7c337
7
+ data.tar.gz: 389b07819187d124daf610d66bcc1aae3db33f00bad613b19921b69d6f93f867a95aeaec45ac9f83640868c3517856f8b5072f426779c5eaeaa792a8595c0ddf
@@ -1,12 +1,17 @@
1
- # All configurable variables
1
+ # All Configurable and Hooks
2
+
3
+ # usage:
4
+ # WatchDoge.configure {|config| #custom configuration }
2
5
 
3
6
  # spec:
4
- #
7
+ # 1. able to load configuration file while WatchDoge.initilize! called
8
+ # 2. able to setting multiple callbacks on one hook
5
9
 
6
10
  require 'watir'
7
11
 
8
12
  module WatchDoge
9
13
  class Configuration
14
+ # hook is array of Proc instances
10
15
  class Hooks
11
16
  attr_accessor :before_regression
12
17
  attr_accessor :after_regression
@@ -24,6 +29,7 @@ module WatchDoge
24
29
  attr_accessor :base_dir
25
30
 
26
31
  attr_accessor :web_drivers_dir
32
+
27
33
  attr_accessor :engine
28
34
  attr_accessor :browser
29
35
  attr_accessor :cookie_pool
@@ -42,6 +48,7 @@ module WatchDoge
42
48
  attr_accessor :firefox_version
43
49
 
44
50
  def initialize
51
+ # base_dir is where WatchDoge stuff operating include installation or configuration
45
52
  @base_dir =
46
53
  if defined? Rails
47
54
  Rails.root.to_s
@@ -49,32 +56,41 @@ module WatchDoge
49
56
  Dir.pwd
50
57
  end
51
58
 
59
+ # webdrivers binaries installation directory
52
60
  @web_drivers_dir = @base_dir + "/.webdrivers"
61
+
62
+
63
+ # framwork that Worker used, default to selenium
53
64
  @engine = Watir::Browser
65
+
66
+ # default browser used by engine
54
67
  @browser = :firefox
55
68
 
69
+ # where all cookie saved (as yaml)
56
70
  @cookie_pool = @base_dir + '/.doge_cookie'
57
71
 
72
+ # connection timeout threshold(seconds)
58
73
  @http_timeout = 120
59
74
 
75
+ # map of notification sources
76
+ # key: must be stringify of its class name
77
+ # value: hash struct, will passed to constructor while push message
60
78
  @notifications = {
61
- # slack: {
79
+ # 'SlackWebhook': {
62
80
  # incoming_url: SLACK_WEBHOOK
63
81
  # }
64
- # matter_most: {
82
+
83
+ # 'MatterMost': {
65
84
  # host: HOST,
66
85
  # channel_id: CHANNEL_ID,
67
86
  # auth_token: AUTH_TOKEN
68
87
  # }
69
- # matter_most: {
70
- # host: 'HOST',
71
- # channel_id: 'CHANNEL_ID',
72
- # auth_token: 'AUTH_TOKEN'
73
- # }
74
88
  }
75
89
 
90
+ # host for relative URL in regression test.
76
91
  @host = ''
77
92
 
93
+ # regression directory contains reference images and scenario scripts
78
94
  @regression_dir =
79
95
  if defined?(Rails)
80
96
  @base_dir + "/test/watchdoge"
@@ -83,9 +99,14 @@ module WatchDoge
83
99
  end
84
100
 
85
101
  @hooks = WatchDoge::Configuration::Hooks.new
102
+
103
+ # Proc for #sign_in_as(resource) in regression scenario
104
+ # worker: WatchDoge instance that executing scnario
105
+ # resource: passed whatever you want
86
106
  @sign_in_proc = -> (worker, resource) {}
87
107
  @sign_out_proc = -> (worker, resource) {}
88
108
 
109
+ # specific webdriver version, default to latest if nil
89
110
  @chrome_version = nil
90
111
  @firefox_version = nil
91
112
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  # spec:
7
7
  # 1. input only accept ChunkyPNG::Image, output image is also ChunkyPNG::Image
8
- # 2. Testing RGBA pixel by pixel. blending mask color if diff detected
8
+ # 2. able to testing RGBA pixel by pixel. then blending with mask color if diff detected
9
9
 
10
10
  # todo: should improve testing boundary for more accurate diff imagenot.
11
11
 
@@ -5,8 +5,8 @@
5
5
  # WatchDoge::Regression.run_all_scenarios(:regression)
6
6
 
7
7
  # spec:
8
- # 1. rake tasks `rake watchdoge:make_reference` and `rake watchdoge:regression` while in Rails
9
- # 2. generate scenario template by Rails generator
8
+ # 1. should have rake tasks `rake watchdoge:make_reference` and `rake watchdoge:regression` while in Rails
9
+ # 2. able to generate scenario template by Rails generator
10
10
 
11
11
  # todo: support run single scenario
12
12
 
@@ -1,4 +1,4 @@
1
1
  # Version of WatchDoge
2
2
  module WatchDoge
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.5'
4
4
  end
@@ -6,9 +6,9 @@
6
6
  # screenshot = worker.fullpage_screenshot
7
7
 
8
8
  # spec:
9
- # 1. Worker instance having customized configuration Selenium as its engine
10
- # 2. Worker engine default to headless mode
11
- # 3. Worker passing all missing method to its engine
9
+ # 1. should having customized configuration Selenium as its engine
10
+ # 2. engine should default to headless mode
11
+ # 3. able to passing all missing method to its engine
12
12
 
13
13
  # todo:
14
14
  # 1. improve or remove cookie related functions, is it necessary for frontend regression?
data/lib/watchdoge.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'pry'
2
1
  require 'watchdoge/webdriver_manager'
3
2
  require 'watchdoge/version'
4
3
  require 'watchdoge/configuration'
data/watchdoge.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'watchdoge'
3
- s.version = '0.1.4'
3
+ s.version = '0.1.5'
4
4
  s.date = '2019-07-22'
5
5
  s.summary = "dogi"
6
- s.description = "A collection of web test tools"
6
+ s.description = "WatchDoge is Ruby on Rails friendly frontend regression test tool"
7
7
  s.authors = ["Shen Lee"]
8
8
  s.email = 'no-reply@gmail.com'
9
9
  s.files = ["lib/watchdoge.rb"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchdoge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shen Lee
@@ -104,7 +104,7 @@ dependencies:
104
104
  - - "~>"
105
105
  - !ruby/object:Gem::Version
106
106
  version: '2.1'
107
- description: A collection of web test tools
107
+ description: WatchDoge is Ruby on Rails friendly frontend regression test tool
108
108
  email: no-reply@gmail.com
109
109
  executables: []
110
110
  extensions: []