AXElements 6.0.0 → 7.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/CONTRIBUTING.markdown +50 -0
- data/History.markdown +7 -0
- data/lib/accessibility/pretty_printer.rb +1 -1
- data/lib/accessibility/qualifier.rb +11 -15
- data/lib/accessibility/version.rb +1 -1
- data/lib/ax/element.rb +2 -2
- data/lib/ax_elements/mri.rb +40 -82
- data/lib/ax_elements/nsarray_compat.rb +4 -95
- data/lib/ax_elements.rb +2 -3
- data/rakelib/test.rake +1 -2
- data/test/helper.rb +9 -10
- data/test/integration/accessibility/test_dsl.rb +1 -1
- data/test/integration/accessibility/test_enumerators.rb +2 -3
- data/test/integration/accessibility/test_errors.rb +1 -1
- data/test/integration/accessibility/test_graph.rb +1 -1
- data/test/integration/accessibility/test_qualifier.rb +1 -1
- data/test/integration/ax/test_application.rb +1 -1
- data/test/integration/ax/test_element.rb +1 -1
- data/test/integration/ax/test_menu.rb +1 -1
- data/test/integration/ax/test_row.rb +1 -1
- data/test/integration/ax/test_text_area.rb +2 -1
- data/test/integration/ax/test_text_field.rb +1 -1
- data/test/integration/ax_elements/test_nsarray_compat.rb +2 -2
- data/test/sanity/accessibility/test_dsl.rb +1 -2
- data/test/sanity/accessibility/test_errors.rb +1 -1
- data/test/sanity/accessibility/test_factory.rb +1 -1
- data/test/sanity/accessibility/test_pretty_printer.rb +4 -2
- data/test/sanity/accessibility/test_qualifier.rb +4 -4
- data/test/sanity/accessibility/test_system_info.rb +2 -2
- data/test/sanity/accessibility/test_translator.rb +1 -2
- data/test/sanity/accessibility/test_version.rb +2 -2
- data/test/sanity/ax/test_application.rb +1 -1
- data/test/sanity/ax/test_element.rb +2 -2
- data/test/sanity/ax/test_systemwide.rb +1 -9
- data/test/sanity/test_accessibility.rb +1 -1
- data/test/sanity/test_ax_elements.rb +1 -1
- metadata +27 -33
- data/lib/ax_elements/active_support_selections.rb +0 -10
- data/lib/ax_elements/exception_workaround.rb +0 -13
- data/rakelib/ext.rake +0 -5
- data/test/sanity/ax_elements/test_nsarray_compat.rb +0 -16
- data/test/sanity/ax_elements/test_nsobject_inspect.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cac00d5fffb00f71196afdf2c5c8d5bd91cd3629
|
4
|
+
data.tar.gz: 56cc780809e29681480cb25cd290f0121e43feb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95978dc7c0473cffa4e4cec6b3be81330ad990a2d2ee738bb358d39f8bafb4a227641bb274e3339f77afd8db2f5c858bf34431448b4c13126162f3c053f56d79
|
7
|
+
data.tar.gz: b9f0da398636d963455037211af2f0be3f105fb2c1bf090fe10146356a0a35421d091c8dbf6b2bfb5c13f0b843509693ccd8cb1dfbefb52d43529863a127cf66
|
data/.yardopts
CHANGED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Contributing to AXElements
|
2
|
+
|
3
|
+
First, let me thank you for wanting to contribute! :)
|
4
|
+
|
5
|
+
There are no contributions that are too small. Even if you are only fixing
|
6
|
+
typos, adding documentation, or some example code. The goal is to make the
|
7
|
+
process simple and as painless as possible to encourage contributions.
|
8
|
+
|
9
|
+
The best way to submit contributions is through a
|
10
|
+
[pull request](https://help.github.com/articles/using-pull-requests) on the
|
11
|
+
[Github page](https://github.com/AXElements/AXElements), though email is
|
12
|
+
also acceptable if privacy is a concern or Github is too much of hassle.
|
13
|
+
Emails can be sent to [AXElements](mailto://axelements.rb@gmail.com).
|
14
|
+
|
15
|
+
Unless otherwise requested, commit history will always be made to reflect
|
16
|
+
who made the contribution.
|
17
|
+
|
18
|
+
|
19
|
+
## Reporting Bugs
|
20
|
+
|
21
|
+
If you think you've found a bug, feel free to log the issue. It is OK to
|
22
|
+
make a duplicate bug report; such reports will be closed as duplicates
|
23
|
+
with a pointer to the original issue. Bugs may also be reported through
|
24
|
+
email.
|
25
|
+
|
26
|
+
You may also wish to see if the bug you've reported has already been
|
27
|
+
fixed or obsoleted on the master branch. Instructions on installing
|
28
|
+
AXElements from source are in the {file:README.markdown}.
|
29
|
+
|
30
|
+
|
31
|
+
## Code
|
32
|
+
|
33
|
+
Try to stick within the existing style. The importance of sticking with
|
34
|
+
existing style grows linearly with the size of the contribution.
|
35
|
+
|
36
|
+
It is preferred that code contributions, whether they are new features or
|
37
|
+
bug fixes, be accompanied by test(s) showing that the relevant code works.
|
38
|
+
As with coding style, the importance of tests depends on the size of the
|
39
|
+
changes you wish to submit.
|
40
|
+
|
41
|
+
|
42
|
+
## Documentation and Examples
|
43
|
+
|
44
|
+
As with code, try to fit with the existing style. New examples are always
|
45
|
+
welcome and the wiki could always use a new article. :)
|
46
|
+
|
47
|
+
The documentation in the wiki is open and no permission is required to make
|
48
|
+
edits or contributions. For API documentation or example code, it is best to
|
49
|
+
submit a pull request (or create a new wiki page if appropriate).
|
50
|
+
|
data/History.markdown
CHANGED
@@ -105,7 +105,7 @@ class Accessibility::Qualifier
|
|
105
105
|
# @param element [AX::Element]
|
106
106
|
def meets_criteria? element
|
107
107
|
@filters.all? do |filter|
|
108
|
-
self.send
|
108
|
+
self.send(*filter, element)
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
@@ -114,27 +114,23 @@ class Accessibility::Qualifier
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def match attr, regexp, element
|
117
|
-
|
118
|
-
|
119
|
-
end
|
117
|
+
return unless element.attributes.include? attr
|
118
|
+
element.attribute(attr).to_s.match regexp
|
120
119
|
end
|
121
120
|
|
122
121
|
def equality attr, value, element
|
123
|
-
|
124
|
-
|
125
|
-
end
|
122
|
+
return unless element.attributes.include? attr
|
123
|
+
element.attribute(attr) == value
|
126
124
|
end
|
127
125
|
|
128
126
|
def parameterized_match attr, param, regexp, element
|
129
|
-
|
130
|
-
|
131
|
-
end
|
127
|
+
return unless element.parameterized_attributes.include? attr
|
128
|
+
element.parameterized_attribute(attr, param).to_s.match regexp
|
132
129
|
end
|
133
130
|
|
134
131
|
def parameterized_equality attr, param, value, element
|
135
|
-
|
136
|
-
|
137
|
-
end
|
132
|
+
return unless element.parameterized_attributes.include? attr
|
133
|
+
element.parameterized_attribute(attr, param) == value
|
138
134
|
end
|
139
135
|
|
140
136
|
def block_check element
|
@@ -145,8 +141,8 @@ end
|
|
145
141
|
|
146
142
|
|
147
143
|
##
|
148
|
-
# AXElements extensions to
|
149
|
-
class
|
144
|
+
# AXElements extensions to {Hash}.
|
145
|
+
class Hash
|
150
146
|
##
|
151
147
|
# Format the hash for AXElements pretty printing.
|
152
148
|
#
|
data/lib/ax/element.rb
CHANGED
@@ -351,7 +351,7 @@ class AX::Element
|
|
351
351
|
# window.application # => SearchFailure is raised
|
352
352
|
#
|
353
353
|
def method_missing method, *args, &block
|
354
|
-
return set(method.chomp(EQUALS), args.first) if method[-1] == EQUALS
|
354
|
+
return set(method.to_s.chomp(EQUALS), args.first) if method[-1] == EQUALS
|
355
355
|
|
356
356
|
key = TRANSLATOR.cocoaify method
|
357
357
|
if @ref.attributes.include? key
|
@@ -429,7 +429,7 @@ class AX::Element
|
|
429
429
|
#
|
430
430
|
# This does not work for predicate methods at the moment.
|
431
431
|
def respond_to? name
|
432
|
-
key = TRANSLATOR.cocoaify name.chomp(EQUALS)
|
432
|
+
key = TRANSLATOR.cocoaify name.to_s.chomp(EQUALS)
|
433
433
|
@ref.attributes.include?(key) ||
|
434
434
|
@ref.parameterized_attributes.include?(key) ||
|
435
435
|
super
|
data/lib/ax_elements/mri.rb
CHANGED
@@ -1,85 +1,43 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
# @return [String]
|
42
|
-
KAXStringForRangeParameterizedAttribute = 'AXStringForRange'
|
43
|
-
|
44
|
-
unless defined? NSString
|
45
|
-
# Alias for the `String` class, compatible with MacRuby
|
46
|
-
# @return [Class]
|
47
|
-
NSString = String
|
48
|
-
end
|
49
|
-
|
50
|
-
unless defined? NSDictionary
|
51
|
-
# Alias for the `Hash` class, compatible with MacRuby
|
52
|
-
# @return [Class]
|
53
|
-
NSDictionary = Hash
|
54
|
-
end
|
55
|
-
|
56
|
-
unless defined? NSArray
|
57
|
-
# Alias for the `Array` class, compatible with MacRuby
|
58
|
-
# @return [Class]
|
59
|
-
NSArray = Array
|
60
|
-
end
|
61
|
-
|
62
|
-
unless defined? NSDate
|
63
|
-
# Alias for the `Time` class, compatible with MacRuby
|
64
|
-
# @return [Class]
|
65
|
-
NSDate = Time
|
66
|
-
end
|
67
|
-
|
68
|
-
##
|
69
|
-
# AXElements extensions to the Symbol class
|
70
|
-
class Symbol
|
71
|
-
|
72
|
-
##
|
73
|
-
# Equivalent to `String#chomp`, coerces receiver to string first
|
74
|
-
#
|
75
|
-
# @return [String]
|
76
|
-
def chomp suffix
|
77
|
-
to_s.chomp suffix
|
78
|
-
end
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
1
|
+
# @return [String]
|
2
|
+
KAXChildrenAttribute = 'AXChildren'
|
3
|
+
# @return [String]
|
4
|
+
KAXRoleAttribute = 'AXRole'
|
5
|
+
# @return [String]
|
6
|
+
KAXSubroleAttribute = 'AXSubrole'
|
7
|
+
# @return [String]
|
8
|
+
KAXIdentifierAttribute = 'AXIdentifier'
|
9
|
+
# @return [String]
|
10
|
+
KAXWindowCreatedNotification = 'AXWindowCreated'
|
11
|
+
# @return [String]
|
12
|
+
KAXMainWindowAttribute = 'AXMainWindow'
|
13
|
+
# @return [String]
|
14
|
+
KAXFocusedAttribute = 'AXFocused'
|
15
|
+
# @return [String]
|
16
|
+
KAXValueChangedNotification = 'AXValueChanged'
|
17
|
+
# @return [String]
|
18
|
+
KAXTitleAttribute = 'AXTitle'
|
19
|
+
# @return [String]
|
20
|
+
KAXURLAttribute = 'AXURL'
|
21
|
+
# @return [String]
|
22
|
+
KAXTitleUIElementAttribute = 'AXTitleUIElement'
|
23
|
+
# @return [String]
|
24
|
+
KAXPlaceholderValueAttribute = 'AXPlaceholderValue'
|
25
|
+
# @return [String]
|
26
|
+
KAXWindowRole = 'AXWindow'
|
27
|
+
# @return [String]
|
28
|
+
KAXCloseButtonSubrole = 'AXCloseButton'
|
29
|
+
# @return [String]
|
30
|
+
KAXTrashDockItemSubrole = 'AXTrashDockItem'
|
31
|
+
# @return [String]
|
32
|
+
KAXPosition = 'AXPosition'
|
33
|
+
# @return [String]
|
34
|
+
KAXSize = 'AXSize'
|
35
|
+
# @return [String]
|
36
|
+
KAXRTFForRangeParameterizedAttribute = 'AXRTFForRange'
|
37
|
+
# @return [String]
|
38
|
+
KAXIsApplicationRunningAttribute = 'AXIsApplicationRunning'
|
39
|
+
# @return [String]
|
40
|
+
KAXStringForRangeParameterizedAttribute = 'AXStringForRange'
|
83
41
|
|
84
42
|
unless defined? KAXIdentifierAttribute
|
85
43
|
##
|
@@ -10,7 +10,7 @@ require 'active_support/core_ext/array/access'
|
|
10
10
|
# I've always been on the fence as to whether this was a good idea or
|
11
11
|
# not, but at this point there is too much code written that depends
|
12
12
|
# on this and so I will just keep it around for backwards compatability.
|
13
|
-
module Accessibility::
|
13
|
+
module Accessibility::ArrayCompatibility
|
14
14
|
|
15
15
|
##
|
16
16
|
# @note Debatably bad idea. Maintained for backwards compatibility.
|
@@ -47,99 +47,8 @@ module Accessibility::NSArrayCompat
|
|
47
47
|
|
48
48
|
end
|
49
49
|
|
50
|
-
unless defined? NSArray
|
51
|
-
NSArray = Array
|
52
|
-
end
|
53
|
-
|
54
50
|
##
|
55
|
-
# AXElements extensions for `
|
56
|
-
class
|
57
|
-
include Accessibility::
|
58
|
-
|
59
|
-
if on_macruby?
|
60
|
-
|
61
|
-
##
|
62
|
-
# Returns the tail of the array from `position`
|
63
|
-
#
|
64
|
-
# @example
|
65
|
-
#
|
66
|
-
# [1, 2, 3, 4].from(0) # => [1, 2, 3, 4]
|
67
|
-
# [1, 2, 3, 4].from(2) # => [3, 4]
|
68
|
-
# [1, 2, 3, 4].from(10) # => []
|
69
|
-
# [].from(0) # => []
|
70
|
-
#
|
71
|
-
# @param position [Fixnum]
|
72
|
-
# @return [Array]
|
73
|
-
def from position
|
74
|
-
self[position, length] || []
|
75
|
-
end
|
76
|
-
|
77
|
-
##
|
78
|
-
# Returns the beginning of the array up to `position`
|
79
|
-
#
|
80
|
-
# [1, 2, 3, 4].to(0) # => [1]
|
81
|
-
# [1, 2, 3, 4].to(2) # => [1, 2, 3]
|
82
|
-
# [1, 2, 3, 4].to(10) # => [1, 2, 3, 4]
|
83
|
-
# [].to(0) # => []
|
84
|
-
#
|
85
|
-
# @param count [Fixnum]
|
86
|
-
# @return [Array]
|
87
|
-
def to count
|
88
|
-
take count + 1
|
89
|
-
end
|
90
|
-
|
91
|
-
##
|
92
|
-
# Equal to `self[1]`
|
93
|
-
def second
|
94
|
-
self[1]
|
95
|
-
end
|
96
|
-
|
97
|
-
##
|
98
|
-
# Equal to `self[2]`
|
99
|
-
def third
|
100
|
-
self[2]
|
101
|
-
end
|
102
|
-
|
103
|
-
##
|
104
|
-
# Equal to `self[3]`
|
105
|
-
def fourth
|
106
|
-
self[3]
|
107
|
-
end
|
108
|
-
|
109
|
-
##
|
110
|
-
# Equal to `self[4]`
|
111
|
-
def fifth
|
112
|
-
self[4]
|
113
|
-
end
|
114
|
-
|
115
|
-
##
|
116
|
-
# Equal to `self[41]`
|
117
|
-
#
|
118
|
-
# Also known as accessing "the reddit".
|
119
|
-
def forty_two
|
120
|
-
self[41]
|
121
|
-
end
|
122
|
-
|
123
|
-
else
|
124
|
-
|
125
|
-
##
|
126
|
-
# Create a new array with the same contents as the given array
|
127
|
-
#
|
128
|
-
# @param ary [Array]
|
129
|
-
def self.arrayWithArray ary
|
130
|
-
ary.dup
|
131
|
-
end
|
132
|
-
|
133
|
-
##
|
134
|
-
# Create and return a new empty array
|
135
|
-
#
|
136
|
-
# @return [Array]
|
137
|
-
def self.array
|
138
|
-
[]
|
139
|
-
end
|
140
|
-
|
141
|
-
end
|
142
|
-
|
143
|
-
alias_method :the_reddit, :forty_two
|
144
|
-
|
51
|
+
# AXElements extensions for `Array`
|
52
|
+
class Array
|
53
|
+
include Accessibility::ArrayCompatibility
|
145
54
|
end
|
data/lib/ax_elements.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require '
|
1
|
+
require 'active_support/core_ext'
|
2
2
|
require 'accessibility/bridge'
|
3
|
-
require 'ax_elements/mri'
|
3
|
+
require 'ax_elements/mri'
|
4
4
|
|
5
5
|
# Mix the language methods into the TopLevel
|
6
6
|
require 'accessibility/dsl'
|
@@ -25,4 +25,3 @@ require 'ax/pop_up_button'
|
|
25
25
|
|
26
26
|
# Misc things that we need to load
|
27
27
|
require 'ax_elements/nsarray_compat'
|
28
|
-
# require 'ax_elements/exception_workaround' # disable for now
|
data/rakelib/test.rake
CHANGED
data/test/helper.rb
CHANGED
@@ -1,23 +1,22 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require 'simplecov'
|
2
|
+
require 'simplecov'
|
3
3
|
|
4
4
|
require 'test/fixture_app' # must be loaded before minitest
|
5
|
+
|
6
|
+
gem 'minitest', '> 5.0'
|
7
|
+
|
5
8
|
require 'minitest/autorun'
|
9
|
+
require 'minitest/pride'
|
10
|
+
require 'minitest/gcstats'
|
11
|
+
require 'minitest/benchmark' if ENV['BENCH']
|
6
12
|
|
7
|
-
|
8
|
-
if ENV['BENCH']
|
9
|
-
require 'minitest/benchmark'
|
10
|
-
else
|
11
|
-
require'minitest/pride'
|
13
|
+
class Minitest::Test
|
12
14
|
end
|
13
15
|
|
14
|
-
class
|
15
|
-
|
16
|
+
class Minitest::Benchmark
|
16
17
|
def self.bench_range
|
17
18
|
bench_exp 100, 100_000
|
18
19
|
end
|
19
|
-
|
20
20
|
end
|
21
21
|
|
22
22
|
$LOAD_PATH << File.expand_path('../../lib', __FILE__)
|
23
|
-
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test/integration/helper'
|
2
2
|
|
3
|
-
class TestAccessibilityEnumeratorsBreadthFirst <
|
3
|
+
class TestAccessibilityEnumeratorsBreadthFirst < Minitest::Test
|
4
4
|
|
5
5
|
def test_each_iterates_in_correct_order
|
6
6
|
tab_group = app.main_window.children.find { |x| x.class == AX::TabGroup }
|
@@ -47,8 +47,7 @@ class TestAccessibilityEnumeratorsBreadthFirst < MiniTest::Unit::TestCase
|
|
47
47
|
|
48
48
|
end
|
49
49
|
|
50
|
-
|
51
|
-
class TestAccessibilityEnumeratorsDepthFirst < MiniTest::Unit::TestCase
|
50
|
+
class TestAccessibilityEnumeratorsDepthFirst < Minitest::Test
|
52
51
|
|
53
52
|
def app
|
54
53
|
@@app ||= AX::Application.new REF
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require 'test/integration/helper'
|
3
3
|
|
4
|
-
class TestAccessibilityErrors <
|
4
|
+
class TestAccessibilityErrors < Minitest::Test
|
5
5
|
|
6
6
|
def test_search_failure_shows_arguments
|
7
7
|
e = Accessibility::SearchFailure.new(app, :list, {herp: :derp}) { }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require 'test/integration/helper'
|
3
3
|
|
4
|
-
class TestAccessibilityQualifier <
|
4
|
+
class TestAccessibilityQualifier < Minitest::Test
|
5
5
|
|
6
6
|
def qualifier klass, criteria, &block
|
7
7
|
Accessibility::Qualifier.new(klass, criteria, &block)
|
@@ -1,12 +1,13 @@
|
|
1
1
|
require 'test/integration/helper'
|
2
2
|
|
3
|
-
class TestAXTextArea <
|
3
|
+
class TestAXTextArea < Minitest::Test
|
4
4
|
|
5
5
|
def text_area
|
6
6
|
@area ||= app.main_window.text_area
|
7
7
|
end
|
8
8
|
|
9
9
|
def text
|
10
|
+
# @todo replace with faker?
|
10
11
|
<<-EOS
|
11
12
|
Lorem ipsum dolor sit amet, dignissim at eget. Porttitor ut, montes eget, sed ante nec faucibus erat id, fermentum sed eu inceptos turpis, rutrum vitae lectus est augue. Leo leo pede eu sem. Ornare ridiculus bibendum elit amet integer elit, leo porttitor vestibulum vestibulum, ut dignissim faucibus laoreet sodales nullam tellus, lacus pellentesque laoreet consectetur viverra ut. Turpis risus vestibulum purus. Integer convallis, in eros conubia, augue metus ut, hac litora elit lorem. Enim feugiat sem vel, ut integer, fermentum in wisi, pharetra pharetra posuere. Torquent vehicula hendrerit donec, scelerisque tincidunt adipiscing orci non fames luctus, per pellentesque lectus felis sed massa elit, praesent lectus diam est vitae congue et. Neque justo vitae suspendisse in. Et morbi, primis a.
|
12
13
|
EOS
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test/integration/helper'
|
2
2
|
|
3
|
-
class TestNSArrayCompat <
|
3
|
+
class TestNSArrayCompat < Minitest::Test
|
4
4
|
|
5
5
|
def test_raises_for_non_elements
|
6
6
|
assert_raises NoMethodError do
|
@@ -8,7 +8,7 @@ class TestNSArrayCompat < MiniTest::Unit::TestCase
|
|
8
8
|
end
|
9
9
|
|
10
10
|
assert_raises NoMethodError do
|
11
|
-
[app,1].titles
|
11
|
+
[app, 1].titles
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'test/helper'
|
2
2
|
require 'accessibility/errors'
|
3
3
|
|
4
|
-
class TestAccessibilityErrors <
|
4
|
+
class TestAccessibilityErrors < Minitest::Test
|
5
5
|
|
6
6
|
def test_search_failure_is_kind_of_no_method_error
|
7
7
|
assert_includes Accessibility::SearchFailure.ancestors, NoMethodError
|
@@ -2,7 +2,7 @@ require 'test/helper'
|
|
2
2
|
require 'accessibility/factory'
|
3
3
|
require 'ax/application'
|
4
4
|
|
5
|
-
class TestAccessibilityElementFactory <
|
5
|
+
class TestAccessibilityElementFactory < Minitest::Test
|
6
6
|
|
7
7
|
def window
|
8
8
|
@@window ||= REF.to_ruby.children.find { |x| x.role == KAXWindowRole }
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
+
require 'test/helper'
|
3
|
+
require 'accessibility/pretty_printer'
|
2
4
|
|
3
|
-
class TestAccessibilityPrettyPrinter <
|
5
|
+
class TestAccessibilityPrettyPrinter < Minitest::Test
|
4
6
|
include Accessibility::PrettyPrinter
|
5
7
|
|
6
8
|
# expected API for PrettyPrinter module
|
@@ -61,7 +63,7 @@ class TestAccessibilityPrettyPrinter < MiniTest::Unit::TestCase
|
|
61
63
|
end
|
62
64
|
|
63
65
|
def test_identifier_empty_string_as_final_fallback
|
64
|
-
@attributes =
|
66
|
+
@attributes = []
|
65
67
|
assert_equal EMPTY_STRING, pp_identifier.to_s
|
66
68
|
end
|
67
69
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'test/helper'
|
2
2
|
require 'accessibility/qualifier'
|
3
3
|
|
4
|
-
class TestNSDictionaryExtensions <
|
4
|
+
class TestNSDictionaryExtensions < Minitest::Test
|
5
5
|
|
6
6
|
def test_ax_pp
|
7
7
|
assert_equal '', {}.ax_pp
|
8
|
-
assert_equal '(title: "Hey, listen!")', {title: 'Hey, listen!'}.ax_pp
|
9
|
-
assert_equal '(a: 42, b: [3.14])', {a: 42, b: [3.14]}.ax_pp
|
10
|
-
assert_equal '(c(d: ":("))', {c: {d:':('} }.ax_pp
|
8
|
+
assert_equal '(title: "Hey, listen!")', { title: 'Hey, listen!' }.ax_pp
|
9
|
+
assert_equal '(a: 42, b: [3.14])', { a: 42, b: [3.14] }.ax_pp
|
10
|
+
assert_equal '(c(d: ":("))', { c: { d: ':(' } }.ax_pp
|
11
11
|
end
|
12
12
|
|
13
13
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'test/helper'
|
2
2
|
require 'accessibility/system_info'
|
3
3
|
|
4
|
-
class TestAcessibilitySystemInfo <
|
4
|
+
class TestAcessibilitySystemInfo < Minitest::Test
|
5
5
|
|
6
6
|
def test_name
|
7
7
|
name = Accessibility::SystemInfo.name
|
@@ -58,7 +58,7 @@ class TestAcessibilitySystemInfo < MiniTest::Unit::TestCase
|
|
58
58
|
version = Accessibility::SystemInfo.osx_version
|
59
59
|
assert_kind_of String, version
|
60
60
|
refute_empty version
|
61
|
-
assert_match /^Version 10\.\d
|
61
|
+
assert_match /^Version 10\.\d+(\.\d*)? \(Build [\dA-Za-z]+\)$/, version
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_uptime
|
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'test/helper'
|
2
2
|
require 'accessibility/version'
|
3
3
|
|
4
|
-
class TestAccessibilityVersion <
|
4
|
+
class TestAccessibilityVersion < Minitest::Test
|
5
5
|
|
6
6
|
def test_version_is_ascii_only # RubyGems :(
|
7
7
|
assert_equal Accessibility::VERSION.encode(Encoding::ASCII), Accessibility::VERSION
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_version_method
|
11
|
-
assert_match Accessibility::VERSION,
|
11
|
+
assert_match Accessibility::VERSION, Accessibility.version
|
12
12
|
assert_match Accessibility::CODE_NAME, Accessibility.version
|
13
13
|
end
|
14
14
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'test/helper'
|
2
2
|
require 'ax/element'
|
3
3
|
|
4
|
-
class TestAXElement <
|
4
|
+
class TestAXElement < Minitest::Test
|
5
5
|
|
6
6
|
def element
|
7
7
|
@element ||= AX::Element.new REF
|
@@ -67,7 +67,7 @@ class TestAXElement < MiniTest::Unit::TestCase
|
|
67
67
|
end
|
68
68
|
|
69
69
|
|
70
|
-
class TestSearchResultBlankness <
|
70
|
+
class TestSearchResultBlankness < Minitest::Test
|
71
71
|
|
72
72
|
def test_array_blank
|
73
73
|
[
|
@@ -5,7 +5,7 @@ class AX::Element
|
|
5
5
|
attr_reader :ref
|
6
6
|
end
|
7
7
|
|
8
|
-
class TestAXSystemWide <
|
8
|
+
class TestAXSystemWide < Minitest::Test
|
9
9
|
|
10
10
|
def system_wide
|
11
11
|
@system_wide ||= AX::SystemWide.new
|
@@ -16,14 +16,6 @@ class TestAXSystemWide < MiniTest::Unit::TestCase
|
|
16
16
|
assert_equal AX::SystemWide.new, AX::SystemWide.new
|
17
17
|
end
|
18
18
|
|
19
|
-
def test_type_forwards_events
|
20
|
-
ref = system_wide.ref
|
21
|
-
called_back = false
|
22
|
-
ref.define_singleton_method(:post) { |x| called_back = true if x.kind_of? Array }
|
23
|
-
assert system_wide.type 'test'
|
24
|
-
assert called_back
|
25
|
-
end
|
26
|
-
|
27
19
|
def test_search_not_allowed
|
28
20
|
assert_raises(NoMethodError) { system_wide.search }
|
29
21
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'test/helper'
|
2
2
|
require 'accessibility'
|
3
3
|
|
4
|
-
class TestAccessibilityDebug <
|
4
|
+
class TestAccessibilityDebug < Minitest::Test
|
5
5
|
def test_debug_setting
|
6
6
|
assert_respond_to Accessibility, :debug?
|
7
7
|
assert_respond_to Accessibility, :debug=
|
metadata
CHANGED
@@ -1,85 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: AXElements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mouse
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.0.0
|
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: 2.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: screen_recorder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.1.5
|
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: 0.1.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: accessibility_core
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 0.4.1
|
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.4.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: accessibility_keyboard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.0.0
|
62
62
|
type: :runtime
|
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: 1.0.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activesupport
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 4.
|
75
|
+
version: 4.1.6
|
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: 4.
|
82
|
+
version: 4.1.6
|
83
83
|
description: |
|
84
84
|
AXElements is a UI automation library built on top of various OS X
|
85
85
|
frameworks. You can use AXElements to write functional tests for
|
@@ -90,6 +90,13 @@ executables: []
|
|
90
90
|
extensions: []
|
91
91
|
extra_rdoc_files: []
|
92
92
|
files:
|
93
|
+
- ".yardopts"
|
94
|
+
- CONTRIBUTING.markdown
|
95
|
+
- History.markdown
|
96
|
+
- README.markdown
|
97
|
+
- Rakefile
|
98
|
+
- lib/AXElements.rb
|
99
|
+
- lib/accessibility.rb
|
93
100
|
- lib/accessibility/dsl.rb
|
94
101
|
- lib/accessibility/enumerators.rb
|
95
102
|
- lib/accessibility/errors.rb
|
@@ -101,7 +108,6 @@ files:
|
|
101
108
|
- lib/accessibility/text_highlighter.rb
|
102
109
|
- lib/accessibility/translator.rb
|
103
110
|
- lib/accessibility/version.rb
|
104
|
-
- lib/accessibility.rb
|
105
111
|
- lib/ax/application.rb
|
106
112
|
- lib/ax/button.rb
|
107
113
|
- lib/ax/element.rb
|
@@ -114,22 +120,15 @@ files:
|
|
114
120
|
- lib/ax/systemwide.rb
|
115
121
|
- lib/ax/text_area.rb
|
116
122
|
- lib/ax/text_field.rb
|
117
|
-
- lib/ax_elements
|
123
|
+
- lib/ax_elements.rb
|
118
124
|
- lib/ax_elements/awesome_print.rb
|
119
|
-
- lib/ax_elements/exception_workaround.rb
|
120
125
|
- lib/ax_elements/mri.rb
|
121
126
|
- lib/ax_elements/nsarray_compat.rb
|
122
|
-
- lib/ax_elements.rb
|
123
|
-
- lib/AXElements.rb
|
124
127
|
- rakelib/ci.rake
|
125
128
|
- rakelib/doc.rake
|
126
|
-
- rakelib/ext.rake
|
127
129
|
- rakelib/gem.rake
|
128
130
|
- rakelib/test.rake
|
129
|
-
-
|
130
|
-
- README.markdown
|
131
|
-
- History.markdown
|
132
|
-
- .yardopts
|
131
|
+
- test/helper.rb
|
133
132
|
- test/integration/accessibility/test_dsl.rb
|
134
133
|
- test/integration/accessibility/test_enumerators.rb
|
135
134
|
- test/integration/accessibility/test_errors.rb
|
@@ -153,11 +152,8 @@ files:
|
|
153
152
|
- test/sanity/ax/test_application.rb
|
154
153
|
- test/sanity/ax/test_element.rb
|
155
154
|
- test/sanity/ax/test_systemwide.rb
|
156
|
-
- test/sanity/ax_elements/test_nsarray_compat.rb
|
157
|
-
- test/sanity/ax_elements/test_nsobject_inspect.rb
|
158
155
|
- test/sanity/test_accessibility.rb
|
159
156
|
- test/sanity/test_ax_elements.rb
|
160
|
-
- test/helper.rb
|
161
157
|
homepage: http://axelements.com
|
162
158
|
licenses:
|
163
159
|
- BSD 3-clause
|
@@ -168,17 +164,17 @@ require_paths:
|
|
168
164
|
- lib
|
169
165
|
required_ruby_version: !ruby/object:Gem::Requirement
|
170
166
|
requirements:
|
171
|
-
- -
|
167
|
+
- - ">="
|
172
168
|
- !ruby/object:Gem::Version
|
173
169
|
version: '0'
|
174
170
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
171
|
requirements:
|
176
|
-
- -
|
172
|
+
- - ">"
|
177
173
|
- !ruby/object:Gem::Version
|
178
|
-
version:
|
174
|
+
version: 1.3.1
|
179
175
|
requirements: []
|
180
176
|
rubyforge_project:
|
181
|
-
rubygems_version: 2.
|
177
|
+
rubygems_version: 2.4.2
|
182
178
|
signing_key:
|
183
179
|
specification_version: 4
|
184
180
|
summary: UI Automation for OS X
|
@@ -206,8 +202,6 @@ test_files:
|
|
206
202
|
- test/sanity/ax/test_application.rb
|
207
203
|
- test/sanity/ax/test_element.rb
|
208
204
|
- test/sanity/ax/test_systemwide.rb
|
209
|
-
- test/sanity/ax_elements/test_nsarray_compat.rb
|
210
|
-
- test/sanity/ax_elements/test_nsobject_inspect.rb
|
211
205
|
- test/sanity/test_accessibility.rb
|
212
206
|
- test/sanity/test_ax_elements.rb
|
213
207
|
- test/helper.rb
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# this is just a list of core extensions from Active Support
|
2
|
-
# that I would like to have loaded by default
|
3
|
-
|
4
|
-
require 'active_support/core_ext/numeric'
|
5
|
-
require 'active_support/core_ext/date/calculations'
|
6
|
-
require 'active_support/core_ext/date/conversions'
|
7
|
-
require 'active_support/core_ext/time/calculations'
|
8
|
-
require 'active_support/core_ext/time/conversions'
|
9
|
-
require 'active_support/core_ext/date_time/calculations'
|
10
|
-
require 'active_support/core_ext/date_time/conversions'
|
@@ -1,13 +0,0 @@
|
|
1
|
-
##
|
2
|
-
# Workaround for MacRuby ticket #1334
|
3
|
-
class Exception
|
4
|
-
alias_method :original_message, :message
|
5
|
-
#
|
6
|
-
# Override the message method to force the backtrace to be
|
7
|
-
# included.
|
8
|
-
#
|
9
|
-
# @return [String]
|
10
|
-
def message
|
11
|
-
"#{original_message}\n\t#{backtrace.join("\n\t")}"
|
12
|
-
end
|
13
|
-
end
|
data/rakelib/ext.rake
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'test/helper'
|
2
|
-
require 'ax_elements/nsarray_compat'
|
3
|
-
|
4
|
-
class TestNSArrayCompat < MiniTest::Unit::TestCase
|
5
|
-
|
6
|
-
def test_second_returns_second
|
7
|
-
assert_equal :two, NSArray.arrayWithArray([:one, :two]).second
|
8
|
-
assert_nil NSArray.arrayWithArray([:one]).second
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_third_returns_third
|
12
|
-
assert_equal :three, NSArray.arrayWithArray([:one, :two, :three]).third
|
13
|
-
assert_nil NSArray.arrayWithArray([:one, :two]).third
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'test/helper'
|
2
|
-
|
3
|
-
if on_macruby?
|
4
|
-
class TestNSObjectExtensions < MiniTest::Unit::TestCase
|
5
|
-
# keeping this test just to make sure the version of MacRuby
|
6
|
-
# being used is new enough
|
7
|
-
def test_inspecting
|
8
|
-
url = NSURL.URLWithString('http://marketcircle.com/')
|
9
|
-
assert_equal url.description, url.inspect
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|