osaka 0.4.8 → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.rdoc +1 -1
- data/Rakefile +12 -2
- data/lib/osaka.rb +6 -0
- data/lib/osaka/calculator.rb +1 -1
- data/lib/osaka/commandrunner.rb +17 -0
- data/lib/osaka/defaultssystem.rb +28 -0
- data/lib/osaka/keynote.rb +8 -6
- data/lib/osaka/keynoteflow.rb +10 -2
- data/lib/osaka/launchservices.rb +29 -0
- data/lib/osaka/location.rb +1 -1
- data/lib/osaka/mailmergeflow.rb +1 -1
- data/lib/osaka/numbers.rb +1 -1
- data/lib/osaka/osakaexpectations.rb +65 -61
- data/lib/osaka/pages.rb +35 -26
- data/lib/osaka/preview.rb +1 -1
- data/lib/osaka/remotecontrol.rb +57 -47
- data/lib/osaka/scriptrunner.rb +2 -11
- data/lib/osaka/textedit.rb +1 -1
- data/lib/osaka/typicalapplication.rb +10 -4
- data/lib/osaka/typicalfinderdialog.rb +1 -1
- data/lib/osaka/typicalopendialog.rb +22 -18
- data/lib/osaka/typicalprintdialog.rb +1 -1
- data/lib/osaka/typicalsavedialog.rb +1 -1
- data/lib/osaka/version.rb +1 -1
- data/{osaka.gemfile → osaka.gemspec} +0 -0
- data/spec/assets/document.pdf +0 -0
- data/spec/calculator_spec.rb +5 -5
- data/spec/defaultssystem_spec.rb +30 -0
- data/spec/integration_calculator_spec.rb +7 -7
- data/spec/integration_keynote_spec.rb +24 -11
- data/spec/integration_numbers_spec.rb +2 -2
- data/spec/integration_pages_numbers_mail_merge_spec.rb +9 -9
- data/spec/integration_preview_spec.rb +16 -0
- data/spec/integration_textedit_spec.rb +5 -5
- data/spec/keynote_flows_spec.rb +52 -31
- data/spec/keynote_spec.rb +24 -14
- data/spec/launchservices_spec.rb +63 -0
- data/spec/location_spec.rb +13 -13
- data/spec/mailmergeflow_spec.rb +13 -13
- data/spec/numbers_spec.rb +10 -10
- data/spec/osakaexpectations_spec.rb +3 -3
- data/spec/pages_spec.rb +80 -61
- data/spec/preview_spec.rb +5 -5
- data/spec/remotecontrol_spec.rb +65 -43
- data/spec/scriptrunner_spec.rb +22 -22
- data/spec/textedit_spec.rb +3 -3
- data/spec/typicalapplication_spec.rb +119 -108
- data/spec/typicalfinderdialog_spec.rb +2 -2
- data/spec/typicalopendialog_spec.rb +41 -35
- data/spec/typicalprintdialog_spec.rb +5 -5
- data/spec/typicalsavedialog_spec.rb +10 -10
- metadata +51 -47
@@ -5,7 +5,7 @@ describe "Osaka::TypicalFinderDialog" do
|
|
5
5
|
|
6
6
|
include(*Osaka::OsakaExpectations)
|
7
7
|
subject { Osaka::TypicalFinderDialog.new("Application", at.window(1))}
|
8
|
-
let(:control) { subject.control =
|
8
|
+
let(:control) { subject.control = double("RemoteControl", :base_location => at.window(1)) }
|
9
9
|
|
10
10
|
|
11
11
|
it "Should be able to set the path" do
|
@@ -18,7 +18,7 @@ describe "Osaka::TypicalFinderDialog" do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it "Won't change the path when the path is the current one" do
|
21
|
-
control.
|
21
|
+
expect(control).not_to receive :keystroke
|
22
22
|
subject.set_folder(".")
|
23
23
|
end
|
24
24
|
|
@@ -2,84 +2,90 @@
|
|
2
2
|
require 'osaka'
|
3
3
|
|
4
4
|
describe "Osaka::TypicalOpenDialog" do
|
5
|
-
|
5
|
+
|
6
6
|
include(*Osaka::OsakaExpectations)
|
7
|
+
|
7
8
|
subject { Osaka::TypicalOpenDialog.new("Application", at.window(1))}
|
8
|
-
let(:control) { subject.control
|
9
|
-
|
10
|
-
|
9
|
+
let(:control) { subject.control ||= double("RemoteControl", :base_location => at.window(1), :mac_version => :mountain_lion) }
|
10
|
+
|
11
11
|
it "Should be do nothing when the amount of files in the directory is 0" do
|
12
|
-
subject.
|
12
|
+
expect(subject).to receive(:amount_of_files_in_list).and_return(0)
|
13
13
|
subject.select_file("filename")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "Should be able to select a file from Row 1" do
|
17
|
-
subject.
|
18
|
-
subject.
|
19
|
-
subject.
|
20
|
-
subject.
|
21
|
-
|
17
|
+
expect(subject).to receive(:amount_of_files_in_list).and_return(1)
|
18
|
+
expect(subject).to receive(:filename_at).with(1).and_return("filename")
|
19
|
+
expect(subject).to receive(:select_file_by_row).with(1)
|
20
|
+
expect(subject).to receive(:click_open)
|
21
|
+
|
22
22
|
subject.select_file("filename")
|
23
23
|
end
|
24
24
|
|
25
25
|
it "Should be able to select a file from Row 3" do
|
26
|
-
subject.
|
27
|
-
subject.
|
28
|
-
subject.
|
29
|
-
subject.
|
30
|
-
|
26
|
+
expect(subject).to receive(:amount_of_files_in_list).and_return(10)
|
27
|
+
expect(subject).to receive(:filename_at).and_return("filename", "filename2", "filename3")
|
28
|
+
expect(subject).to receive(:select_file_by_row).with(3)
|
29
|
+
expect(subject).to receive(:click_open)
|
30
|
+
|
31
31
|
subject.select_file("filename3")
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
it "Should be able to click open" do
|
35
35
|
expect_click(at.button("Open"))
|
36
36
|
subject.click_open
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
|
40
40
|
it "Should be able to get the name of a file from a row" do
|
41
|
-
subject.
|
41
|
+
expect(subject).to receive(:field_location_from_row).and_return(at.window("Location"))
|
42
42
|
expect_get!("value", at.window("Location")).and_return("filename")
|
43
|
-
subject.filename_at(1).
|
43
|
+
expect(subject.filename_at(1)).to eq "filename"
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
it "Should be able to select the filename (when that is possible)" do
|
47
|
-
subject.
|
47
|
+
expect(subject).to receive(:greyed_out?).and_return(false)
|
48
48
|
expect_set!("selected", at.row(1) + subject.file_list_location, true)
|
49
49
|
subject.select_file_by_row(1)
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
it "Should throw an exception when the filename that we want to select is greyed out" do
|
53
|
-
subject.
|
53
|
+
expect(subject).to receive(:greyed_out?).and_return(true)
|
54
54
|
expect { subject.select_file_by_row(1)}.to raise_error(Osaka::OpenDialogCantSelectFile, "Tried to select a file, but it either doesn't exist or is greyed out")
|
55
55
|
end
|
56
56
|
|
57
57
|
it "Should be able to get the amount of files in the current file list" do
|
58
58
|
expect_get!("rows", subject.file_list_location).and_return("row 1 of outline 1 of scroll area 2 of splitter group 1 of group 1 of window Open of application process Pages")
|
59
|
-
subject.amount_of_files_in_list.
|
59
|
+
expect(subject.amount_of_files_in_list).to eq 1
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
it "Should be able to get the amount of files in the current file list with 2 files." do
|
63
63
|
expect_get!("rows", subject.file_list_location).and_return("row 1 of outline 1 of scroll area 2 of splitter group 1 of group 1 of window Open of application process Pages, row 2 of outline 1 of scroll area 2 of splitter group 1 of group 1 of window Open of application process Pages")
|
64
|
-
subject.amount_of_files_in_list.
|
64
|
+
expect(subject.amount_of_files_in_list).to eq 2
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
it "Should be able to get the amount of files in the current file list when there are no files..." do
|
68
68
|
expect_get!("rows", subject.file_list_location).and_return("")
|
69
|
-
subject.amount_of_files_in_list.
|
70
|
-
end
|
71
|
-
|
69
|
+
expect(subject.amount_of_files_in_list).to eq 0
|
70
|
+
end
|
71
|
+
|
72
72
|
it "Should be able to convert a row into a location when it is a text field" do
|
73
73
|
expect_exists?(subject.text_field_location_from_row(1)).and_return(true)
|
74
|
-
subject.field_location_from_row(1).
|
74
|
+
expect(subject.field_location_from_row(1)).to eq subject.text_field_location_from_row(1)
|
75
75
|
end
|
76
|
-
|
76
|
+
|
77
77
|
it "Should be able to convert a row into a location when it is a static field." do
|
78
78
|
expect_exists?(subject.text_field_location_from_row(1)).and_return(false)
|
79
|
-
subject.field_location_from_row(1).
|
79
|
+
expect(subject.field_location_from_row(1)).to eq subject.static_field_location_from_row(1)
|
80
80
|
end
|
81
|
-
|
81
|
+
|
82
82
|
it "Should be able to get the location of the list" do
|
83
|
-
|
83
|
+
simulate_mac_version(:mountain_lion)
|
84
|
+
expect(subject.file_list_location).to eq at.outline(1).scroll_area(2).splitter_group(1).group(1)
|
85
|
+
end
|
86
|
+
|
87
|
+
it "Should be able to get the location of the list Yosemite" do
|
88
|
+
simulate_mac_version(:yosemite)
|
89
|
+
expect(subject.file_list_location).to eq at.outline(1).scroll_area(1).splitter_group(1).splitter_group(1).group(1)
|
84
90
|
end
|
85
91
|
end
|
@@ -6,13 +6,13 @@ describe "Osaka::TypicalPrintDialog" do
|
|
6
6
|
include(*Osaka::OsakaExpectations)
|
7
7
|
subject { Osaka::TypicalPrintDialog.new("App", at.window("Print")) }
|
8
8
|
|
9
|
-
let(:control) { subject.control =
|
9
|
+
let(:control) { subject.control = double("RemoteControl", :name => "App") }
|
10
10
|
|
11
11
|
it "Should be able to save the PDF in a print dialog" do
|
12
12
|
|
13
|
-
control.
|
13
|
+
expect(control).to receive(:base_location).twice.and_return(at.window("Print"))
|
14
14
|
|
15
|
-
save_dialog_mock =
|
15
|
+
save_dialog_mock = double("Generic Save Dialog")
|
16
16
|
|
17
17
|
expect_click!(at.menu_button("PDF"))
|
18
18
|
expect_wait_until_exists!(at.menu(1).menu_button("PDF"))
|
@@ -20,8 +20,8 @@ describe "Osaka::TypicalPrintDialog" do
|
|
20
20
|
expect_click!(at.menu_item(2).menu(1).menu_button("PDF"))
|
21
21
|
expect_wait_until_exists!(at.window("Save"), at.sheet(1).window("Print")).and_return(at.window("Save"))
|
22
22
|
|
23
|
-
subject.
|
24
|
-
save_dialog_mock.
|
23
|
+
expect(subject).to receive(:create_save_dialog).with("App", at.window("Save")).and_return(save_dialog_mock)
|
24
|
+
expect(save_dialog_mock).to receive(:save).with("filename")
|
25
25
|
|
26
26
|
expect_until_not_exists!(at.window("Print"))
|
27
27
|
expect_exists?(at.checkbox(1)).and_return(true)
|
@@ -5,25 +5,25 @@ describe "Osaka::TypicalSaveDialog" do
|
|
5
5
|
|
6
6
|
include(*Osaka::OsakaExpectations)
|
7
7
|
subject { Osaka::TypicalSaveDialog.new("Application", at.sheet(1))}
|
8
|
-
let(:control) { subject.control =
|
8
|
+
let(:control) { subject.control = double("RemoteControl", :base_location => at.sheet(1)) }
|
9
9
|
|
10
10
|
it "Should set the filename in the test field" do
|
11
|
-
subject.
|
12
|
-
subject.
|
11
|
+
expect(subject).to receive(:set_filename).with("filename")
|
12
|
+
expect(subject).to receive(:click_save)
|
13
13
|
subject.save("filename")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "Should pick only the base filename when a path is given" do
|
17
|
-
subject.
|
18
|
-
subject.
|
19
|
-
subject.
|
17
|
+
expect(subject).to receive(:set_filename).with("filename")
|
18
|
+
expect(subject).to receive(:set_folder)
|
19
|
+
expect(subject).to receive(:click_save)
|
20
20
|
subject.save("/path/filename")
|
21
21
|
end
|
22
22
|
|
23
23
|
it "Should set the path when a full path is given" do
|
24
24
|
control.as_null_object
|
25
|
-
subject.
|
26
|
-
subject.
|
25
|
+
expect(subject).to receive(:set_filename)
|
26
|
+
expect(subject).to receive(:set_folder).with("/path/second")
|
27
27
|
subject.save("/path/second/name")
|
28
28
|
end
|
29
29
|
|
@@ -34,9 +34,9 @@ describe "Osaka::TypicalSaveDialog" do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
it "Should be able to set the filename" do
|
37
|
-
control.
|
37
|
+
expect(control).to receive(:set).with('value', at.text_field(1), "filename")
|
38
38
|
subject.set_filename("filename")
|
39
39
|
end
|
40
40
|
|
41
41
|
|
42
|
-
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,54 +1,60 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: osaka
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.4.8
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.10
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Bas Vodde
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2015-01-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
16
14
|
name: rake
|
17
|
-
|
18
|
-
|
19
|
-
none: false
|
20
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
21
17
|
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version:
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
24
20
|
type: :runtime
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: rspec
|
28
21
|
prerelease: false
|
29
|
-
|
30
|
-
|
31
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
32
31
|
- - ">="
|
33
|
-
- !ruby/object:Gem::Version
|
32
|
+
- !ruby/object:Gem::Version
|
34
33
|
version: 2.0.0
|
35
34
|
type: :development
|
36
|
-
|
37
|
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.0.0
|
41
|
+
description: Osaka wraps osascript (Applescript) and provides a ruby interface for
|
42
|
+
automating tasks through the GUI on Mac
|
38
43
|
email: basv@odd-e.com
|
39
44
|
executables: []
|
40
|
-
|
41
45
|
extensions: []
|
42
|
-
|
43
46
|
extra_rdoc_files: []
|
44
|
-
|
45
|
-
|
47
|
+
files:
|
48
|
+
- Gemfile
|
46
49
|
- README.rdoc
|
47
50
|
- Rakefile
|
48
51
|
- lib/osaka.rb
|
49
52
|
- lib/osaka/calculator.rb
|
53
|
+
- lib/osaka/commandrunner.rb
|
54
|
+
- lib/osaka/defaultssystem.rb
|
50
55
|
- lib/osaka/keynote.rb
|
51
56
|
- lib/osaka/keynoteflow.rb
|
57
|
+
- lib/osaka/launchservices.rb
|
52
58
|
- lib/osaka/location.rb
|
53
59
|
- lib/osaka/mailmergeflow.rb
|
54
60
|
- lib/osaka/numbers.rb
|
@@ -64,18 +70,22 @@ files:
|
|
64
70
|
- lib/osaka/typicalprintdialog.rb
|
65
71
|
- lib/osaka/typicalsavedialog.rb
|
66
72
|
- lib/osaka/version.rb
|
67
|
-
- osaka.
|
73
|
+
- osaka.gemspec
|
68
74
|
- spec/assets/01_first_slides.key
|
69
75
|
- spec/assets/02_second_slides.key
|
70
76
|
- spec/assets/03_third_slides.key
|
77
|
+
- spec/assets/document.pdf
|
71
78
|
- spec/calculator_spec.rb
|
79
|
+
- spec/defaultssystem_spec.rb
|
72
80
|
- spec/integration_calculator_spec.rb
|
73
81
|
- spec/integration_keynote_spec.rb
|
74
82
|
- spec/integration_numbers_spec.rb
|
75
83
|
- spec/integration_pages_numbers_mail_merge_spec.rb
|
84
|
+
- spec/integration_preview_spec.rb
|
76
85
|
- spec/integration_textedit_spec.rb
|
77
86
|
- spec/keynote_flows_spec.rb
|
78
87
|
- spec/keynote_spec.rb
|
88
|
+
- spec/launchservices_spec.rb
|
79
89
|
- spec/location_spec.rb
|
80
90
|
- spec/mailmergeflow_spec.rb
|
81
91
|
- spec/numbers_spec.rb
|
@@ -92,31 +102,25 @@ files:
|
|
92
102
|
- spec/typicalsavedialog_spec.rb
|
93
103
|
homepage: https://github.com/basvodde/osaka
|
94
104
|
licenses: []
|
95
|
-
|
105
|
+
metadata: {}
|
96
106
|
post_install_message:
|
97
107
|
rdoc_options: []
|
98
|
-
|
99
|
-
require_paths:
|
108
|
+
require_paths:
|
100
109
|
- lib
|
101
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
-
|
103
|
-
requirements:
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
104
112
|
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version:
|
107
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
-
|
109
|
-
requirements:
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
110
117
|
- - ">="
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version:
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
113
120
|
requirements: []
|
114
|
-
|
115
121
|
rubyforge_project:
|
116
|
-
rubygems_version:
|
122
|
+
rubygems_version: 2.2.2
|
117
123
|
signing_key:
|
118
|
-
specification_version:
|
124
|
+
specification_version: 4
|
119
125
|
summary: Osaka is an Mac GUI automation library
|
120
126
|
test_files: []
|
121
|
-
|
122
|
-
has_rdoc:
|