testcentricity_web 0.2.3 → 0.3.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
2
  SHA1:
3
- metadata.gz: e36c18702ae63180ec86da1f48aa9b3af0a040e8
4
- data.tar.gz: 8eafb0e9a9e6440ada527c16a4d6ed182b4e4b92
3
+ metadata.gz: bf5dcf5a8e30b15a98ba7721e6807e712ece93cc
4
+ data.tar.gz: b3f5847cc2c1361cd173d6e07f8067ce73a27512
5
5
  SHA512:
6
- metadata.gz: ce8de52702ee0eb2a1b283be1e0dfb3835981a62ec26a5549089ce2514ac783fab040ea4d36467f44465a4777232e54e58168dc68e1a111190fa7535fa03fb68
7
- data.tar.gz: 64256d72be846117e338bde845a69bf427ccd38d5b5a43208c521504b21991aa9d8f70be4b6416dc4cfc9898c72b9a2c722c94bf0592b6ae13427b26a0b7c5dd
6
+ metadata.gz: 3ba3c62f7df7ab34d716122a5d4525eda934a79744bb3f12f52457d13cfb1933c7219f66e10dd9dcc4cbe512f60a94de2ac7afacfec9ed4d5aa20bddc8e6c7f8
7
+ data.tar.gz: b641077348a2ba86aaad168945e86c1a5071b61a57f56040941b85f72377aaff6bcf771fd464de8c3985b24a93cfc9fa2206e938689423ded6eb229678d3b4f0
@@ -51,6 +51,7 @@ module TestCentricity
51
51
  end
52
52
  end
53
53
 
54
+
54
55
  class DataManager
55
56
  @data_objects = {}
56
57
 
@@ -64,6 +64,37 @@ module TestCentricity
64
64
  end
65
65
 
66
66
  def self.mobile_device_agent(device)
67
+ key = device.gsub(/\s+/, "").downcase.to_sym
68
+ devices = device_agents
69
+ agent_string = devices[key]
70
+ raise "Device '#{device}' is not defined" unless agent_string
71
+ agent_string
72
+ end
73
+
74
+ def self.browser_size(browser, orientation)
75
+ key = browser.gsub(/\s+/, "").downcase.to_sym
76
+ sizes = device_sizes
77
+ browser_data = sizes[key]
78
+ if browser_data
79
+ width = browser_data[0]
80
+ height = browser_data[1]
81
+ default_orientation = browser_data[2]
82
+ if orientation
83
+ (orientation.downcase.to_sym == default_orientation) ?
84
+ size = [width, height] :
85
+ size = [height, width]
86
+ else
87
+ size = [width, height]
88
+ end
89
+ else
90
+ size = [1900, 1000]
91
+ end
92
+ size
93
+ end
94
+
95
+ private
96
+
97
+ def self.device_agents
67
98
  devices = { :iphone => "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1",
68
99
  :iphone4 => "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1",
69
100
  :iphone5 => "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1",
@@ -76,14 +107,10 @@ module TestCentricity
76
107
  :windows_phone8 => "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920)",
77
108
  :windows_phone7 => "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Lumia 710)"
78
109
  }
79
-
80
- key = device.gsub(/\s+/, "").downcase.to_sym
81
- agent_string = devices[key]
82
- raise "Device '#{device}' is not defined" unless agent_string
83
- agent_string
110
+ devices
84
111
  end
85
112
 
86
- def self.browser_size(browser, orientation)
113
+ def self.device_sizes
87
114
  sizes = { :iphone => [320, 568, :portrait],
88
115
  :iphone4 => [320, 480, :portrait],
89
116
  :iphone5 => [320, 568, :portrait],
@@ -96,23 +123,7 @@ module TestCentricity
96
123
  :windows_phone8 => [320, 480, :portrait],
97
124
  :windows_phone7 => [320, 480, :portrait]
98
125
  }
99
- key = browser.gsub(/\s+/, "").downcase.to_sym
100
- browser_data = sizes[key]
101
- if browser_data
102
- width = browser_data[0]
103
- height = browser_data[1]
104
- default_orientation = browser_data[2]
105
- if orientation
106
- (orientation.downcase.to_sym == default_orientation) ?
107
- size = [width, height] :
108
- size = [height, width]
109
- else
110
- size = [width, height]
111
- end
112
- else
113
- size = [1900, 1000]
114
- end
115
- size
126
+ sizes
116
127
  end
117
128
  end
118
129
  end
@@ -37,6 +37,14 @@ module TestCentricity
37
37
  class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::UIElement.new(self, "#{locator}", :page, :table);end))
38
38
  end
39
39
 
40
+ def self.selectlist(element_name, locator)
41
+ class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::UIElement.new(self, "#{locator}", :page, :selectlist);end))
42
+ end
43
+
44
+ def self.image(element_name, locator)
45
+ class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::UIElement.new(self, "#{locator}", :page, :image);end))
46
+ end
47
+
40
48
  def self.section(section_name, class_name, locator = nil)
41
49
  class_eval(%Q(def #{section_name.to_s};@#{section_name.to_s} ||= #{class_name.to_s}.new(self, "#{locator}", :page);end))
42
50
  end
@@ -8,16 +8,16 @@ module TestCentricity
8
8
  attr_reader :locator, :context
9
9
  attr_accessor :parent
10
10
 
11
- def self.trait(trait_name, &block)
12
- define_method(trait_name.to_s, &block)
13
- end
14
-
15
11
  def initialize(parent, locator, context)
16
12
  @parent = parent
17
13
  @locator = locator
18
14
  @context = context
19
15
  end
20
16
 
17
+ def self.trait(trait_name, &block)
18
+ define_method(trait_name.to_s, &block)
19
+ end
20
+
21
21
  def self.element(element_name, locator)
22
22
  class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::UIElement.new(self, "#{locator}", :section, nil);end))
23
23
  end
@@ -46,6 +46,14 @@ module TestCentricity
46
46
  class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::UIElement.new(self, "#{locator}", :section, :table);end))
47
47
  end
48
48
 
49
+ def self.selectlist(element_name, locator)
50
+ class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::UIElement.new(self, "#{locator}", :section, :selectlist);end))
51
+ end
52
+
53
+ def self.image(element_name, locator)
54
+ class_eval(%Q(def #{element_name.to_s};@#{element_name.to_s} ||= TestCentricity::UIElement.new(self, "#{locator}", :section, :image);end))
55
+ end
56
+
49
57
  def self.section(section_name, class_name, locator = nil)
50
58
  class_eval(%Q(def #{section_name.to_s};@#{section_name.to_s} ||= #{class_name.to_s}.new(self, "#{locator}", :section);end))
51
59
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '0.2.3'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -26,6 +26,7 @@ module TestCentricity
26
26
  Capybara.app_host = "#{environment.protocol}://#{environment.hostname}/#{environment.base_url}" :
27
27
  Capybara.app_host = "#{environment.protocol}://#{environment.base_url}"
28
28
 
29
+ # set browser window size only if testing with a desktop web browser
29
30
  if Environ.is_desktop?
30
31
  (ENV['BROWSER_SIZE'] == 'max') ?
31
32
  Browsers.maximize_browser :
@@ -6,10 +6,12 @@ require 'testcentricity_web/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'testcentricity_web'
8
8
  spec.version = TestCentricityWeb::VERSION
9
+ spec.platform = Gem::Platform::RUBY
10
+ spec.required_ruby_version = '>= 2.1.1'
9
11
  spec.authors = ['A.J. Mrozinski']
10
12
  spec.email = ['test_automation@icloud.com']
11
13
  spec.summary = %q{A Page Object and Data Object Model Framework for desktop/mobile web browser testing}
12
- spec.description = %q{TestCentricity core generic framework for desktop/mobile web site testing implements a Page Object and Data Object Model DSL, for use with Capybara}
14
+ spec.description = %q{TestCentricity core generic framework for desktop/mobile web site testing implements a Page Object and Data Object Model DSL, for use with Capybara}
13
15
  spec.homepage = ''
14
16
  spec.license = 'BSD3'
15
17
 
@@ -21,12 +23,12 @@ Gem::Specification.new do |spec|
21
23
  spec.add_development_dependency 'bundler', '~> 1.5'
22
24
  spec.add_development_dependency 'rake'
23
25
 
24
- spec.add_dependency 'capybara', '~> 2.5'
26
+ spec.add_dependency 'capybara', '>= 2.5'
25
27
  spec.add_dependency 'rspec-expectations'
26
- spec.add_dependency 'rspec', '~> 3.4.0'
27
- spec.add_dependency 'test-unit', '~> 3.1.7'
28
- spec.add_dependency 'faker', '~> 1.6.1'
29
- spec.add_dependency 'chronic', '~> 0.10.2'
30
- spec.add_dependency 'spreadsheet', '~> 1.1.1'
31
- spec.add_dependency 'selenium-webdriver', '~> 2.50.0'
28
+ spec.add_dependency 'rspec'
29
+ spec.add_dependency 'test-unit'
30
+ spec.add_dependency 'faker', '>= 1.6.1'
31
+ spec.add_dependency 'chronic', '>= 0.10.2'
32
+ spec.add_dependency 'spreadsheet', '>= 1.1.1'
33
+ spec.add_dependency 'selenium-webdriver', '>= 2.50.0'
32
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcentricity_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.J. Mrozinski
@@ -42,14 +42,14 @@ dependencies:
42
42
  name: capybara
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.5'
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: '2.5'
55
55
  - !ruby/object:Gem::Dependency
@@ -70,87 +70,87 @@ dependencies:
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 3.4.0
75
+ version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 3.4.0
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: test-unit
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 3.1.7
89
+ version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 3.1.7
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: faker
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: 1.6.1
104
104
  type: :runtime
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.6.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: chronic
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: 0.10.2
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: 0.10.2
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: spreadsheet
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: 1.1.1
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: 1.1.1
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: selenium-webdriver
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: 2.50.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: 2.50.0
153
- description: TestCentricity core generic framework for desktop/mobile web site testing
153
+ description: TestCentricity core generic framework for desktop/mobile web site testing
154
154
  implements a Page Object and Data Object Model DSL, for use with Capybara
155
155
  email:
156
156
  - test_automation@icloud.com
@@ -197,7 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - ">="
199
199
  - !ruby/object:Gem::Version
200
- version: '0'
200
+ version: 2.1.1
201
201
  required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  requirements:
203
203
  - - ">="