gnome_app_driver 0.2.1 → 0.3.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: e7feb70f2fafca92f6f5e1d71f5fad7af913f69db2f4c554629c6a1f88fca9b7
4
- data.tar.gz: 61db339d567b17aef27903e6bd2b3599aabc52e2e66c56b539e83fa0395bebee
3
+ metadata.gz: 0ee50930853f322229cbb62376c1cf7f008665bf908bf9f45eb993d75602f716
4
+ data.tar.gz: 0c78c6df67945f1d8626cbf200937b4465bb5b23f93c4936f131974b20e685c5
5
5
  SHA512:
6
- metadata.gz: 35dba622b624ef71f94b1c2ad2af2a37cae28e12eb2f2b55b1b373d9c6419a13facf51dd0cacf374ee8db8d399aad0e31a3ac3b5563c09600875e47387424a3a
7
- data.tar.gz: d75652fd61a2627f1c5ffad31ffc6ca5a5c31b592d6dcce4f3573d959b1f2847b8c9c78f24399b96d4498fcc31cd574af4bf0e760b05a20854c63fb3ff56c68e
6
+ metadata.gz: dfaa21c9a44c23c38999cb2d387df02d3d2c79c5f7d886fc86eb16e6e2a64ce416f6cd62afeac4cefdd6a7ab80cabb64766b2413f8f861a389fb0c6e8f393650
7
+ data.tar.gz: 322f24bc77df2a0fc95c9becc8d59a850e52210bbea05bbd0241a7e11e8592b6c2cef5fb7977a4a274aa55bcac330f5a06431605816148c739aa698e4faf4212
@@ -1,5 +1,12 @@
1
1
  # Change log
2
2
 
3
+ ## 0.3.0 / 2020-11-14
4
+
5
+ * Drop support for Ruby version 2.3 and 2.4
6
+ * Remove `GnomeAppDriver#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 `GnomeAppDriver#application`
9
+
3
10
  ## 0.2.1 / 2018-11-03
4
11
 
5
12
  * Loosen dependencies
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,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'gobject-introspection'
3
+ require "gobject-introspection"
4
4
 
5
5
  # Namespace for Atspi classes.
6
6
  module Atspi
7
7
  end
8
8
 
9
9
  # Load Atspi namespace with GObjectIntrospection.
10
- GObjectIntrospection::Loader.new(Atspi).load('Atspi')
10
+ GObjectIntrospection::Loader.new(Atspi).load("Atspi")
11
11
 
12
12
  # Utility monkey-patches for the Atspi::Accessible class
13
13
  module AtspiAccessiblePatches
@@ -44,7 +44,7 @@ Atspi::Accessible.include AtspiAccessiblePatches
44
44
  class GnomeAppDriver
45
45
  def initialize(app_name, app_file: nil, verbose: false)
46
46
  @app_file = app_file || "bin/#{app_name}"
47
- @lib_dir = 'lib'
47
+ @lib_dir = "lib"
48
48
  @app_name = app_name
49
49
  @pid = nil
50
50
  @verbose = verbose
@@ -52,10 +52,10 @@ class GnomeAppDriver
52
52
  @thread = nil
53
53
  end
54
54
 
55
- attr_reader :frame
55
+ attr_reader :frame, :application
56
56
 
57
57
  def boot(test_timeout: 30, exit_timeout: 10, arguments: [])
58
- raise 'Already booted' if @pid
58
+ raise "Already booted" if @pid
59
59
 
60
60
  spawn_process(arguments)
61
61
 
@@ -64,8 +64,8 @@ class GnomeAppDriver
64
64
  @frame = find_and_focus_frame
65
65
 
66
66
  @thread = Thread.new do
67
- wait_for('test to be done', test_timeout) { @cleanup }
68
- wait_for('pid to go away', exit_timeout) { !@pid }
67
+ wait_for("test to be done", test_timeout) { @cleanup }
68
+ wait_for("pid to go away", exit_timeout) { !@pid }
69
69
  kill_process if @pid
70
70
  end
71
71
  end
@@ -76,12 +76,6 @@ class GnomeAppDriver
76
76
  @pid = Process.spawn command
77
77
  end
78
78
 
79
- def press_ctrl_q
80
- Atspi.generate_keyboard_event(37, nil, :press)
81
- Atspi.generate_keyboard_event(24, nil, :pressrelease)
82
- Atspi.generate_keyboard_event(37, nil, :release)
83
- end
84
-
85
79
  def cleanup
86
80
  status = exit_status
87
81
  @pid = nil
@@ -92,14 +86,14 @@ class GnomeAppDriver
92
86
  private
93
87
 
94
88
  def find_and_focus_frame
95
- acc = wait_for('app to appear', 10) { find_app }
96
- raise 'App not found' unless acc
89
+ @application = wait_for("app to appear", 10) { find_app }
90
+ raise "App not found" unless @application
97
91
 
98
- frame = acc.get_child_at_index 0
92
+ frame = @application.get_child_at_index 0
99
93
  role = frame.role
100
94
  raise "Frame has unexpected role #{role.inspect}" unless role == :frame
101
95
 
102
- wait_for('frame to be focused', 10) do
96
+ wait_for("frame to be focused", 10) do
103
97
  frame.state_set.contains(Atspi::StateType::ACTIVE)
104
98
  end
105
99
 
@@ -108,7 +102,7 @@ class GnomeAppDriver
108
102
 
109
103
  def kill_process
110
104
  log "About to kill child process #{@pid}"
111
- Process.kill 'KILL', @pid
105
+ Process.kill "KILL", @pid
112
106
  end
113
107
 
114
108
  def log(message)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnome_app_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.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-11-03 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: gobject-introspection
@@ -25,94 +25,158 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: gtk3
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '3.2'
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: '3.2'
41
41
  - !ruby/object:Gem::Dependency
42
- name: gtk3
42
+ name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.2'
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: '3.2'
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
76
  type: :development
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: '12.0'
83
- description:
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
139
+ description: 'Driver to test the UI of applications using Ruby-GNOME2 by interacting
140
+ with them via Atspi.
141
+
142
+ '
84
143
  email:
85
144
  - matijs@matijs.net
86
145
  executables: []
87
146
  extensions: []
88
- extra_rdoc_files: []
147
+ extra_rdoc_files:
148
+ - README.md
149
+ - Changelog.md
89
150
  files:
90
151
  - Changelog.md
91
- - Gemfile
92
152
  - LICENSE
93
153
  - README.md
94
- - Rakefile
95
154
  - lib/gnome_app_driver.rb
96
155
  homepage: http://www.github.com/mvz/ruby-gnome2_app_driver
97
- licenses: []
98
- metadata: {}
156
+ licenses:
157
+ - LGPL-2.1+
158
+ metadata:
159
+ homepage_uri: http://www.github.com/mvz/ruby-gnome2_app_driver
160
+ source_code_uri: https://github.com/mvz/ruby-gnome2_app_driver
161
+ changelog_uri: https://github.com/mvzruby-gnome2_app_driver/blob/master/Changelog.md
99
162
  post_install_message:
100
- rdoc_options: []
163
+ rdoc_options:
164
+ - "--main"
165
+ - README.md
101
166
  require_paths:
102
167
  - lib
103
168
  required_ruby_version: !ruby/object:Gem::Requirement
104
169
  requirements:
105
170
  - - ">="
106
171
  - !ruby/object:Gem::Version
107
- version: 2.3.0
172
+ version: 2.5.0
108
173
  required_rubygems_version: !ruby/object:Gem::Requirement
109
174
  requirements:
110
175
  - - ">="
111
176
  - !ruby/object:Gem::Version
112
177
  version: '0'
113
178
  requirements: []
114
- rubyforge_project:
115
- rubygems_version: 2.7.6
179
+ rubygems_version: 3.1.2
116
180
  signing_key:
117
181
  specification_version: 4
118
182
  summary: Test Ruby-GNOME2 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/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'