atspi_app_driver 0.6.0 → 0.7.0

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: bef40a72cc54c514bcff91042f2d3d6cf1ba036452da99b8a2990907698401db
4
- data.tar.gz: 14d6f87dbe0f352ee08b3de0101f8d26d6ed4c247d6ca1d2bf7b924278357605
3
+ metadata.gz: eb7e0e902e1226338c9308c06c8b71861aaaf3a81ce6417cc1571e16bfa2aaf3
4
+ data.tar.gz: 23622239a103ece6636394778c2e179e855ae2119d4bb3eb8de8a1e36dfc5b8c
5
5
  SHA512:
6
- metadata.gz: b68f8048f7532e67524a27e38111e8631f237579e92216c28648314d321426d71cdf2184f18ccfecff30abab3d8196f2282f83a60b8272d5836c8d35b4041c52
7
- data.tar.gz: 0d0cd6983e78fd5dcf0f723d3da8faaeded622f30e3c6b6692fc29d3e5d69106ede2b187184059158d0318573aca6b882165247bcb044ae02bd97582c884e899
6
+ metadata.gz: 84e215b817c6a925ac14993606eb0ad9d22544aa4181183e38c87764455e23b01ee857eec130a7785c506370457678643fb8645b806be4b3e64cb06efdf2893e
7
+ data.tar.gz: 51bc41a0a5f666d01f091d5d38e46d1e8e5a68f6986e8dcbc29c0aea9e5d13f80b246be89e1772cb6300c8c91eb29fffd437003ac4c791290566e8d55997d7a4
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
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
+
3
10
  ## 0.6.0 / 2019-10-19
4
11
 
5
12
  * Depend on GirFFI 0.15.0 and GirFFI-Gtk 0.15.0
@@ -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
@@ -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,8 +59,8 @@ 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
@@ -71,12 +71,6 @@ class AtspiAppDriver
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
@@ -87,14 +81,14 @@ class AtspiAppDriver
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)
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.6.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: 2019-10-19 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
@@ -25,47 +25,47 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
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.15.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.15.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.12'
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.12'
68
+ version: 0.13.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,62 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
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
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
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,14 +162,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
162
  requirements:
105
163
  - - ">="
106
164
  - !ruby/object:Gem::Version
107
- version: 2.4.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
- rubygems_version: 3.0.6
172
+ rubygems_version: 3.1.2
115
173
  signing_key:
116
174
  specification_version: 4
117
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'