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 +5 -5
- data/.coveralls.yml +1 -0
- data/.travis.yml +12 -0
- data/Gemfile +4 -2
- data/Gemfile.lock +196 -132
- data/README.md +51 -14
- data/lib/ule_page.rb +8 -7
- data/lib/ule_page/helper.rb +7 -25
- data/lib/ule_page/model_match.rb +59 -34
- data/lib/ule_page/models/create.rb +2 -2
- data/lib/ule_page/models/index.rb +10 -7
- data/lib/ule_page/page.rb +86 -23
- data/lib/ule_page/page_map.rb +15 -0
- data/lib/ule_page/site_prism_extender.rb +15 -17
- data/lib/ule_page/version.rb +1 -1
- data/ule_page.gemspec +25 -32
- metadata +43 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 98f5e46718aa9e16727ff68419740fece7b75bdcd59c61dc643426676dc4bb28
|
4
|
+
data.tar.gz: cacd0c752462cbe6fee4ec0b91985df6a21c1ffc18efb053cb9f5eef0449942f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2de80281e8d32e208a10a0365f330fcc69353bf0710ab00b634f7dd4d5f423e232cd01d65836e2f6d0e4f249ad02735e545dd9ff84cd07e6250ecea4a92d753f
|
7
|
+
data.tar.gz: c215be5ca5856ac7ba89418a7a7e2aa7e07b33d4fe797ce1a801d94ef76ad33288e0ed29210c92ce034b74631c22c6cf45b66a23ab46999a2868444dee20237f
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
repo_token: iYdE1JsFQ5UjoOfl4kLDjSffQUH7X93XP
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,173 +1,237 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ule_page (0.0
|
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://
|
12
|
+
remote: https://rubygems.org/
|
14
13
|
specs:
|
15
|
-
|
16
|
-
actionpack (=
|
17
|
-
|
18
|
-
|
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 (~>
|
21
|
-
actionpack (
|
22
|
-
actionview (=
|
23
|
-
activesupport (=
|
24
|
-
rack (~>
|
25
|
-
rack-test (
|
26
|
-
rails-dom-testing (~>
|
27
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
activesupport (=
|
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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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 (
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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.
|
70
|
-
docile (1.
|
71
|
-
|
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.
|
75
|
-
activesupport (>= 4.
|
76
|
-
|
77
|
-
|
78
|
-
|
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.
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
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
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
activesupport (
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
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 (
|
161
|
+
thor (~> 1.0)
|
116
162
|
rake (10.5.0)
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
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.
|
126
|
-
rspec-its (1.
|
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.
|
180
|
+
rspec-mocks (3.10.1)
|
130
181
|
diff-lcs (>= 1.2.0, < 2.0)
|
131
|
-
rspec-support (~> 3.
|
132
|
-
rspec-rails (
|
133
|
-
actionpack (>=
|
134
|
-
activesupport (>=
|
135
|
-
railties (>=
|
136
|
-
rspec-core (~> 3.
|
137
|
-
rspec-expectations (~> 3.
|
138
|
-
rspec-mocks (~> 3.
|
139
|
-
rspec-support (~> 3.
|
140
|
-
rspec-support (3.
|
141
|
-
simplecov (0.
|
142
|
-
docile (~> 1.1
|
143
|
-
|
144
|
-
|
145
|
-
simplecov-html (0.
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
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.
|
206
|
+
sprockets-rails (3.2.2)
|
153
207
|
actionpack (>= 4.0)
|
154
208
|
activesupport (>= 4.0)
|
155
209
|
sprockets (>= 3.0.0)
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
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.
|
245
|
+
1.16.4
|
data/README.md
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
# UlePage
|
2
2
|
|
3
|
-
|
3
|
+
[](https://badge.fury.io/rb/ule_page)
|
4
|
+
[](https://travis-ci.org/jerecui/ule_page)
|
5
|
+
[](https://coveralls.io/r/jerecui/ule_page?branch=master)
|
6
|
+
[](http://opensource.org/licenses/MIT)
|
4
7
|
|
5
|
-
|
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
|
-
|
54
|
+
$ bundle
|
34
55
|
|
35
56
|
Or install it yourself as:
|
36
57
|
|
37
|
-
|
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
|
-
|
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.
|
117
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/jerecui/ule_page.
|
81
118
|
|
82
119
|
|
83
120
|
## License
|