testcentricity_web 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +20 -3
- data/lib/testcentricity_web/data_objects/data_objects_helper.rb +48 -0
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_elements/audio.rb +34 -0
- data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +1 -1
- data/lib/testcentricity_web/web_elements/video.rb +34 -0
- data/testcentricity_web.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '059070e4e6e8fc3ea48e75b396ead585e72e3213'
|
4
|
+
data.tar.gz: e24b7f759ee8555775457427ce7ab47b8079bb0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cca7a09577756150eb5187b9d317423dd60a476678094900c09a36c229481e9c112325ab9212eef4b74440b485cfd5aa5748f3757af3e6a4c46c20a68facdad
|
7
|
+
data.tar.gz: bade4a1a074299e1f7668c0306fa3ff837917fa2c144ec973ac6feb61fd5c194b0b963c4bdfd4b084b62f498dbda5ee113ff00df49321696a9d1e92107fc5875
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
4
|
|
5
|
+
## [3.1.2] - 2018-12-03
|
6
|
+
|
7
|
+
### Added
|
8
|
+
* Added `Audio.current_time` (setter), `Audio.play`, and `Audio.pause` methods.
|
9
|
+
* Added `Video.current_time` (setter), `Video.play`, and `Video.pause` methods.
|
10
|
+
|
11
|
+
|
5
12
|
## [3.1.1] - 2018-11-30
|
6
13
|
|
7
14
|
### Added
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
testcentricity_web (3.1.
|
4
|
+
testcentricity_web (3.1.2)
|
5
5
|
appium_lib
|
6
6
|
browserstack-local
|
7
7
|
capybara (>= 3.1, < 4)
|
@@ -24,9 +24,13 @@ GEM
|
|
24
24
|
appium_lib_core (~> 2.0)
|
25
25
|
nokogiri (~> 1.8, >= 1.8.1)
|
26
26
|
tomlrb (~> 1.1)
|
27
|
-
appium_lib_core (2.
|
27
|
+
appium_lib_core (2.2.0)
|
28
28
|
faye-websocket (~> 0.10.0)
|
29
29
|
selenium-webdriver (~> 3.14, >= 3.14.1)
|
30
|
+
axiom-types (0.1.1)
|
31
|
+
descendants_tracker (~> 0.0.4)
|
32
|
+
ice_nine (~> 0.11.0)
|
33
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
30
34
|
browserstack-local (1.3.0)
|
31
35
|
capybara (3.12.0)
|
32
36
|
addressable
|
@@ -39,7 +43,12 @@ GEM
|
|
39
43
|
childprocess (0.9.0)
|
40
44
|
ffi (~> 1.0, >= 1.0.11)
|
41
45
|
chronic (0.10.2)
|
46
|
+
coercible (1.0.0)
|
47
|
+
descendants_tracker (~> 0.0.1)
|
42
48
|
concurrent-ruby (1.1.3)
|
49
|
+
descendants_tracker (0.0.4)
|
50
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
51
|
+
equalizer (0.0.11)
|
43
52
|
eventmachine (1.2.7)
|
44
53
|
faker (1.9.1)
|
45
54
|
i18n (>= 0.7)
|
@@ -49,6 +58,7 @@ GEM
|
|
49
58
|
ffi (1.9.25)
|
50
59
|
i18n (1.1.1)
|
51
60
|
concurrent-ruby (~> 1.0)
|
61
|
+
ice_nine (0.11.2)
|
52
62
|
mini_mime (1.0.1)
|
53
63
|
mini_portile2 (2.3.0)
|
54
64
|
nokogiri (1.8.5)
|
@@ -69,9 +79,15 @@ GEM
|
|
69
79
|
rubyzip (~> 1.2, >= 1.2.2)
|
70
80
|
spreadsheet (1.1.7)
|
71
81
|
ruby-ole (>= 1.0)
|
72
|
-
test-unit (3.2.
|
82
|
+
test-unit (3.2.9)
|
73
83
|
power_assert
|
84
|
+
thread_safe (0.3.6)
|
74
85
|
tomlrb (1.2.7)
|
86
|
+
virtus (1.0.5)
|
87
|
+
axiom-types (~> 0.1)
|
88
|
+
coercible (~> 1.0)
|
89
|
+
descendants_tracker (~> 0.0, >= 0.0.3)
|
90
|
+
equalizer (~> 0.0, >= 0.0.9)
|
75
91
|
webdrivers (3.4.3)
|
76
92
|
nokogiri (~> 1.6)
|
77
93
|
rubyzip (~> 1.0)
|
@@ -90,6 +106,7 @@ DEPENDENCIES
|
|
90
106
|
rake
|
91
107
|
redcarpet
|
92
108
|
testcentricity_web!
|
109
|
+
virtus
|
93
110
|
|
94
111
|
BUNDLED WITH
|
95
112
|
1.16.4
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
require 'json'
|
3
|
+
require 'virtus'
|
3
4
|
|
4
5
|
|
5
6
|
module TestCentricity
|
@@ -27,6 +28,53 @@ module TestCentricity
|
|
27
28
|
end
|
28
29
|
|
29
30
|
|
31
|
+
class DataPresenter
|
32
|
+
include Virtus.model
|
33
|
+
|
34
|
+
attr_accessor :current
|
35
|
+
attr_accessor :context
|
36
|
+
|
37
|
+
def initialize(data)
|
38
|
+
self.attributes = data
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.current
|
42
|
+
@current
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.current=(current)
|
46
|
+
@current = current
|
47
|
+
end
|
48
|
+
|
49
|
+
def to_hash(node_name)
|
50
|
+
data = {}
|
51
|
+
data[node_name] = {
|
52
|
+
class: self.class.name,
|
53
|
+
attributes: self.attributes
|
54
|
+
}
|
55
|
+
data
|
56
|
+
end
|
57
|
+
|
58
|
+
def to_yaml(node_name)
|
59
|
+
data = to_hash(node_name)
|
60
|
+
data.to_yaml
|
61
|
+
end
|
62
|
+
|
63
|
+
def write_yaml_data(file_name, mode, node_name)
|
64
|
+
File.open(file_name, mode) { |file| file.write(to_yaml(node_name)) }
|
65
|
+
end
|
66
|
+
|
67
|
+
def to_json(node_name)
|
68
|
+
data = to_hash(node_name)
|
69
|
+
data.to_json
|
70
|
+
end
|
71
|
+
|
72
|
+
def write_json_data(file_name, mode, node_name)
|
73
|
+
File.open(file_name, mode) { |file| file.write(to_json(node_name)) }
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
|
30
78
|
class DataSource
|
31
79
|
attr_accessor :file_path
|
32
80
|
attr_accessor :node
|
@@ -192,5 +192,39 @@ module TestCentricity
|
|
192
192
|
object_not_found_exception(obj, :audio)
|
193
193
|
obj.native.attribute('volume')
|
194
194
|
end
|
195
|
+
|
196
|
+
# Set the audio currentTime property
|
197
|
+
#
|
198
|
+
# @param value [Float] time in seconds
|
199
|
+
# @example
|
200
|
+
# audio_player.current_time = 1.5
|
201
|
+
#
|
202
|
+
def current_time=(value)
|
203
|
+
obj, = find_element(visible = :all)
|
204
|
+
object_not_found_exception(obj, nil)
|
205
|
+
page.execute_script('arguments[0].currentTime = arguments[1]', obj, value)
|
206
|
+
end
|
207
|
+
|
208
|
+
# Play the audio
|
209
|
+
#
|
210
|
+
# @example
|
211
|
+
# audio_player.play
|
212
|
+
#
|
213
|
+
def play
|
214
|
+
obj, = find_element(visible = :all)
|
215
|
+
object_not_found_exception(obj, nil)
|
216
|
+
page.execute_script('arguments[0].play()', obj)
|
217
|
+
end
|
218
|
+
|
219
|
+
# Pause the audio
|
220
|
+
#
|
221
|
+
# @example
|
222
|
+
# audio_player.pause
|
223
|
+
#
|
224
|
+
def pause
|
225
|
+
obj, = find_element(visible = :all)
|
226
|
+
object_not_found_exception(obj, nil)
|
227
|
+
page.execute_script('arguments[0].pause()', obj)
|
228
|
+
end
|
195
229
|
end
|
196
230
|
end
|
@@ -192,5 +192,39 @@ module TestCentricity
|
|
192
192
|
object_not_found_exception(obj, nil)
|
193
193
|
obj.native.attribute('volume')
|
194
194
|
end
|
195
|
+
|
196
|
+
# Set the video currentTime property
|
197
|
+
#
|
198
|
+
# @param value [Float] time in seconds
|
199
|
+
# @example
|
200
|
+
# video_player.current_time = 1.5
|
201
|
+
#
|
202
|
+
def current_time=(value)
|
203
|
+
obj, = find_element
|
204
|
+
object_not_found_exception(obj, nil)
|
205
|
+
page.execute_script('arguments[0].currentTime = arguments[1]', obj, value)
|
206
|
+
end
|
207
|
+
|
208
|
+
# Play the video
|
209
|
+
#
|
210
|
+
# @example
|
211
|
+
# video_player.play
|
212
|
+
#
|
213
|
+
def play
|
214
|
+
obj, = find_element
|
215
|
+
object_not_found_exception(obj, nil)
|
216
|
+
page.execute_script('arguments[0].play()', obj)
|
217
|
+
end
|
218
|
+
|
219
|
+
# Pause the video
|
220
|
+
#
|
221
|
+
# @example
|
222
|
+
# video_player.pause
|
223
|
+
#
|
224
|
+
def pause
|
225
|
+
obj, = find_element
|
226
|
+
object_not_found_exception(obj, nil)
|
227
|
+
page.execute_script('arguments[0].pause()', obj)
|
228
|
+
end
|
195
229
|
end
|
196
230
|
end
|
data/testcentricity_web.gemspec
CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
|
31
31
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
32
32
|
spec.add_development_dependency 'rake'
|
33
|
+
spec.add_development_dependency 'virtus'
|
33
34
|
|
34
35
|
spec.add_runtime_dependency 'appium_lib'
|
35
36
|
spec.add_runtime_dependency 'browserstack-local'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testcentricity_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- A.J. Mrozinski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: virtus
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: appium_lib
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|