insite 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5303ebbba2c3ccbb522d49e6a8288cc9320de481
4
- data.tar.gz: f67c778dca6861fe7b2e06a49cabc1f9c41edbd6
2
+ SHA256:
3
+ metadata.gz: ff0c306e9463fd4190878e92ddf560df01c426c617019c36be931948e24b65e2
4
+ data.tar.gz: 3ff42e536b0e3e324ff73c8bed4788f17075cbec8684c43acb892bf2ee33339a
5
5
  SHA512:
6
- metadata.gz: 7edf841b3211e5941e71e54457f6e7089e6a3dbe47288ffaa01c5b9585de756e3f855a348b176907fda623fdd668f8ef992eb3812b4dd973edfa4495b344900d
7
- data.tar.gz: a5a0edc7159126afe476f1c6892dc2020624aada0fa42e0295067d69c6390c854dce3173e50c1beadff50e86dfcac39a853edd04a559fdbaa3687585b7b91593
6
+ metadata.gz: fd5cc232ca61766e2e137ec0457e953fb56f23f772bcc9273fb2641436a3acdfe279e75f471efbc093aa33a3dc6a54ae87a8a24834834923040a93f27784ddc4
7
+ data.tar.gz: 84facfc95ccf63e0c9b260ed6644ca8cbffd91cb569adc6573b38985589cbd6011220481465941bad178ca2e6a9faae7ada668ff0993e972470123aaa6bab476
@@ -2,7 +2,7 @@ require_relative 'component_methods'
2
2
  require_relative 'component_collection'
3
3
  require_relative 'component_instance_methods'
4
4
  require_relative '../methods/common_methods'
5
- require 'pry'
5
+
6
6
  # Allows the page object developer to encapsulate common web application features
7
7
  # into components that can be reused across multiple pages.
8
8
  module Insite
@@ -1,4 +1,3 @@
1
-
2
1
  module Insite
3
2
  METHOD_MAP = {Watir::Rect=>[:rect],
4
3
  Watir::Menu=>[:menu],
@@ -169,7 +168,6 @@ module Insite
169
168
  Watir::Use=>[:use],
170
169
  Watir::TableCaption=>[:caption],
171
170
  Watir::FieldSet=>[:fieldset, :field_set],
172
- Watir::RadioSet=>[:radio_set],
173
171
  Watir::FieldSetCollection=>[:fieldsets, :field_sets],
174
172
  Watir::Input=>[:input],
175
173
  Watir::Output=>[:output],
@@ -316,7 +314,7 @@ module Insite
316
314
  bdis colgroup div font h6s kbds menuitems optgroups radial_gradient select_list svgs time
317
315
  bdo colgroups divs fonts hatchpath keygen menus option radial_gradients select_lists switch times
318
316
  bdos cols dl footer hatchpaths keygens mesh options radio selects switches titles
319
- blockquote cursor dls footers head label meshes output radio_set small symbol tr
317
+ blockquote cursor dls footers head label meshes output small symbol tr
320
318
  blockquotes cursors dt foreign_object header labels meshgradient outputs radios smalls symbols track
321
319
  body data dts foreign_objects headers legend meshgradients p rb solidcolor table tracks
322
320
  bodys datalist element form heads legends meshpatch param rbs solidcolors tables trs
@@ -1,5 +1,5 @@
1
1
  require_relative 'angular_material_component'
2
- require 'pry'
2
+
3
3
  class MatChipList < AngularMaterialComponent
4
4
  select_by tag_name: 'mat-chip-list'
5
5
 
data/lib/insite/insite.rb CHANGED
@@ -155,14 +155,45 @@ module Insite
155
155
  end
156
156
  end
157
157
 
158
+ # Update the site class with methods for each page that is defined.
158
159
  self.class.class_eval do
160
+
161
+ # Returns a page object for the page.
159
162
  define_method(current_page.to_s.underscore) do |args = nil, block = nil|
160
163
  current_page.new(self, args)
161
164
  end
162
165
 
166
+ # Returns true if the page is being displayed, false if not.
163
167
  define_method("#{current_page.to_s.underscore}?") do
164
168
  on_page? current_page
165
169
  end
170
+
171
+ # Similar to the method above but attempts navigation prior to the page
172
+ # check. Returns a boolean rather than a page object: true if the
173
+ # right page was loaded successfully, false if not. A navigation attempt
174
+ # always occurs when this method is called.
175
+ #
176
+ # The main benefit of this method is to make it easier to write test
177
+ # scenarios for situations where you know navigation is going to fail
178
+ # (Examples of this would be session timeouts or role/privilege
179
+ # test scenarios.) Normally an Insite::Errors::WrongPageError is
180
+ # automatically raised when a navigation attempt fails. So in order to
181
+ # test these sorts of scenarios you'd have to do a little more work to
182
+ # handle the exception. Examples in RSpec:
183
+ #
184
+ # The "hard" way:
185
+ # expect {s.login_page }.to raise_error(Insite::Errors::WrongPageError)
186
+ #
187
+ # The same assert using this method:
188
+ # expect(s.try_login_page).to be_truthy
189
+ define_method("try_#{current_page.to_s.underscore}") do |args = nil, block = nil|
190
+ begin
191
+ current_page.new(self, args)
192
+ true
193
+ rescue Insite::Errors::WrongPageError => e
194
+ return false
195
+ end
196
+ end
166
197
  end
167
198
  end
168
199
  end
@@ -331,7 +331,6 @@ module Insite
331
331
  end
332
332
 
333
333
  self.class_eval do
334
- #klass = fname.to_s.camelize.constantize
335
334
  if klass.alias
336
335
  define_method(klass.alias) do
337
336
  klass.new(self)
@@ -1,3 +1,3 @@
1
1
  module Insite
2
- VERSION = '0.0.7'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Fitisoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-14 00:00:00.000000000 Z
11
+ date: 2018-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  version: '0'
227
227
  requirements: []
228
228
  rubyforge_project:
229
- rubygems_version: 2.5.2.1
229
+ rubygems_version: 2.7.6
230
230
  signing_key:
231
231
  specification_version: 4
232
232
  summary: Insite is a page object library that's geared towards writing reusable code