atspi_app_driver 0.3.0 → 0.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 250f08ce68898dbe2da6cc83d661c4fa28fda36e1133ea39040bd4e46e211081
4
- data.tar.gz: cac72405041130845ab9ce8e659d4dd181bab021b28e1ad667199bbada17f90e
3
+ metadata.gz: eb7e0e902e1226338c9308c06c8b71861aaaf3a81ce6417cc1571e16bfa2aaf3
4
+ data.tar.gz: 23622239a103ece6636394778c2e179e855ae2119d4bb3eb8de8a1e36dfc5b8c
5
5
  SHA512:
6
- metadata.gz: 5e9421fe4df5c02e8de5456334beb25ef7ec6d29b7e36f6148266f1658f7e62dc29d39d279c101f87c7143e50ddd6a85623e88aa116791a3ee09303644657bc6
7
- data.tar.gz: 4d0c82391b5bfef5f02a7b3349376743e1f6bac678178f07d27a42dc4a8d2c129d2a70beefbaf49081b094d6ebd0418fba3028f7fb23ee7e4d67fcc193a77f61
6
+ metadata.gz: 84e215b817c6a925ac14993606eb0ad9d22544aa4181183e38c87764455e23b01ee857eec130a7785c506370457678643fb8645b806be4b3e64cb06efdf2893e
7
+ data.tar.gz: 51bc41a0a5f666d01f091d5d38e46d1e8e5a68f6986e8dcbc29c0aea9e5d13f80b246be89e1772cb6300c8c91eb29fffd437003ac4c791290566e8d55997d7a4
@@ -1,4 +1,29 @@
1
- # Change log
1
+ # Changelog
2
+
3
+ ## 0.7.0 / 2020-11-14
4
+
5
+ * Drop support for Ruby version 2.4
6
+ * Remove AtspiAppDriver#press_ctrl_q because it does not and likely will never
7
+ work on Wayland. Use a regular action to quit your application instead.
8
+ * Provide access to the main application Atspi object through AtspiAppDriver#application
9
+
10
+ ## 0.6.0 / 2019-10-19
11
+
12
+ * Depend on GirFFI 0.15.0 and GirFFI-Gtk 0.15.0
13
+ * Drop support for Ruby versions 2.2 and 2.3
14
+
15
+ ## 0.5.0 / 2018-09-27
16
+
17
+ * Depend on GirFFI 0.14.0 and GirFFI-Gtk 0.14.0
18
+
19
+ ## 0.4.0 / 2018-09-08
20
+
21
+ * Drop support for Ruby 2.1
22
+ * Depend on GirFFI 0.13.0 and GirFFI-Gtk 0.13.0
23
+
24
+ ## 0.3.1 / 2018-05-31
25
+
26
+ * Restore support for Ruby 2.1 and 2.2
2
27
 
3
28
  ## 0.3.0 / 2018-03-25
4
29
 
@@ -7,7 +32,7 @@
7
32
 
8
33
  ## 0.2.0 / 2017-11-05
9
34
 
10
- * Revert to using GirFFI to provide GLib bindings. Use gnome_app_driver if you
35
+ * Revert to using GirFFI to provide GLib bindings. Use `gnome_app_driver` if you
11
36
  want to drive a Ruby-GNOME2 application.
12
37
 
13
38
  ## 0.1.0 / 2017-04-25
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2020 Matijs van Zuijlen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
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
@@ -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
@@ -16,6 +16,7 @@ module AtspiAccessiblePatches
16
16
 
17
17
  def find_role(role, regex = //)
18
18
  return self if role == self.role && name =~ regex
19
+
19
20
  each_child do |child|
20
21
  result = child.find_role role, regex
21
22
  return result if result
@@ -38,7 +39,7 @@ Atspi::Accessible.include AtspiAccessiblePatches
38
39
  class AtspiAppDriver
39
40
  def initialize(app_name, app_file: nil, verbose: false)
40
41
  @app_file = app_file || "bin/#{app_name}"
41
- @lib_dir = 'lib'
42
+ @lib_dir = "lib"
42
43
  @app_name = app_name
43
44
  @pid = nil
44
45
  @verbose = verbose
@@ -46,10 +47,10 @@ class AtspiAppDriver
46
47
  @thread = nil
47
48
  end
48
49
 
49
- attr_reader :frame
50
+ attr_reader :frame, :application
50
51
 
51
52
  def boot(test_timeout: 30, exit_timeout: 10, arguments: [])
52
- raise 'Already booted' if @pid
53
+ raise "Already booted" if @pid
53
54
 
54
55
  spawn_process(arguments)
55
56
 
@@ -58,8 +59,8 @@ class AtspiAppDriver
58
59
  @frame = find_and_focus_frame
59
60
 
60
61
  @thread = Thread.new do
61
- wait_for('test to be done', test_timeout) { @cleanup }
62
- 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 }
63
64
  kill_process if @pid
64
65
  end
65
66
  end
@@ -70,12 +71,6 @@ class AtspiAppDriver
70
71
  @pid = Process.spawn command
71
72
  end
72
73
 
73
- def press_ctrl_q
74
- Atspi.generate_keyboard_event(37, nil, :press)
75
- Atspi.generate_keyboard_event(24, nil, :pressrelease)
76
- Atspi.generate_keyboard_event(37, nil, :release)
77
- end
78
-
79
74
  def cleanup
80
75
  status = exit_status
81
76
  @pid = nil
@@ -86,14 +81,14 @@ class AtspiAppDriver
86
81
  private
87
82
 
88
83
  def find_and_focus_frame
89
- acc = wait_for('app to appear', 10) { find_app }
90
- raise 'App not found' unless acc
84
+ @application = wait_for("app to appear", 10) { find_app }
85
+ raise "App not found" unless @application
91
86
 
92
- frame = acc.get_child_at_index 0
87
+ frame = @application.get_child_at_index 0
93
88
  role = frame.role
94
89
  raise "Frame has unexpected role #{role.inspect}" unless role == :frame
95
90
 
96
- wait_for('frame to be focused', 10) do
91
+ wait_for("frame to be focused", 10) do
97
92
  frame.get_state_set.get_states.to_a.include? :active
98
93
  end
99
94
 
@@ -102,7 +97,7 @@ class AtspiAppDriver
102
97
 
103
98
  def kill_process
104
99
  log "About to kill child process #{@pid}"
105
- Process.kill 'KILL', @pid
100
+ Process.kill "KILL", @pid
106
101
  end
107
102
 
108
103
  def log(message)
@@ -125,6 +120,7 @@ class AtspiAppDriver
125
120
  50.times do |num|
126
121
  result = yield
127
122
  break if result
123
+
128
124
  sleep 0.01 * (num + 1)
129
125
  end
130
126
  log "Waited #{Time.now - start} seconds for #{description}"
@@ -133,6 +129,7 @@ class AtspiAppDriver
133
129
 
134
130
  def exit_status
135
131
  return unless @pid
132
+
136
133
  @cleanup = true
137
134
  _, status = Process.wait2 @pid
138
135
  status
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.3.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matijs van Zuijlen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-25 00:00:00.000000000 Z
11
+ date: 2020-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gir_ffi
@@ -16,70 +16,126 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.12.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.12.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
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.12.0
47
+ version: '5.12'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.12.0
54
+ version: '5.12'
55
55
  - !ruby/object:Gem::Dependency
56
- name: minitest
56
+ name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '5.5'
61
+ version: 0.13.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '5.5'
68
+ version: 0.13.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '12.0'
75
+ version: '13.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '13.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 1.3.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 1.3.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-minitest
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.10.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.10.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-packaging
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.5.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.5.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-performance
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 1.8.0
76
132
  type: :development
77
133
  prerelease: false
78
134
  version_requirements: !ruby/object:Gem::Requirement
79
135
  requirements:
80
136
  - - "~>"
81
137
  - !ruby/object:Gem::Version
82
- version: '12.0'
138
+ version: 1.8.0
83
139
  description:
84
140
  email:
85
141
  - matijs@matijs.net
@@ -88,14 +144,16 @@ extensions: []
88
144
  extra_rdoc_files: []
89
145
  files:
90
146
  - Changelog.md
91
- - Gemfile
92
- - LICENSE
147
+ - LICENSE.txt
93
148
  - README.md
94
- - Rakefile
95
149
  - lib/atspi_app_driver.rb
96
150
  homepage: http://www.github.com/mvz/atspi_app_driver
97
- licenses: []
98
- metadata: {}
151
+ licenses:
152
+ - MIT
153
+ metadata:
154
+ homepage_uri: http://www.github.com/mvz/atspi_app_driver
155
+ source_code_uri: https://github.com/mvz/atspi_app_driver
156
+ changelog_uri: https://github.com/mvz/atspi_app_driver/blob/master/Changelog.md
99
157
  post_install_message:
100
158
  rdoc_options: []
101
159
  require_paths:
@@ -104,15 +162,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
162
  requirements:
105
163
  - - ">="
106
164
  - !ruby/object:Gem::Version
107
- version: 2.3.0
165
+ version: 2.5.0
108
166
  required_rubygems_version: !ruby/object:Gem::Requirement
109
167
  requirements:
110
168
  - - ">="
111
169
  - !ruby/object:Gem::Version
112
170
  version: '0'
113
171
  requirements: []
114
- rubyforge_project:
115
- rubygems_version: 2.7.6
172
+ rubygems_version: 3.1.2
116
173
  signing_key:
117
174
  specification_version: 4
118
175
  summary: Test GirFFI-based applications using Atspi
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'