ule_page 0.0.1 → 0.2.0

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
- SHA1:
3
- metadata.gz: 857824e4a022e82a0cf4d7d4d616dea01ad72a23
4
- data.tar.gz: 5b021aef48ef36da55f4e4d4c09dc7675a068908
2
+ SHA256:
3
+ metadata.gz: 98f5e46718aa9e16727ff68419740fece7b75bdcd59c61dc643426676dc4bb28
4
+ data.tar.gz: cacd0c752462cbe6fee4ec0b91985df6a21c1ffc18efb053cb9f5eef0449942f
5
5
  SHA512:
6
- metadata.gz: 41cab64b513ea09135059366027d87e6abecbc49713b0158613be2ebba0726a36980f81be1a3e2e3aa730041fdb2c7b308cadfe5843c65e681031d3e4af452a3
7
- data.tar.gz: bf345061ef09628c9e86f8479c21a3933500cdf98d4a523689ac0e438f1d5e31bcac0de00b9a16037ba86355aae95563a578e6bf6054c100c9b16a8403950542
6
+ metadata.gz: 2de80281e8d32e208a10a0365f330fcc69353bf0710ab00b634f7dd4d5f423e232cd01d65836e2f6d0e4f249ad02735e545dd9ff84cd07e6250ecea4a92d753f
7
+ data.tar.gz: c215be5ca5856ac7ba89418a7a7e2aa7e07b33d4fe797ce1a801d94ef76ad33288e0ed29210c92ce034b74631c22c6cf45b66a23ab46999a2868444dee20237f
@@ -0,0 +1 @@
1
+ repo_token: iYdE1JsFQ5UjoOfl4kLDjSffQUH7X93XP
@@ -1,4 +1,16 @@
1
1
  language: ruby
2
+ sudo: false
3
+
2
4
  rvm:
3
5
  - 2.3.0
6
+ - 2.2.4
7
+ - 2.1.5
8
+
9
+ script: bundle exec rspec spec
10
+
11
+ notifications:
12
+ email:
13
+ - tsuijy@gmail.com
14
+ - jere@ul-e.com
15
+
4
16
  before_install: gem install bundler -v 1.11.2
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
- # source 'https://rubygems.org'
2
- source 'https://ruby.taobao.org'
1
+ source 'https://rubygems.org'
2
+
3
+ gem "coveralls", :require => false
4
+ #source 'https://ruby.taobao.org'
3
5
 
4
6
  # Specify your gem's dependencies in ule_page.gemspec
5
7
  gemspec
@@ -1,173 +1,237 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ule_page (0.0.1)
5
- activerecord
6
- activesupport
7
- capybara
8
- capybara-webkit
4
+ ule_page (0.2.0)
5
+ activerecord (> 4.0)
6
+ activesupport (> 4.0)
7
+ capybara (>= 2.1, < 3.0)
9
8
  rspec (~> 3.0)
10
- site_prism
9
+ site_prism (> 2.1)
11
10
 
12
11
  GEM
13
- remote: https://ruby.taobao.org/
12
+ remote: https://rubygems.org/
14
13
  specs:
15
- actionmailer (4.2.5.1)
16
- actionpack (= 4.2.5.1)
17
- actionview (= 4.2.5.1)
18
- activejob (= 4.2.5.1)
14
+ actioncable (6.1.0)
15
+ actionpack (= 6.1.0)
16
+ activesupport (= 6.1.0)
17
+ nio4r (~> 2.0)
18
+ websocket-driver (>= 0.6.1)
19
+ actionmailbox (6.1.0)
20
+ actionpack (= 6.1.0)
21
+ activejob (= 6.1.0)
22
+ activerecord (= 6.1.0)
23
+ activestorage (= 6.1.0)
24
+ activesupport (= 6.1.0)
25
+ mail (>= 2.7.1)
26
+ actionmailer (6.1.0)
27
+ actionpack (= 6.1.0)
28
+ actionview (= 6.1.0)
29
+ activejob (= 6.1.0)
30
+ activesupport (= 6.1.0)
19
31
  mail (~> 2.5, >= 2.5.4)
20
- rails-dom-testing (~> 1.0, >= 1.0.5)
21
- actionpack (4.2.5.1)
22
- actionview (= 4.2.5.1)
23
- activesupport (= 4.2.5.1)
24
- rack (~> 1.6)
25
- rack-test (~> 0.6.2)
26
- rails-dom-testing (~> 1.0, >= 1.0.5)
27
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
- actionview (4.2.5.1)
29
- activesupport (= 4.2.5.1)
30
- builder (~> 3.1)
31
- erubis (~> 2.7.0)
32
- rails-dom-testing (~> 1.0, >= 1.0.5)
33
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
34
- activejob (4.2.5.1)
35
- activesupport (= 4.2.5.1)
36
- globalid (>= 0.3.0)
37
- activemodel (4.2.5.1)
38
- activesupport (= 4.2.5.1)
32
+ rails-dom-testing (~> 2.0)
33
+ actionpack (6.1.0)
34
+ actionview (= 6.1.0)
35
+ activesupport (= 6.1.0)
36
+ rack (~> 2.0, >= 2.0.9)
37
+ rack-test (>= 0.6.3)
38
+ rails-dom-testing (~> 2.0)
39
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
40
+ actiontext (6.1.0)
41
+ actionpack (= 6.1.0)
42
+ activerecord (= 6.1.0)
43
+ activestorage (= 6.1.0)
44
+ activesupport (= 6.1.0)
45
+ nokogiri (>= 1.8.5)
46
+ actionview (6.1.0)
47
+ activesupport (= 6.1.0)
39
48
  builder (~> 3.1)
40
- activerecord (4.2.5.1)
41
- activemodel (= 4.2.5.1)
42
- activesupport (= 4.2.5.1)
43
- arel (~> 6.0)
44
- activesupport (4.2.5.1)
45
- i18n (~> 0.7)
46
- json (~> 1.7, >= 1.7.7)
47
- minitest (~> 5.1)
48
- thread_safe (~> 0.3, >= 0.3.4)
49
- tzinfo (~> 1.1)
50
- addressable (2.4.0)
51
- arel (6.0.3)
52
- builder (3.2.2)
53
- capybara (2.5.0)
54
- mime-types (>= 1.16)
49
+ erubi (~> 1.4)
50
+ rails-dom-testing (~> 2.0)
51
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
52
+ activejob (6.1.0)
53
+ activesupport (= 6.1.0)
54
+ globalid (>= 0.3.6)
55
+ activemodel (6.1.0)
56
+ activesupport (= 6.1.0)
57
+ activerecord (6.1.0)
58
+ activemodel (= 6.1.0)
59
+ activesupport (= 6.1.0)
60
+ activestorage (6.1.0)
61
+ actionpack (= 6.1.0)
62
+ activejob (= 6.1.0)
63
+ activerecord (= 6.1.0)
64
+ activesupport (= 6.1.0)
65
+ marcel (~> 0.3.1)
66
+ mimemagic (~> 0.3.2)
67
+ activesupport (6.1.0)
68
+ concurrent-ruby (~> 1.0, >= 1.0.2)
69
+ i18n (>= 1.6, < 2)
70
+ minitest (>= 5.1)
71
+ tzinfo (~> 2.0)
72
+ zeitwerk (~> 2.3)
73
+ addressable (2.7.0)
74
+ public_suffix (>= 2.0.2, < 5.0)
75
+ builder (3.2.4)
76
+ capybara (2.18.0)
77
+ addressable
78
+ mini_mime (>= 0.1.3)
55
79
  nokogiri (>= 1.3.3)
56
80
  rack (>= 1.0.0)
57
81
  rack-test (>= 0.5.4)
58
- xpath (~> 2.0)
59
- capybara-webkit (1.7.1)
60
- capybara (>= 2.3.0, < 2.6.0)
61
- json
62
- concurrent-ruby (1.0.0)
82
+ xpath (>= 2.0, < 4.0)
83
+ concurrent-ruby (1.1.7)
84
+ coveralls (0.7.1)
85
+ multi_json (~> 1.3)
86
+ rest-client
87
+ simplecov (>= 0.7)
88
+ term-ansicolor
89
+ thor
90
+ crass (1.0.6)
63
91
  cucumber (1.3.20)
64
92
  builder (>= 2.1.2)
65
93
  diff-lcs (>= 1.1.3)
66
94
  gherkin (~> 2.12)
67
95
  multi_json (>= 1.7.5, < 2.0)
68
96
  multi_test (>= 0.1.2)
69
- diff-lcs (1.2.5)
70
- docile (1.1.5)
71
- erubis (2.7.0)
97
+ diff-lcs (1.4.4)
98
+ docile (1.3.4)
99
+ domain_name (0.5.20190701)
100
+ unf (>= 0.0.5, < 1.0.0)
101
+ erubi (1.10.0)
72
102
  gherkin (2.12.2)
73
103
  multi_json (~> 1.3)
74
- globalid (0.3.6)
75
- activesupport (>= 4.1.0)
76
- i18n (0.7.0)
77
- json (1.8.3)
78
- loofah (2.0.3)
104
+ globalid (0.4.2)
105
+ activesupport (>= 4.2.0)
106
+ http-accept (1.7.0)
107
+ http-cookie (1.0.3)
108
+ domain_name (~> 0.5)
109
+ i18n (1.8.5)
110
+ concurrent-ruby (~> 1.0)
111
+ loofah (2.8.0)
112
+ crass (~> 1.0.2)
79
113
  nokogiri (>= 1.5.9)
80
- mail (2.6.3)
81
- mime-types (>= 1.16, < 3)
82
- mime-types (2.4.3)
83
- mini_portile2 (2.0.0)
84
- minitest (5.8.4)
85
- multi_json (1.11.2)
114
+ mail (2.7.1)
115
+ mini_mime (>= 0.1.1)
116
+ marcel (0.3.3)
117
+ mimemagic (~> 0.3.2)
118
+ method_source (1.0.0)
119
+ mime-types (3.3.1)
120
+ mime-types-data (~> 3.2015)
121
+ mime-types-data (3.2020.1104)
122
+ mimemagic (0.3.5)
123
+ mini_mime (1.0.2)
124
+ mini_portile2 (2.4.0)
125
+ minitest (5.14.2)
126
+ multi_json (1.15.0)
86
127
  multi_test (0.1.2)
87
- nokogiri (1.6.7.2)
88
- mini_portile2 (~> 2.0.0.rc2)
89
- rack (1.6.4)
90
- rack-test (0.6.3)
91
- rack (>= 1.0)
92
- rails (4.2.5.1)
93
- actionmailer (= 4.2.5.1)
94
- actionpack (= 4.2.5.1)
95
- actionview (= 4.2.5.1)
96
- activejob (= 4.2.5.1)
97
- activemodel (= 4.2.5.1)
98
- activerecord (= 4.2.5.1)
99
- activesupport (= 4.2.5.1)
100
- bundler (>= 1.3.0, < 2.0)
101
- railties (= 4.2.5.1)
102
- sprockets-rails
103
- rails-deprecated_sanitizer (1.0.3)
104
- activesupport (>= 4.2.0.alpha)
105
- rails-dom-testing (1.0.7)
106
- activesupport (>= 4.2.0.beta, < 5.0)
107
- nokogiri (~> 1.6.0)
108
- rails-deprecated_sanitizer (>= 1.0.1)
109
- rails-html-sanitizer (1.0.3)
110
- loofah (~> 2.0)
111
- railties (4.2.5.1)
112
- actionpack (= 4.2.5.1)
113
- activesupport (= 4.2.5.1)
128
+ netrc (0.11.0)
129
+ nio4r (2.5.4)
130
+ nokogiri (1.10.10)
131
+ mini_portile2 (~> 2.4.0)
132
+ public_suffix (4.0.6)
133
+ rack (2.2.3)
134
+ rack-test (1.1.0)
135
+ rack (>= 1.0, < 3)
136
+ rails (6.1.0)
137
+ actioncable (= 6.1.0)
138
+ actionmailbox (= 6.1.0)
139
+ actionmailer (= 6.1.0)
140
+ actionpack (= 6.1.0)
141
+ actiontext (= 6.1.0)
142
+ actionview (= 6.1.0)
143
+ activejob (= 6.1.0)
144
+ activemodel (= 6.1.0)
145
+ activerecord (= 6.1.0)
146
+ activestorage (= 6.1.0)
147
+ activesupport (= 6.1.0)
148
+ bundler (>= 1.15.0)
149
+ railties (= 6.1.0)
150
+ sprockets-rails (>= 2.0.0)
151
+ rails-dom-testing (2.0.3)
152
+ activesupport (>= 4.2.0)
153
+ nokogiri (>= 1.6)
154
+ rails-html-sanitizer (1.3.0)
155
+ loofah (~> 2.3)
156
+ railties (6.1.0)
157
+ actionpack (= 6.1.0)
158
+ activesupport (= 6.1.0)
159
+ method_source
114
160
  rake (>= 0.8.7)
115
- thor (>= 0.18.1, < 2.0)
161
+ thor (~> 1.0)
116
162
  rake (10.5.0)
117
- rspec (3.4.0)
118
- rspec-core (~> 3.4.0)
119
- rspec-expectations (~> 3.4.0)
120
- rspec-mocks (~> 3.4.0)
121
- rspec-core (3.4.2)
122
- rspec-support (~> 3.4.0)
123
- rspec-expectations (3.4.0)
163
+ rest-client (2.1.0)
164
+ http-accept (>= 1.7.0, < 2.0)
165
+ http-cookie (>= 1.0.2, < 2.0)
166
+ mime-types (>= 1.16, < 4.0)
167
+ netrc (~> 0.8)
168
+ rspec (3.10.0)
169
+ rspec-core (~> 3.10.0)
170
+ rspec-expectations (~> 3.10.0)
171
+ rspec-mocks (~> 3.10.0)
172
+ rspec-core (3.10.1)
173
+ rspec-support (~> 3.10.0)
174
+ rspec-expectations (3.10.1)
124
175
  diff-lcs (>= 1.2.0, < 2.0)
125
- rspec-support (~> 3.4.0)
126
- rspec-its (1.2.0)
176
+ rspec-support (~> 3.10.0)
177
+ rspec-its (1.3.0)
127
178
  rspec-core (>= 3.0.0)
128
179
  rspec-expectations (>= 3.0.0)
129
- rspec-mocks (3.4.1)
180
+ rspec-mocks (3.10.1)
130
181
  diff-lcs (>= 1.2.0, < 2.0)
131
- rspec-support (~> 3.4.0)
132
- rspec-rails (3.4.0)
133
- actionpack (>= 3.0, < 4.3)
134
- activesupport (>= 3.0, < 4.3)
135
- railties (>= 3.0, < 4.3)
136
- rspec-core (~> 3.4.0)
137
- rspec-expectations (~> 3.4.0)
138
- rspec-mocks (~> 3.4.0)
139
- rspec-support (~> 3.4.0)
140
- rspec-support (3.4.1)
141
- simplecov (0.11.2)
142
- docile (~> 1.1.0)
143
- json (~> 1.8)
144
- simplecov-html (~> 0.10.0)
145
- simplecov-html (0.10.0)
146
- site_prism (2.8)
147
- addressable (>= 2.3.3, < 3.0)
148
- capybara (>= 2.1, < 3.0)
149
- sprockets (3.5.2)
182
+ rspec-support (~> 3.10.0)
183
+ rspec-rails (4.0.2)
184
+ actionpack (>= 4.2)
185
+ activesupport (>= 4.2)
186
+ railties (>= 4.2)
187
+ rspec-core (~> 3.10)
188
+ rspec-expectations (~> 3.10)
189
+ rspec-mocks (~> 3.10)
190
+ rspec-support (~> 3.10)
191
+ rspec-support (3.10.1)
192
+ simplecov (0.20.0)
193
+ docile (~> 1.1)
194
+ simplecov-html (~> 0.11)
195
+ simplecov_json_formatter (~> 0.1)
196
+ simplecov-html (0.12.3)
197
+ simplecov_json_formatter (0.1.2)
198
+ site_prism (3.5)
199
+ addressable (~> 2.5)
200
+ capybara (<= 3.29)
201
+ site_prism-all_there (>= 0.3.1, < 1.0)
202
+ site_prism-all_there (0.3.2)
203
+ sprockets (4.0.2)
150
204
  concurrent-ruby (~> 1.0)
151
205
  rack (> 1, < 3)
152
- sprockets-rails (3.0.1)
206
+ sprockets-rails (3.2.2)
153
207
  actionpack (>= 4.0)
154
208
  activesupport (>= 4.0)
155
209
  sprockets (>= 3.0.0)
156
- thor (0.19.1)
157
- thread_safe (0.3.5)
158
- tzinfo (1.2.2)
159
- thread_safe (~> 0.1)
160
- xpath (2.0.0)
161
- nokogiri (~> 1.3)
162
- yard (0.8.7.6)
210
+ sync (0.5.0)
211
+ term-ansicolor (1.7.1)
212
+ tins (~> 1.0)
213
+ thor (1.0.1)
214
+ tins (1.26.0)
215
+ sync
216
+ tzinfo (2.0.4)
217
+ concurrent-ruby (~> 1.0)
218
+ unf (0.1.4)
219
+ unf_ext
220
+ unf_ext (0.0.7.7)
221
+ websocket-driver (0.7.3)
222
+ websocket-extensions (>= 0.1.0)
223
+ websocket-extensions (0.1.5)
224
+ xpath (3.2.0)
225
+ nokogiri (~> 1.8)
226
+ yard (0.9.26)
227
+ zeitwerk (2.4.2)
163
228
 
164
229
  PLATFORMS
165
230
  ruby
166
231
 
167
232
  DEPENDENCIES
168
- activerecord (>= 3.0.0)
169
- activesupport
170
233
  bundler (~> 1.11)
234
+ coveralls
171
235
  cucumber (~> 1.3.15)
172
236
  rails
173
237
  rake (~> 10.0)
@@ -178,4 +242,4 @@ DEPENDENCIES
178
242
  yard
179
243
 
180
244
  BUNDLED WITH
181
- 1.11.2
245
+ 1.16.4
data/README.md CHANGED
@@ -1,8 +1,13 @@
1
1
  # UlePage
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ule_page`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Gem Version](https://badge.fury.io/rb/ule_page.svg)](https://badge.fury.io/rb/ule_page)
4
+ [![Build Status](https://travis-ci.org/jerecui/ule_page.svg?branch=master)](https://travis-ci.org/jerecui/ule_page)
5
+ [![Coverage Status](https://coveralls.io/repos/jerecui/ule_page/badge.svg?branch=master)](https://coveralls.io/r/jerecui/ule_page?branch=master)
6
+ [![License](https://img.shields.io/github/license/RubyMoney/money.svg)](http://opensource.org/licenses/MIT)
4
7
 
5
- Using UlePage, you can define page model object easily. e.g.
8
+ Welcome to UlePage gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ule_page`. To experiment with that code, run `bin/console` for an interactive prompt.
9
+
10
+ Using UlePage, you can define page model object easily and the gem can match the current url to the specific page model with 'pg' method. e.g.
6
11
  ```ruby
7
12
  module Page
8
13
  module Customers
@@ -15,9 +20,25 @@ module Page
15
20
  submit
16
21
  end
17
22
  end
23
+
24
+ class Index < UlePage::Index
25
+ set_urls '/customers', '/organization/:organization_id/customers'
26
+
27
+ def has_customer?(customer)
28
+ check_have_hashtable_content customer, [ :name, :phone, :address ]
29
+ end
30
+
31
+ end
18
32
  end
19
33
  end
20
34
 
35
+ Given(/^home page has something$/) do |table|
36
+ visit '/'
37
+ click_link 'customers' # goto customer index pages.
38
+
39
+ pg.has_customer? table.hashes[0] # called customer index page method.
40
+ end
41
+
21
42
  ```
22
43
 
23
44
  ## Installation
@@ -30,31 +51,29 @@ gem 'ule_page'
30
51
 
31
52
  And then execute:
32
53
 
33
- $ bundle
54
+ $ bundle
34
55
 
35
56
  Or install it yourself as:
36
57
 
37
- $ gem install ule_page
58
+ $ gem install ule_page
38
59
 
39
60
  ## Usage
40
61
  Open your features/support/env.rb, add the following lines:
41
62
  ```ruby
42
63
  require 'ule_page'
43
- UlePage.setup do |config|
64
+ UlePage.setup do |config|
65
+ #add customised content
44
66
  end
45
67
  ```
68
+ ### Important:
69
+ Make sure the above lines in front of the screenshot requiring, or you can not get screenshot when you get errors.
70
+ ```ruby
71
+ require 'capybara-screenshot/cucumber'
72
+ ```
46
73
  And in features/support/helper.rb, add lines:
47
74
  ```ruby
48
75
  include UlePage::Helper
49
76
 
50
- def pg
51
- special_maps = {
52
- '/' => Page::Homes::Index.new # or something eles, based on your page model
53
- }
54
-
55
- return UlePage::ModelMatch.get_current_page_with_wait special_maps
56
- end
57
-
58
77
  ```
59
78
  After that, you can define your page model.
60
79
 
@@ -67,8 +86,26 @@ UlePage will map crud page model automatically, say, if you have a model custome
67
86
  '/customers/:id/edit' => Page::Customers::Edit
68
87
  }
69
88
  ```
89
+ If the page model is not the CRUD with simple, you can set urls manually on the page model.
90
+ ```ruby
91
+ class Index < UlePage::Index
92
+ set_urls '/orders', '/customer/:customer_id/orders'
93
+
94
+ # ...
95
+ end
96
+
97
+ ```
98
+
99
+
70
100
  In cucumber step files, you can use pg.xxx, pg will get your defined model automatically via current_url.
71
101
 
102
+ ```ruby
103
+ Given(/^home page has something$/) do
104
+ visit '/'
105
+ pg.has_something # you need to implement has_something method in the home_page page model.
106
+ end
107
+ ```
108
+
72
109
  ## Development
73
110
 
74
111
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -77,7 +114,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
77
114
 
78
115
  ## Contributing
79
116
 
80
- Bug reports and pull requests are welcome on GitHub at https://github.com/jerecui/ule_page. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
117
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jerecui/ule_page.
81
118
 
82
119
 
83
120
  ## License