page-object-lds 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ module TNR360
2
+ VERSION = "0.0.1"
3
+ end
@@ -219,6 +219,63 @@ module PageObject
219
219
  end
220
220
  end
221
221
 
222
+
223
+ ##Begining of Mehdi's added methods
224
+
225
+ #
226
+ # adds four methods to the page object - one to set text in a text field,
227
+ # another to retrieve text from a text field, another to return the text
228
+ # field element, another to check the text field's existence.
229
+ #
230
+ # @example
231
+ # text_field(:first_name, :id => "first_name")
232
+ # # will generate 'first_name', 'first_name=', 'first_name_element',
233
+ # # 'first_name?' methods
234
+ #
235
+ # @param [String] the name used for the generated methods
236
+ # @param [Hash] identifier how we find a text field. You can use a multiple parameters
237
+ # by combining of any of the following except xpath. The valid keys are:
238
+ # * :class => Watir and Selenium
239
+ # * :css => Selenium only
240
+ # * :id => Watir and Selenium
241
+ # * :index => Watir and Selenium
242
+ # * :label => Watir and Selenium
243
+ # * :name => Watir and Selenium
244
+ # * :text => Watir and Selenium
245
+ # * :title => Watir and Selenium
246
+ # * :value => Watir only
247
+ # * :xpath => Watir and Selenium
248
+ # @param optional block to be invoked when element method is called
249
+ #
250
+ def lds_text_field(name, identifier,idBlock=nil,idScreen=nil, &block)
251
+ lds_standard_methods(name, identifier,idBlock,idScreen, 'lds_','text_field','_for', &block)
252
+ define_method(name) do
253
+ return platform.lds_text_field_value_for(identifier.clone,idBlock.clone,idScreen.clone) unless block_given?
254
+ self.send("#{name}_element").value
255
+ end
256
+ define_method("#{name}=") do |value|
257
+ return platform.lds_text_field_value_set(identifier.clone,idBlock.clone,idScreen.clone, value) unless block_given?
258
+ self.send("#{name}_element").value = value
259
+ end
260
+ end
261
+
262
+ def lds_standard_methods(name, identifier, idBlock=nil,idScreen=nil, method_pre,method_heart,method_suf, &block)
263
+ define_method("#{name}_element") do
264
+ return call_block(&block) if block_given?
265
+ platform.send(method_pre.to_s+'generic_'+method_heart.to_s+method_suf.to_s, identifier.clone,idBlock.clone,idScreen.clone)
266
+ end
267
+ define_method("#{name}_lds_element") do
268
+ return call_block(&block) if block_given?
269
+ platform.send(method_pre.to_s+'lds'+method_heart.to_s.gsub('_', '')+method_suf.to_s, identifier.clone,idBlock.clone,idScreen.clone)
270
+ end
271
+ define_method("#{name}?") do
272
+ return call_block(&block).exists? if block_given?
273
+ platform.send(method_pre.to_s+'lds'+method_heart.to_s.gsub('_', '')+method_suf.to_s, identifier.clone,idBlock.clone,idScreen.clone).isExist?
274
+ end
275
+ end
276
+
277
+ ##end of mehdi's added methods
278
+
222
279
  #
223
280
  # adds three methods to the page object - one to get the text from a hidden field,
224
281
  # another to retrieve the hidden field element, and another to check the hidden
@@ -34,7 +34,7 @@ module PageObject
34
34
  require 'page-object/platforms/selenium_webdriver/text_field'
35
35
  self.class.send :include, PageObject::Platforms::SeleniumWebDriver::TextField
36
36
  else
37
- raise ArgumentError, "expect platform to be :watir_webdriver or :selenium_webdriver"
37
+ raise ArgumentError, "expect platform to be :watir_webdriver, :lds_watir_webdriver or :selenium_webdriver"
38
38
  end
39
39
  end
40
40
  end
@@ -235,6 +235,47 @@ module PageObject
235
235
  process_watir_call("hidden(identifier).value", Elements::HiddenField, identifier)
236
236
  end
237
237
 
238
+ ## start of mehdi's added code
239
+
240
+ #
241
+ # platform method to get the value stored in a text field
242
+ # See PageObject::Accessors#text_field
243
+ #
244
+ def lds_text_field_value_for(identifier,idBloc=nil,idScreen=nil)
245
+ # process_watir_call("text_field(identifier).value", Elements::TextField, identifier)
246
+ LdsTextField.new(@browser,identifier,idBloc,idScreen).getValue
247
+
248
+ end
249
+
250
+ #
251
+ # platform method to set the value for a text field
252
+ # See PageObject::Accessors#text_field
253
+ #
254
+ def lds_text_field_value_set(identifier, value,idBloc=nil,idScreen=nil)
255
+ #process_watir_call("text_field(identifier).set(value)", Elements::TextField, identifier, value)
256
+ LdsTextField.new(@browser,identifier,idBloc,idScreen).fill value
257
+ end
258
+
259
+ #
260
+ # platform method to retrieve a text field element
261
+ # See PageObject::Accessors#text_field
262
+ #
263
+ def lds_generic_text_field_for(identifier,idBloc=nil,idScreen=nil)
264
+ #find_watir_element("text_field(identifier)", Elements::TextField, identifier)
265
+ LdsTextField.new(@browser,identifier,idBloc,idScreen).getElement
266
+ end
267
+
268
+ #
269
+ # platform method to retrieve a text field element
270
+ # See PageObject::Accessors#text_field
271
+ #
272
+ def lds__ldstextfield_for(identifier,idBloc=nil,idScreen=nil)
273
+ #find_watir_element("text_field(identifier)", Elements::TextField, identifier)
274
+ LdsTextField.new(@browser,identifier,idBloc,idScreen)
275
+ end
276
+
277
+ ## end of mehdi's added code
278
+
238
279
  #
239
280
  # platform method to retrieve a hidden field element
240
281
  # See PageObject::Accessors#hidden_field
@@ -977,6 +1018,13 @@ module PageObject
977
1018
  value
978
1019
  end
979
1020
 
1021
+ def process_lds_watir_call(the_call, type, identifier, value=nil, tag_name=nil)
1022
+ identifier, frame_identifiers = parse_identifiers(identifier, type, tag_name)
1023
+ value = @browser.instance_eval "#{nested_frames(frame_identifiers)}#{the_call}"
1024
+ switch_to_default_content(frame_identifiers)
1025
+ value
1026
+ end
1027
+
980
1028
  def parse_identifiers(identifier, element, tag_name=nil)
981
1029
  frame_identifiers = identifier.delete(:frame)
982
1030
  identifier = add_tagname_if_needed identifier, tag_name if tag_name
@@ -1,4 +1,4 @@
1
1
  module PageObject
2
2
  # @private
3
- VERSION = "0.0.12"
3
+ VERSION = "0.0.13"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page-object-lds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehdi Taoufik Chaouachi
@@ -14,98 +14,98 @@ dependencies:
14
14
  name: watir-webdriver
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.6.11
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.6.11
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.44.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.44.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: page_navigation
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.9'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.9'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 3.1.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 3.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: cucumber
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - ! '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.3.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.3.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: yard
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - ! '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.7.2
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - ! '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.7.2
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rack
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - ! '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.0'
111
111
  description: Page Object DSL that works with both Watir , Selenium and FWK360 LDS
@@ -116,18 +116,18 @@ executables: []
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
- - ".gitignore"
120
- - ".idea/encodings.xml"
121
- - ".idea/misc.xml"
122
- - ".idea/modules.xml"
123
- - ".idea/page-object-lds.iml"
124
- - ".idea/scopes/scope_settings.xml"
125
- - ".idea/vcs.xml"
126
- - ".idea/workspace.xml"
127
- - ".rspec"
128
- - ".ruby-gemset"
129
- - ".ruby-version"
130
- - ".travis.yml"
119
+ - .gitignore
120
+ - .idea/encodings.xml
121
+ - .idea/misc.xml
122
+ - .idea/modules.xml
123
+ - .idea/page-object-lds.iml
124
+ - .idea/scopes/scope_settings.xml
125
+ - .idea/vcs.xml
126
+ - .idea/workspace.xml
127
+ - .rspec
128
+ - .ruby-gemset
129
+ - .ruby-version
130
+ - .travis.yml
131
131
  - ChangeLog
132
132
  - Gemfile
133
133
  - Guardfile
@@ -257,6 +257,30 @@ files:
257
257
  - features/text_field.feature
258
258
  - features/unordered_list.feature
259
259
  - features/video.feature
260
+ - lib/TNR360/ServerUtils.rb
261
+ - lib/TNR360/TNRTestFooter.rb
262
+ - lib/TNR360/TNRTestHeader.rb
263
+ - lib/TNR360/TnrUtils.rb
264
+ - lib/TNR360/TnrUtilsGeneric.rb
265
+ - lib/TNR360/TnrUtilsInes.rb
266
+ - lib/TNR360/TnrUtilsMehdi.rb
267
+ - lib/TNR360/components/dependencies.rb
268
+ - lib/TNR360/components/lds_action.rb
269
+ - lib/TNR360/components/lds_area.rb
270
+ - lib/TNR360/components/lds_block.rb
271
+ - lib/TNR360/components/lds_block_in_summary_view.rb
272
+ - lib/TNR360/components/lds_checkbox.rb
273
+ - lib/TNR360/components/lds_column.rb
274
+ - lib/TNR360/components/lds_fk.rb
275
+ - lib/TNR360/components/lds_grid.rb
276
+ - lib/TNR360/components/lds_lov.rb
277
+ - lib/TNR360/components/lds_menu.rb
278
+ - lib/TNR360/components/lds_radio.rb
279
+ - lib/TNR360/components/lds_screen.rb
280
+ - lib/TNR360/components/lds_summary_view.rb
281
+ - lib/TNR360/components/lds_text_field.rb
282
+ - lib/TNR360/components/lds_vue360.rb
283
+ - lib/TNR360/version.rb
260
284
  - lib/page-object-lds.rb
261
285
  - lib/page-object/accessors.rb
262
286
  - lib/page-object/core_ext/string.rb
@@ -413,18 +437,19 @@ require_paths:
413
437
  - lib
414
438
  required_ruby_version: !ruby/object:Gem::Requirement
415
439
  requirements:
416
- - - ">="
440
+ - - ! '>='
417
441
  - !ruby/object:Gem::Version
418
442
  version: '0'
419
443
  required_rubygems_version: !ruby/object:Gem::Requirement
420
444
  requirements:
421
- - - ">="
445
+ - - ! '>='
422
446
  - !ruby/object:Gem::Version
423
447
  version: '0'
424
448
  requirements: []
425
449
  rubyforge_project: page-object-lds
426
- rubygems_version: 2.4.5
450
+ rubygems_version: 2.4.6
427
451
  signing_key:
428
452
  specification_version: 4
429
453
  summary: Page Object DSL for browser testing
430
454
  test_files: []
455
+ has_rdoc: