calios-uikit-extension 0.0.7 → 0.0.8
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 +4 -4
- data/lib/calios-uikit-extension/ui_base.rb +22 -17
- data/lib/calios-uikit-extension/ui_button.rb +7 -4
- data/lib/calios-uikit-extension/ui_collection_view.rb +13 -6
- data/lib/calios-uikit-extension/ui_collection_view_cell.rb +6 -3
- data/lib/calios-uikit-extension/ui_keyboard_automatic.rb +3 -0
- data/lib/calios-uikit-extension/ui_label.rb +5 -2
- data/lib/calios-uikit-extension/ui_navigation_bar.rb +3 -0
- data/lib/calios-uikit-extension/ui_search_bar.rb +5 -2
- data/lib/calios-uikit-extension/ui_segmented_control.rb +7 -4
- data/lib/calios-uikit-extension/ui_switch.rb +5 -2
- data/lib/calios-uikit-extension/ui_table_view.rb +4 -1
- data/lib/calios-uikit-extension/ui_table_view_cell.rb +8 -5
- data/lib/calios-uikit-extension/ui_text_field.rb +5 -2
- data/lib/calios-uikit-extension/ui_view.rb +3 -0
- data/lib/calios-uikit-extension/version.rb +4 -1
- data/spec/spec_ui_base.rb +1 -1
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf2c6836c402524d47729114143f817a3f247eea
|
4
|
+
data.tar.gz: a9fe44c45fe6f7499e1e9ffe85a1ccc04868fe81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aad1a9df98572eced63f6aa0387cd90134015e2e488da4d2bd8a0e5380801c8022925fc01a5fa5b8610a18bf69d6c5a96e0eb8a0bca091b0468dc052a52cf6af
|
7
|
+
data.tar.gz: 9519d35c3e71ea7f62936feb47145f706004ea02de0fcb9e36e7f45fb7dbe18059bcd59970bbb24668de12e3a34e81c2c257f9495e023fb3daa74b833a7e3ea0
|
@@ -1,5 +1,10 @@
|
|
1
|
+
# rubocop:disable Metrics/LineLength
|
2
|
+
|
1
3
|
include Calabash::Cucumber::Core
|
2
4
|
|
5
|
+
#
|
6
|
+
# Base class for UIKit elements
|
7
|
+
#
|
3
8
|
class UIBase
|
4
9
|
class << self
|
5
10
|
def class_name
|
@@ -7,37 +12,37 @@ class UIBase
|
|
7
12
|
end
|
8
13
|
|
9
14
|
def property(*aParams)
|
10
|
-
Calabash::Cucumber::Core.query(
|
15
|
+
Calabash::Cucumber::Core.query(class_name, *aParams)
|
11
16
|
end
|
12
17
|
|
13
18
|
alias_method :prop, :property
|
14
19
|
alias_method :p, :property
|
15
20
|
|
16
|
-
def enabled?(aIdOrIndex=nil)
|
17
|
-
q =
|
21
|
+
def enabled?(aIdOrIndex = nil)
|
22
|
+
q = parse_query(aIdOrIndex)
|
18
23
|
Calabash::Cucumber::Core.query(q, :isEnabled).first.to_boolean
|
19
24
|
end
|
20
25
|
|
21
|
-
def touch(aIdOrIndex=nil)
|
22
|
-
q =
|
26
|
+
def touch(aIdOrIndex = nil)
|
27
|
+
q = parse_query(aIdOrIndex)
|
23
28
|
Calabash::Cucumber::Core.touch(q)
|
24
29
|
end
|
25
30
|
|
26
31
|
alias_method :tap, :touch
|
27
32
|
|
28
|
-
def double_tap(aIdOrIndex=nil)
|
29
|
-
q =
|
33
|
+
def double_tap(aIdOrIndex = nil)
|
34
|
+
q = parse_query(aIdOrIndex)
|
30
35
|
Calabash::Cucumber::Core.double_tap(q)
|
31
36
|
end
|
32
37
|
|
33
|
-
def query(aIdOrIndex=nil)
|
38
|
+
def query(aIdOrIndex = nil)
|
34
39
|
q = parse_query(aIdOrIndex)
|
35
40
|
Calabash::Cucumber::Core.query(q)
|
36
41
|
end
|
37
42
|
|
38
43
|
alias_method :q, :query
|
39
44
|
|
40
|
-
def flash(aIdOrIndex=nil)
|
45
|
+
def flash(aIdOrIndex = nil)
|
41
46
|
q = parse_query(aIdOrIndex)
|
42
47
|
Calabash::Cucumber::Core.flash(q)
|
43
48
|
end
|
@@ -45,13 +50,13 @@ class UIBase
|
|
45
50
|
alias_method :f, :flash
|
46
51
|
|
47
52
|
def accessibility_label
|
48
|
-
|
53
|
+
property(:accessibilityLabel)
|
49
54
|
end
|
50
55
|
|
51
56
|
alias_method :label, :accessibility_label
|
52
57
|
|
53
58
|
def accessibility_identifier
|
54
|
-
|
59
|
+
property(:accessibilityIdentifier)
|
55
60
|
end
|
56
61
|
|
57
62
|
alias_method :identifier, :accessibility_identifier
|
@@ -63,21 +68,21 @@ class UIBase
|
|
63
68
|
alias_method :h, :help
|
64
69
|
|
65
70
|
def parse_query(aIdOrIndex)
|
66
|
-
|
71
|
+
fail_if_invalid(aIdOrIndex)
|
67
72
|
|
68
73
|
if aIdOrIndex.nil?
|
69
|
-
|
74
|
+
q = "#{class_name}"
|
70
75
|
else
|
71
|
-
|
76
|
+
q = aIdOrIndex.is_a?(String) ? "#{class_name} marked:'#{aIdOrIndex}'" : "#{class_name} index:#{aIdOrIndex}"
|
72
77
|
end
|
73
78
|
|
74
|
-
|
79
|
+
q
|
75
80
|
end
|
76
81
|
|
77
82
|
private
|
78
83
|
|
79
|
-
def
|
80
|
-
|
84
|
+
def fail_if_invalid(aParam)
|
85
|
+
Kernel.fail('invalid parameter') unless aParam.nil? || aParam.is_a?(String) || aParam.is_a?(Integer)
|
81
86
|
end
|
82
87
|
end
|
83
88
|
end
|
@@ -1,14 +1,17 @@
|
|
1
1
|
require_relative 'ui_base'
|
2
2
|
|
3
|
+
#
|
4
|
+
# Provides methods for UIButton elements
|
5
|
+
#
|
3
6
|
class UIButton < UIBase
|
4
7
|
class << self
|
5
|
-
def text(aIdOrIndex=nil)
|
6
|
-
q =
|
8
|
+
def text(aIdOrIndex = nil)
|
9
|
+
q = parse_query(aIdOrIndex)
|
7
10
|
Calabash::Cucumber::Core.query(q, :currentTitle).first
|
8
11
|
end
|
9
12
|
|
10
|
-
def selected?(aIdOrIndex=nil)
|
11
|
-
q =
|
13
|
+
def selected?(aIdOrIndex = nil)
|
14
|
+
q = parse_query(aIdOrIndex)
|
12
15
|
Calabash::Cucumber::Core.query(q, :isSelected).first.to_boolean
|
13
16
|
end
|
14
17
|
end
|
@@ -1,21 +1,28 @@
|
|
1
|
+
# rubocop:disable Metrics/LineLength
|
2
|
+
# rubocop:disable Style/SpaceAfterColon
|
3
|
+
# rubocop:disable Style/BracesAroundHashParameters
|
4
|
+
|
1
5
|
require_relative 'ui_base'
|
2
6
|
|
7
|
+
#
|
8
|
+
# Provides methods for UICollectionView elements
|
9
|
+
#
|
3
10
|
class UICollectionView < UIBase
|
4
11
|
class << self
|
5
|
-
def number_of_items_in_section(aSection=0)
|
6
|
-
Calabash::Cucumber::Core.query("#{
|
12
|
+
def number_of_items_in_section(aSection = 0)
|
13
|
+
Calabash::Cucumber::Core.query("#{class_name}", numberOfItemsInSection:aSection).first
|
7
14
|
end
|
8
15
|
|
9
16
|
def scroll_to_item(aItem, aSection, aScrollPosition)
|
10
|
-
scroll_to_collection_view_item(aItem, aSection, {scroll_position: aScrollPosition})
|
17
|
+
scroll_to_collection_view_item(aItem, aSection, { scroll_position: aScrollPosition })
|
11
18
|
end
|
12
19
|
|
13
20
|
def scroll(aDirection)
|
14
|
-
Calabash::Cucumber::Core.scroll(
|
21
|
+
Calabash::Cucumber::Core.scroll(class_name, aDirection)
|
15
22
|
end
|
16
23
|
|
17
|
-
def empty?(aIdOrIndex=nil)
|
18
|
-
q =
|
24
|
+
def empty?(aIdOrIndex = nil)
|
25
|
+
q = parse_query(aIdOrIndex)
|
19
26
|
Calabash::Cucumber::Core.query(q).empty?
|
20
27
|
end
|
21
28
|
end
|
@@ -1,13 +1,16 @@
|
|
1
1
|
require_relative 'ui_base'
|
2
2
|
|
3
|
+
#
|
4
|
+
# Provides methods for UICollectionViewCell elements
|
5
|
+
#
|
3
6
|
class UICollectionViewCell < UIBase
|
4
7
|
class << self
|
5
8
|
def count
|
6
|
-
Calabash::Cucumber::Core.query("#{
|
9
|
+
Calabash::Cucumber::Core.query("#{class_name}").count
|
7
10
|
end
|
8
11
|
|
9
|
-
def selected?(aIdOrIndex=nil)
|
10
|
-
q =
|
12
|
+
def selected?(aIdOrIndex = nil)
|
13
|
+
q = parse_query(aIdOrIndex)
|
11
14
|
Calabash::Cucumber::Core.query(q, :isSelected).first.to_boolean
|
12
15
|
end
|
13
16
|
end
|
@@ -1,9 +1,12 @@
|
|
1
1
|
require_relative 'ui_base'
|
2
2
|
|
3
|
+
#
|
4
|
+
# Provides methods for UILabel elements
|
5
|
+
#
|
3
6
|
class UILabel < UIBase
|
4
7
|
class << self
|
5
|
-
def text(aIdOrIndex=nil)
|
6
|
-
q =
|
8
|
+
def text(aIdOrIndex = nil)
|
9
|
+
q = parse_query(aIdOrIndex)
|
7
10
|
Calabash::Cucumber::Core.query(q, :text).first
|
8
11
|
end
|
9
12
|
end
|
@@ -1,9 +1,12 @@
|
|
1
1
|
require_relative 'ui_base'
|
2
2
|
|
3
|
+
#
|
4
|
+
# Provides methods for UISearchBar elements
|
5
|
+
#
|
3
6
|
class UISearchBar < UIBase
|
4
7
|
class << self
|
5
|
-
def text(aIdOrIndex=nil)
|
6
|
-
q =
|
8
|
+
def text(aIdOrIndex = nil)
|
9
|
+
q = parse_query(aIdOrIndex)
|
7
10
|
Calabash::Cucumber::Core.query(q, :text).first
|
8
11
|
end
|
9
12
|
end
|
@@ -1,14 +1,17 @@
|
|
1
1
|
require_relative 'ui_base'
|
2
2
|
|
3
|
+
#
|
4
|
+
# Provides methods for UISegmentedControl elements
|
5
|
+
#
|
3
6
|
class UISegmentedControl < UIBase
|
4
7
|
class << self
|
5
|
-
def number_of_segments(aIdOrIndex=nil)
|
6
|
-
q =
|
8
|
+
def number_of_segments(aIdOrIndex = nil)
|
9
|
+
q = parse_query(aIdOrIndex)
|
7
10
|
Calabash::Cucumber::Core.query(q, :numberOfSegments).first
|
8
11
|
end
|
9
12
|
|
10
|
-
def selected_segment_index(aIdOrIndex=nil)
|
11
|
-
q =
|
13
|
+
def selected_segment_index(aIdOrIndex = nil)
|
14
|
+
q = parse_query(aIdOrIndex)
|
12
15
|
Calabash::Cucumber::Core.query(q, :selectedSegmentIndex).first
|
13
16
|
end
|
14
17
|
end
|
@@ -1,9 +1,12 @@
|
|
1
1
|
require_relative 'ui_base'
|
2
2
|
|
3
|
+
#
|
4
|
+
# Provides methods for UISwitch elements
|
5
|
+
#
|
3
6
|
class UISwitch < UIBase
|
4
7
|
class << self
|
5
|
-
def on?(aIdOrIndex=nil)
|
6
|
-
q =
|
8
|
+
def on?(aIdOrIndex = nil)
|
9
|
+
q = parse_query(aIdOrIndex)
|
7
10
|
Calabash::Cucumber::Core.query(q, :isOn).first.to_boolean
|
8
11
|
end
|
9
12
|
end
|
@@ -1,9 +1,12 @@
|
|
1
1
|
require_relative 'ui_base'
|
2
2
|
|
3
|
+
#
|
4
|
+
# Provides methods for UITableView elements
|
5
|
+
#
|
3
6
|
class UITableView < UIBase
|
4
7
|
class << self
|
5
8
|
def scroll(aDirection)
|
6
|
-
Calabash::Cucumber::Core.scroll(
|
9
|
+
Calabash::Cucumber::Core.scroll(class_name, aDirection)
|
7
10
|
end
|
8
11
|
end
|
9
12
|
end
|
@@ -1,18 +1,21 @@
|
|
1
1
|
require_relative 'ui_base'
|
2
2
|
|
3
|
+
#
|
4
|
+
# Provides methods for UITableViewCell elements
|
5
|
+
#
|
3
6
|
class UITableViewCell < UIBase
|
4
7
|
class << self
|
5
8
|
def count
|
6
|
-
Calabash::Cucumber::Core.query("#{
|
9
|
+
Calabash::Cucumber::Core.query("#{class_name}").count
|
7
10
|
end
|
8
11
|
|
9
|
-
def text(aIdOrIndex=nil)
|
10
|
-
q =
|
12
|
+
def text(aIdOrIndex = nil)
|
13
|
+
q = parse_query(aIdOrIndex)
|
11
14
|
Calabash::Cucumber::Core.query(q, :text).first
|
12
15
|
end
|
13
16
|
|
14
|
-
def selected?(aIdOrIndex=nil)
|
15
|
-
q =
|
17
|
+
def selected?(aIdOrIndex = nil)
|
18
|
+
q = parse_query(aIdOrIndex)
|
16
19
|
Calabash::Cucumber::Core.query(q, :isSelected).first.to_boolean
|
17
20
|
end
|
18
21
|
end
|
@@ -1,9 +1,12 @@
|
|
1
1
|
require_relative 'ui_base'
|
2
2
|
|
3
|
+
#
|
4
|
+
# Provides methods for UITextField elements
|
5
|
+
#
|
3
6
|
class UITextField < UIBase
|
4
7
|
class << self
|
5
|
-
def text(aIdOrIndex=nil)
|
6
|
-
q =
|
8
|
+
def text(aIdOrIndex = nil)
|
9
|
+
q = parse_query(aIdOrIndex)
|
7
10
|
Calabash::Cucumber::Core.query(q, :text).first
|
8
11
|
end
|
9
12
|
end
|
data/spec/spec_ui_base.rb
CHANGED
@@ -114,7 +114,7 @@ class SpecUIBase < Minitest::Spec
|
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
117
|
-
describe 'UIBase.
|
117
|
+
describe 'UIBase.fail_if_invalid' do
|
118
118
|
it 'should raise' do
|
119
119
|
proc { UIButton.text(:symbol) }.must_raise(RuntimeError)
|
120
120
|
proc { UIButton.touch(:symbol) }.must_raise(RuntimeError)
|
metadata
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calios-uikit-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jani Jegoroff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: calabash-cucumber
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.9'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 0.9.169
|
@@ -21,6 +24,9 @@ dependencies:
|
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.9'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 0.9.169
|
@@ -80,6 +86,20 @@ dependencies:
|
|
80
86
|
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
88
|
version: '1.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rubocop
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0.26'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0.26'
|
83
103
|
description: Calabash-ios UIKit extension provides convenient metaclasses for Calabash
|
84
104
|
usage.
|
85
105
|
email:
|