atspi_app_driver 0.5.0 → 0.7.2

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
  SHA256:
3
- metadata.gz: 949d817c537231b15ee0ed1f48689d8ffb523ffa0c793e927b00a267c0c2dd82
4
- data.tar.gz: 0bc614e7259f82a513feb34720f7616391cf7de6da2da5db2e99c3f20f10caca
3
+ metadata.gz: 321ea977c559a0ff65cab5473c24a6b63fd96bb00a196d59ca9e7dd1fea5061f
4
+ data.tar.gz: 8a30fa5d63103eff3f8750b121fc8fabb7f2ff4d4efae23cfbf66c9a9b5a7823
5
5
  SHA512:
6
- metadata.gz: 64ff8528522c3329bd5afb8744bc3868ddad7f27a369291fcfa3cec72ba554e11c4b336a8ce321de3dbb4a6004e72477fe993988a5fd69d748e76ddca3639461
7
- data.tar.gz: 1ce161a644fb834a86a39941d671d3b95a148527bc0dd872c883111aac953a293f84aca0ecdd8be5a526e6f2d76d299731df90b4ca2a60ba27f1bb58de4b5a37
6
+ metadata.gz: 76c2f4d2ed9702f1ae15ce51c98fd3aed5be38187c428d9dbe065abc57f5bb3af1db3909040bdc54cb6797573eb9b51465b4746f89cb1018700486cf53a4fdf5
7
+ data.tar.gz: e8932a8bb6431c25a195055c8a27bc0604efef765ed55ec1fe3d1984c055bf8a93dc149ab212901da5d328801bddf03da9ecb55ec1c20df3a82405861ffa7ddc
data/Changelog.md CHANGED
@@ -1,13 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.2 / 2022-02-11
4
+
5
+ * Add missing version.rb file
6
+
7
+ ## 0.7.1 / 2022-01-23
8
+
9
+ * Drop support for Ruby version 2.5
10
+ * Support up to Ruby 3.1
11
+
12
+ ## 0.7.0 / 2020-11-14
13
+
14
+ * Drop support for Ruby version 2.4
15
+ * Remove `AtspiAppDriver#press_ctrl_q` because it does not and likely will
16
+ never work on Wayland. Use a regular action to quit your application instead.
17
+ * Provide access to the main application Atspi object through
18
+ AtspiAppDriver#application
19
+
20
+ ## 0.6.0 / 2019-10-19
21
+
22
+ * Depend on GirFFI 0.15.0 and GirFFI-Gtk 0.15.0
23
+ * Drop support for Ruby versions 2.2 and 2.3
24
+
3
25
  ## 0.5.0 / 2018-09-27
4
26
 
5
- * Depend on GirFFI 0.14.0 and GirFFI-Gtk 0.14.0
27
+ * Depend on GirFFI 0.14.0 and GirFFI-Gtk 0.14.0
6
28
 
7
29
  ## 0.4.0 / 2018-09-08
8
30
 
9
31
  * Drop support for Ruby 2.1
10
- * Depend on GirFFI 0.13.0 and GirFFI-Gtk 0.13.0
32
+ * Depend on GirFFI 0.13.0 and GirFFI-Gtk 0.13.0
11
33
 
12
34
  ## 0.3.1 / 2018-05-31
13
35
 
data/README.md CHANGED
@@ -40,7 +40,8 @@ Say, your application is called `foo`. Then, in your tests, do something like th
40
40
  textbox.get_text(0, 100).must_equal 'Foo bar baz'
41
41
 
42
42
  # Quit application
43
- @driver.press_ctrl_q
43
+ menu_item = frame.find_role :menu_item, /Quit/
44
+ menu_item.do_action 0
44
45
 
45
46
  # Check exit status
46
47
  status = @driver.cleanup
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AtspiAppDriver
4
+ VERSION = "0.7.2"
5
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'gir_ffi'
3
+ require "gir_ffi"
4
4
 
5
5
  GirFFI.setup :Atspi
6
6
  Atspi.load_class :Accessible
@@ -25,7 +25,7 @@ module AtspiAccessiblePatches
25
25
  end
26
26
 
27
27
  def inspect_recursive(level = 0, maxlevel = 5)
28
- puts "#{' ' * level} > name: #{name}; role: #{role}"
28
+ puts "#{" " * level} > name: #{name}; role: #{role}"
29
29
  each_child do |child|
30
30
  child.inspect_recursive(level + 1) unless level >= maxlevel
31
31
  end
@@ -39,7 +39,7 @@ Atspi::Accessible.include AtspiAccessiblePatches
39
39
  class AtspiAppDriver
40
40
  def initialize(app_name, app_file: nil, verbose: false)
41
41
  @app_file = app_file || "bin/#{app_name}"
42
- @lib_dir = 'lib'
42
+ @lib_dir = "lib"
43
43
  @app_name = app_name
44
44
  @pid = nil
45
45
  @verbose = verbose
@@ -47,10 +47,10 @@ class AtspiAppDriver
47
47
  @thread = nil
48
48
  end
49
49
 
50
- attr_reader :frame
50
+ attr_reader :frame, :application
51
51
 
52
52
  def boot(test_timeout: 30, exit_timeout: 10, arguments: [])
53
- raise 'Already booted' if @pid
53
+ raise "Already booted" if @pid
54
54
 
55
55
  spawn_process(arguments)
56
56
 
@@ -59,42 +59,36 @@ class AtspiAppDriver
59
59
  @frame = find_and_focus_frame
60
60
 
61
61
  @thread = Thread.new do
62
- wait_for('test to be done', test_timeout) { @cleanup }
63
- wait_for('pid to go away', exit_timeout) { !@pid }
62
+ wait_for("test to be done", test_timeout) { @cleanup }
63
+ wait_for("pid to go away", exit_timeout) { !@pid }
64
64
  kill_process if @pid
65
65
  end
66
66
  end
67
67
 
68
68
  def spawn_process(arguments)
69
- command = "ruby -I#{@lib_dir} #{@app_file} #{arguments.join(' ')}"
69
+ command = "ruby -I#{@lib_dir} #{@app_file} #{arguments.join(" ")}"
70
70
  log "About to spawn: `#{command}`"
71
71
  @pid = Process.spawn command
72
72
  end
73
73
 
74
- def press_ctrl_q
75
- Atspi.generate_keyboard_event(37, nil, :press)
76
- Atspi.generate_keyboard_event(24, nil, :pressrelease)
77
- Atspi.generate_keyboard_event(37, nil, :release)
78
- end
79
-
80
74
  def cleanup
81
75
  status = exit_status
82
76
  @pid = nil
83
- @thread.join if @thread
77
+ @thread&.join
84
78
  status
85
79
  end
86
80
 
87
81
  private
88
82
 
89
83
  def find_and_focus_frame
90
- acc = wait_for('app to appear', 10) { find_app }
91
- raise 'App not found' unless acc
84
+ @application = wait_for("app to appear", 10) { find_app }
85
+ raise "App not found" unless @application
92
86
 
93
- frame = acc.get_child_at_index 0
87
+ frame = @application.get_child_at_index 0
94
88
  role = frame.role
95
89
  raise "Frame has unexpected role #{role.inspect}" unless role == :frame
96
90
 
97
- wait_for('frame to be focused', 10) do
91
+ wait_for("frame to be focused", 10) do
98
92
  frame.get_state_set.get_states.to_a.include? :active
99
93
  end
100
94
 
@@ -103,7 +97,7 @@ class AtspiAppDriver
103
97
 
104
98
  def kill_process
105
99
  log "About to kill child process #{@pid}"
106
- Process.kill 'KILL', @pid
100
+ Process.kill "KILL", @pid
107
101
  end
108
102
 
109
103
  def log(message)
@@ -141,3 +135,5 @@ class AtspiAppDriver
141
135
  status
142
136
  end
143
137
  end
138
+
139
+ require_relative "atspi_app_driver/version"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atspi_app_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matijs van Zuijlen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-27 00:00:00.000000000 Z
11
+ date: 2022-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gir_ffi
@@ -16,30 +16,44 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.0
19
+ version: 0.15.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
- version: 0.14.0
26
+ version: 0.15.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: gir_ffi-gtk
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 0.15.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 0.15.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: gir_ffi-gtk
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.12'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.12'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
@@ -53,34 +67,90 @@ dependencies:
53
67
  - !ruby/object:Gem::Version
54
68
  version: 0.14.0
55
69
  - !ruby/object:Gem::Dependency
56
- name: minitest
70
+ name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '5.5'
75
+ version: '13.0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '5.5'
82
+ version: '13.0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: rake
84
+ name: rake-manifest
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.2.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.2.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 1.25.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.25.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-minitest
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.17.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.17.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-packaging
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.5.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.5.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-performance
71
141
  requirement: !ruby/object:Gem::Requirement
72
142
  requirements:
73
143
  - - "~>"
74
144
  - !ruby/object:Gem::Version
75
- version: '12.0'
145
+ version: 1.13.0
76
146
  type: :development
77
147
  prerelease: false
78
148
  version_requirements: !ruby/object:Gem::Requirement
79
149
  requirements:
80
150
  - - "~>"
81
151
  - !ruby/object:Gem::Version
82
- version: '12.0'
83
- description:
152
+ version: 1.13.0
153
+ description:
84
154
  email:
85
155
  - matijs@matijs.net
86
156
  executables: []
@@ -88,15 +158,18 @@ extensions: []
88
158
  extra_rdoc_files: []
89
159
  files:
90
160
  - Changelog.md
91
- - Gemfile
92
- - LICENSE
93
161
  - README.md
94
- - Rakefile
95
162
  - lib/atspi_app_driver.rb
163
+ - lib/atspi_app_driver/version.rb
96
164
  homepage: http://www.github.com/mvz/atspi_app_driver
97
- licenses: []
98
- metadata: {}
99
- post_install_message:
165
+ licenses:
166
+ - MIT
167
+ metadata:
168
+ homepage_uri: http://www.github.com/mvz/atspi_app_driver
169
+ source_code_uri: https://github.com/mvz/atspi_app_driver
170
+ changelog_uri: https://github.com/mvz/atspi_app_driver/blob/master/Changelog.md
171
+ rubygems_mfa_required: 'true'
172
+ post_install_message:
100
173
  rdoc_options: []
101
174
  require_paths:
102
175
  - lib
@@ -104,16 +177,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
177
  requirements:
105
178
  - - ">="
106
179
  - !ruby/object:Gem::Version
107
- version: 2.2.0
180
+ version: 2.6.0
108
181
  required_rubygems_version: !ruby/object:Gem::Requirement
109
182
  requirements:
110
183
  - - ">="
111
184
  - !ruby/object:Gem::Version
112
185
  version: '0'
113
186
  requirements: []
114
- rubyforge_project:
115
- rubygems_version: 2.7.6
116
- signing_key:
187
+ rubygems_version: 3.3.3
188
+ signing_key:
117
189
  specification_version: 4
118
190
  summary: Test GirFFI-based applications using Atspi
119
191
  test_files: []
data/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
data/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- Copyright (c) 2015 Matijs van Zuijlen
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- 'Software'), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
data/Rakefile DELETED
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rake/clean'
4
- require 'bundler/gem_tasks'
5
- require 'rake/testtask'
6
-
7
- namespace :test do
8
- Rake::TestTask.new(:end_to_end) do |t|
9
- t.libs = ['lib']
10
- t.test_files = FileList['test/end_to_end/*_test.rb']
11
- t.warning = true
12
- end
13
-
14
- task all: [:end_to_end]
15
- end
16
-
17
- task test: 'test:all'
18
-
19
- task default: 'test'