page_magic 1.2.7 → 1.2.8.alpha

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
  SHA1:
3
- metadata.gz: 3958a4d16d7ed2f76f9b58dd90e88c0e30a29dfb
4
- data.tar.gz: 55f5d9af299438f3630ac2208a3c7e38eb02b735
3
+ metadata.gz: 53d354fcdf720993752439b9b8a914fa96562d26
4
+ data.tar.gz: c98b16fec58b146c3b97f024037566dd7b731bf6
5
5
  SHA512:
6
- metadata.gz: dca1340ab4d09dd01f8b86614c33dd8e079ddc58d7897ebdb1a1d8dd44b750aa2aea85a7ec49935a8a79cb6f2533a7db3791cee1aa0226a806c513fb48148762
7
- data.tar.gz: 415b1f023d0902de1a9933a426de9a5604a43765c09dd1a3af6e01fa29f876930f9c79dc23509441c8bdf1cad0ed0493a78202da56574816faa1e2549c7887a9
6
+ metadata.gz: 0d03b030f90c3f49227769099ee0c158fc541c20c6dd5abffed4756de4b8c000208f343b6756b9b761eaf5a1afd2ea65235cb196103cb7c3757e11a73e1d9037
7
+ data.tar.gz: e732614138d46c8924877c872453f48f17f79cdbeda7ecf8637dbf01f4c92f49fbc687e7ddd92e56b3e494b7145fb030cc52319c1e9ddbb250cf76c726b33491
data/Gemfile.lock CHANGED
@@ -7,7 +7,8 @@ GEM
7
7
  minitest (~> 5.1)
8
8
  thread_safe (~> 0.3, >= 0.3.4)
9
9
  tzinfo (~> 1.1)
10
- addressable (2.4.0)
10
+ addressable (2.5.2)
11
+ public_suffix (>= 2.0.2, < 4.0)
11
12
  arbre (1.1.1)
12
13
  activesupport (>= 3.0.0)
13
14
  ast (2.3.0)
@@ -15,7 +16,7 @@ GEM
15
16
  descendants_tracker (~> 0.0.4)
16
17
  ice_nine (~> 0.11.0)
17
18
  thread_safe (~> 0.3, >= 0.3.1)
18
- builder (3.2.2)
19
+ builder (3.2.3)
19
20
  capybara (2.7.1)
20
21
  addressable
21
22
  mime-types (>= 1.16)
@@ -43,65 +44,67 @@ GEM
43
44
  ffi (1.9.14)
44
45
  git (1.3.0)
45
46
  github-markup (1.4.0)
46
- github_api (0.14.5)
47
- addressable (~> 2.4.0)
48
- descendants_tracker (~> 0.0.4)
47
+ github_api (0.11.3)
48
+ addressable (~> 2.3)
49
+ descendants_tracker (~> 0.0.1)
49
50
  faraday (~> 0.8, < 0.10)
50
- hashie (>= 3.4)
51
- oauth2 (~> 1.0)
52
- hashie (3.4.4)
51
+ hashie (>= 1.2)
52
+ multi_json (>= 1.7.5, < 2.0)
53
+ nokogiri (~> 1.6.0)
54
+ oauth2
55
+ hashie (3.5.6)
53
56
  highline (1.7.8)
54
57
  i18n (0.7.0)
55
58
  ice_nine (0.11.2)
56
- jeweler (2.1.1)
59
+ jeweler (2.3.5)
57
60
  builder
58
61
  bundler (>= 1.0)
59
62
  git (>= 1.2.5)
60
- github_api
63
+ github_api (~> 0.11.0)
61
64
  highline (>= 1.6.15)
62
65
  nokogiri (>= 1.5.10)
66
+ psych (~> 2.2)
63
67
  rake
64
68
  rdoc
65
- semver
66
- json (1.8.3)
67
- jwt (1.5.4)
69
+ semver2
70
+ json (1.8.6)
71
+ jwt (1.5.6)
68
72
  mime-types (3.1)
69
73
  mime-types-data (~> 3.2015)
70
74
  mime-types-data (3.2016.0521)
71
75
  mini_portile2 (2.1.0)
72
76
  minitest (5.9.0)
73
- multi_json (1.12.1)
74
- multi_xml (0.5.5)
77
+ multi_json (1.12.2)
78
+ multi_xml (0.6.0)
75
79
  multipart-post (2.0.0)
76
- nokogiri (1.6.8)
80
+ nokogiri (1.6.8.1)
77
81
  mini_portile2 (~> 2.1.0)
78
- pkg-config (~> 1.1.7)
79
- oauth2 (1.2.0)
80
- faraday (>= 0.8, < 0.10)
82
+ oauth2 (1.4.0)
83
+ faraday (>= 0.8, < 0.13)
81
84
  jwt (~> 1.0)
82
85
  multi_json (~> 1.3)
83
86
  multi_xml (~> 0.5)
84
87
  rack (>= 1.2, < 3)
85
88
  parser (2.3.1.2)
86
89
  ast (~> 2.2)
87
- pkg-config (1.1.7)
88
90
  poltergeist (1.10.0)
89
91
  capybara (~> 2.1)
90
92
  cliver (~> 0.3.1)
91
93
  websocket-driver (>= 0.2.0)
92
94
  powerpack (0.1.1)
95
+ psych (2.2.4)
96
+ public_suffix (3.0.0)
93
97
  pullreview-coverage (0.0.5)
94
98
  certifi
95
99
  simplecov (>= 0.7.1, < 1.0.0)
96
- rack (1.6.4)
100
+ rack (1.6.8)
97
101
  rack-protection (1.5.3)
98
102
  rack
99
103
  rack-test (0.6.3)
100
104
  rack (>= 1.0)
101
105
  rainbow (2.1.0)
102
- rake (11.2.2)
103
- rdoc (4.2.2)
104
- json (~> 1.4)
106
+ rake (12.1.0)
107
+ rdoc (5.1.0)
105
108
  redcarpet (3.3.4)
106
109
  reek (4.2.3)
107
110
  codeclimate-engine-rb (~> 0.3.1)
@@ -132,7 +135,7 @@ GEM
132
135
  childprocess (~> 0.5)
133
136
  rubyzip (~> 1.0)
134
137
  websocket (~> 1.0)
135
- semver (1.0.1)
138
+ semver2 (3.4.2)
136
139
  simplecov (0.12.0)
137
140
  docile (~> 1.1.0)
138
141
  json (>= 1.8, < 3)
@@ -142,7 +145,7 @@ GEM
142
145
  rack (~> 1.5)
143
146
  rack-protection (~> 1.4)
144
147
  tilt (>= 1.3, < 3)
145
- thread_safe (0.3.5)
148
+ thread_safe (0.3.6)
146
149
  tilt (2.0.5)
147
150
  tzinfo (1.2.2)
148
151
  thread_safe (~> 0.1)
@@ -184,4 +187,4 @@ DEPENDENCIES
184
187
  yard (~> 0.8)
185
188
 
186
189
  BUNDLED WITH
187
- 1.11.2
190
+ 1.15.4
data/README.md CHANGED
@@ -20,6 +20,25 @@ Well PageMagic might just be the answer!
20
20
 
21
21
  Give it a try and let us know what you think! There will undoubtedly be things that can be improved and issues that
22
22
  we are not aware of so your feedback/pull requests are greatly appreciated!
23
+
24
+ ##Under the hood
25
+ Under the hood PageMagic uses the totally brilliant [Capybara](https://github.com/teamcapybara/capybara) to benefit from its amazing cross browser support.
26
+
27
+ PageMagic builds on top of Capybara to build resuable models for webpages and website structure.
28
+
29
+ ##What about the other PageObject frameworks out there?
30
+ PageMagic isn't the first [PageObject](https://martinfowler.com/bliki/PageObject.html) framework to be written, indeed there are others out there that are totaly awesome e.g:
31
+ - [PageObject](https://github.com/cheezy/page-object)
32
+ - [SitePrism](https://github.com/natritmeyer/site_prism)
33
+
34
+ Whilst these APIs are great, PageMagic goes much further in the power it provides for:
35
+ - [modelling pages](defining-pages) and page components
36
+ - defining the [wait logic](#hooks) and [watchers](#watchers) that are required to build robust page objects that work reliably with javascript rich webpages.
37
+ - Supporting [page transitions](#page-mapping)
38
+
39
+ Check it out :)
40
+
41
+
23
42
  # Contents
24
43
 
25
44
  - [Installation](#installation)
@@ -157,6 +176,19 @@ After visiting a page you are will get a `Session` object. Elements can be acces
157
176
  ```ruby
158
177
  page.search_field.set 'page_magic'
159
178
  ```
179
+ PageMagic sits on top of [Capybara](https://github.com/teamcapybara/capybara) and ultimately returns capybara elements elements for you interact with. Interacting with the element types above is done by calling the following methods:
180
+
181
+ element | method
182
+ --- | ---
183
+ text_field | set(String)
184
+ checkbox | set(Boolean)
185
+ radio | choose(String)
186
+ link | click
187
+ text_area | set(String)
188
+ select_list | select(String)
189
+
190
+ Typically you will not need to know much about Capybara itself but there will be times when you want to interact with elements at a lower level.In this case please see Capybara's [API](http://www.rubydoc.info/github/jnicklas/capybara/Capybara/Node/Element) For more information.
191
+
160
192
 
161
193
  ### Sub Elements
162
194
  If your pages are complex you can use PageMagic to compose pages, their elements and subelements to as many levels as
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.7
1
+ 1.2.8.alpha
@@ -67,6 +67,7 @@ module PageMagic
67
67
  end
68
68
  end
69
69
 
70
+ alias elements element
70
71
  TYPES.each { |type| alias_method type, :element }
71
72
 
72
73
  # @return [Hash] element definition names mapped to blocks that can be used to create unique instances of
@@ -150,6 +150,13 @@ module PageMagic
150
150
  end
151
151
  end
152
152
 
153
+ describe '#elements' do
154
+ it 'is an alias of #element allowing page_magic to find multiple results' do
155
+ expected = described_class.public_instance_method(:element)
156
+ expect(described_class.public_instance_method(:elements)).to eq(expected)
157
+ end
158
+ end
159
+
153
160
  describe '#element_definitions' do
154
161
  it 'should return your a copy of the core definition' do
155
162
  subject.text_field :alias, child_selector
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page_magic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.8.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leon Davis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-17 00:00:00.000000000 Z
11
+ date: 2017-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -196,12 +196,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
196
196
  version: '2.1'
197
197
  required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - ">="
199
+ - - ">"
200
200
  - !ruby/object:Gem::Version
201
- version: '0'
201
+ version: 1.3.1
202
202
  requirements: []
203
203
  rubyforge_project:
204
- rubygems_version: 2.4.8
204
+ rubygems_version: 2.4.6
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: Framework for modeling and interacting with webpages