mohawk 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +24 -17
- data/.travis.yml +2 -0
- data/Changelog +36 -20
- data/Gemfile +3 -3
- data/Guardfile +16 -0
- data/LICENSE.txt +21 -21
- data/README.md +60 -56
- data/Rakefile +18 -18
- data/features/control.feature +5 -0
- data/features/label.feature +4 -4
- data/features/link.feature +9 -0
- data/features/mohawk.feature +4 -1
- data/features/navigation.feature +9 -0
- data/features/step_definitions/control_steps.rb +3 -0
- data/features/step_definitions/label_steps.rb +3 -3
- data/features/step_definitions/link_steps.rb +3 -0
- data/features/step_definitions/mohawk_steps.rb +4 -0
- data/features/step_definitions/navigation_steps.rb +15 -0
- data/features/step_definitions/table_steps.rb +19 -3
- data/features/step_definitions/tree_view_steps.rb +4 -0
- data/features/support/WindowsForms.exe +0 -0
- data/features/support/app/WindowsForms/WindowsForms/AboutBox.Designer.cs +80 -0
- data/features/support/app/WindowsForms/WindowsForms/AboutBox.cs +103 -0
- data/features/support/app/WindowsForms/WindowsForms/AboutBox.resx +120 -0
- data/features/support/app/WindowsForms/WindowsForms/AutomatableMonthCalendar.cs +59 -0
- data/features/support/app/WindowsForms/WindowsForms/AutomationHelpers/AutomationProvider.cs +91 -0
- data/features/support/app/WindowsForms/WindowsForms/DataEntryForm.Designer.cs +187 -0
- data/features/support/app/WindowsForms/WindowsForms/DataEntryForm.cs +46 -0
- data/features/support/app/WindowsForms/WindowsForms/DataEntryForm.resx +120 -0
- data/features/support/app/WindowsForms/WindowsForms/MainFormWindow.Designer.cs +526 -0
- data/features/support/app/WindowsForms/WindowsForms/MainFormWindow.cs +93 -0
- data/features/support/app/WindowsForms/WindowsForms/MainFormWindow.resx +123 -0
- data/features/support/app/WindowsForms/WindowsForms/PersonForm.Designer.cs +119 -0
- data/features/support/app/WindowsForms/WindowsForms/PersonForm.cs +34 -0
- data/features/support/app/WindowsForms/WindowsForms/PersonForm.resx +120 -0
- data/features/support/app/WindowsForms/WindowsForms/Program.cs +21 -0
- data/features/support/app/WindowsForms/WindowsForms/Properties/AssemblyInfo.cs +36 -0
- data/features/support/app/WindowsForms/WindowsForms/Properties/Resources.Designer.cs +71 -0
- data/features/support/app/WindowsForms/WindowsForms/Properties/Resources.resx +117 -0
- data/features/support/app/WindowsForms/WindowsForms/Properties/Settings.Designer.cs +30 -0
- data/features/support/app/WindowsForms/WindowsForms/Properties/Settings.settings +7 -0
- data/features/support/app/WindowsForms/WindowsForms/SimpleElementsForm.Designer.cs +93 -0
- data/features/support/app/WindowsForms/WindowsForms/SimpleElementsForm.cs +19 -0
- data/features/support/app/WindowsForms/WindowsForms/SimpleElementsForm.resx +120 -0
- data/features/support/app/WindowsForms/WindowsForms/WindowsForms.csproj +132 -0
- data/features/support/app/WindowsForms/WindowsForms.sln +30 -0
- data/features/support/env.rb +28 -17
- data/features/support/screens/about_screen.rb +7 -0
- data/features/support/screens/data_entry_form.rb +5 -0
- data/features/support/screens/main_screen.rb +3 -0
- data/features/table.feature +14 -0
- data/features/tree_view.feature +3 -0
- data/lib/mohawk/accessors/button.rb +6 -4
- data/lib/mohawk/accessors/checkbox.rb +7 -5
- data/lib/mohawk/accessors/combo.rb +7 -5
- data/lib/mohawk/accessors/control.rb +23 -0
- data/lib/mohawk/accessors/label.rb +15 -13
- data/lib/mohawk/accessors/link.rb +9 -0
- data/lib/mohawk/accessors/radio.rb +5 -3
- data/lib/mohawk/accessors/table.rb +12 -31
- data/lib/mohawk/accessors/table_row.rb +43 -0
- data/lib/mohawk/accessors/text.rb +7 -5
- data/lib/mohawk/accessors/tree_view.rb +9 -7
- data/lib/mohawk/accessors.rb +66 -7
- data/lib/mohawk/adapters/uia_adapter.rb +8 -0
- data/lib/mohawk/core_ext/string.rb +5 -0
- data/lib/mohawk/navigation.rb +6 -2
- data/lib/mohawk/version.rb +3 -3
- data/lib/mohawk.rb +76 -69
- data/mohawk.gemspec +32 -26
- data/spec/lib/mohawk/accessors/button_spec.rb +4 -0
- data/spec/lib/mohawk/accessors/checkbox_spec.rb +4 -1
- data/spec/lib/mohawk/accessors/combo_spec.rb +3 -0
- data/spec/lib/mohawk/accessors/control_spec.rb +38 -0
- data/spec/lib/mohawk/accessors/label_spec.rb +29 -25
- data/spec/lib/mohawk/accessors/link_spec.rb +34 -0
- data/spec/lib/mohawk/accessors/radio_spec.rb +4 -0
- data/spec/lib/mohawk/accessors/table_spec.rb +52 -7
- data/spec/lib/mohawk/accessors/text_spec.rb +4 -0
- data/spec/lib/mohawk/accessors/tree_view_spec.rb +5 -0
- data/spec/lib/mohawk_spec.rb +19 -0
- data/spec/lib/navigation_spec.rb +5 -0
- metadata +175 -6
data/.gitignore
CHANGED
@@ -1,17 +1,24 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
.idea/
|
19
|
+
Debug/
|
20
|
+
Release/
|
21
|
+
bin/
|
22
|
+
obj/
|
23
|
+
*.pdb
|
24
|
+
*.suo
|
data/.travis.yml
CHANGED
data/Changelog
CHANGED
@@ -1,20 +1,36 @@
|
|
1
|
-
=== Version 0.
|
2
|
-
* Enhancements
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
* Added
|
15
|
-
*
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
1
|
+
=== Version 0.0.3 / 2013-04-26
|
2
|
+
* Enhancements
|
3
|
+
* Bumped the RAutomation dependency so we can now interact with controls
|
4
|
+
that do not have native window handles (i.e. WPF applications)
|
5
|
+
* Added a control accessor for working with generic controls
|
6
|
+
* Added _view methods to all accessors to access the underlying driver control
|
7
|
+
* Added Mohawk#wait_for_control to block until a child control appears
|
8
|
+
* Table improvements
|
9
|
+
* access row values by table_name[index]
|
10
|
+
* table is now Enumerable
|
11
|
+
* added ability to get table headers
|
12
|
+
* can get a value of a cell by the name of its header
|
13
|
+
* can select Table rows by their value as well
|
14
|
+
* Added Mohawk::Accessors#link to work with link controls
|
15
|
+
* added ability to define routes with the page_navigation gem
|
16
|
+
|
17
|
+
=== Version 0.0.2 / 2012-12-26
|
18
|
+
* Enhancements
|
19
|
+
* Added the following Mohawk module methods:
|
20
|
+
* active?
|
21
|
+
* has_text?
|
22
|
+
* present?
|
23
|
+
* wait_until
|
24
|
+
* wait_until_present
|
25
|
+
* Added more accessors for working with the following controls:
|
26
|
+
* label
|
27
|
+
* menu_item
|
28
|
+
* table
|
29
|
+
* tree_view
|
30
|
+
* Added method to text accessor to simulate typing into a field (helpful for masked edit controls)
|
31
|
+
* Enhanced navigation to wait until the Window is present before working with it
|
32
|
+
* Added aliases for table, combo_box and tree_view accessors
|
33
|
+
|
34
|
+
=== Version 0.0.1 / 2012-11-07
|
35
|
+
Initial release with support for text, button, combo, radio and checkbox
|
36
|
+
controls
|
data/Gemfile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
source 'http://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gemspec
|
data/Guardfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# Guardfile
|
2
|
+
notification :tmux,
|
3
|
+
:display_message => true,
|
4
|
+
:timeout => 5, # in seconds
|
5
|
+
:default_message_format => '%s >> %s',
|
6
|
+
:line_separator => ' > ', # since we are single line we need a separator
|
7
|
+
:color_location => 'status-left-bg' # to customize which tmux element will change color
|
8
|
+
|
9
|
+
guard 'rspec' do
|
10
|
+
watch(%r{^spec/.+_spec\.rb$})
|
11
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
12
|
+
watch('lib/mohawk/accessors.rb') { |m| "spec/lib/mohawk/accessors" }
|
13
|
+
watch(%r{^lib/mohawk/(.+)\.rb$}) { |m| "spec/lib/mohawk/#{m[1]}_spec.rb" }
|
14
|
+
watch(%r{^lib/mohawk/accessors/(.+)\.rb$}) { |m| "spec/lib/mohawk/accessors/#{m[1]}_spec.rb" }
|
15
|
+
watch('spec/spec_helper.rb') { "spec" }
|
16
|
+
end
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
Copyright (c) 2012 Levi Wilson
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
1
|
+
Copyright (c) 2012 Levi Wilson
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
22
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,56 +1,60 @@
|
|
1
|
-
# Mohawk
|
2
|
-
|
3
|
-
[![Build Status](https://travis-ci.org/leviwilson/mohawk.png)](https://travis-ci.org/leviwilson/mohawk)
|
4
|
-
|
5
|
-
A gem to assist in building page-object like structures for testing Windows applications.
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
$
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
1
|
+
# Mohawk
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/leviwilson/mohawk.png)](https://travis-ci.org/leviwilson/mohawk)
|
4
|
+
|
5
|
+
A gem to assist in building page-object like structures for testing Windows applications.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
### Runtime Environment
|
10
|
+
In order for `mohawk` to work, you need to have the [.NET 4.0 Framework](http://www.microsoft.com/en-us/download/details.aspx?id=24872) as well as the [C++ Runtime Redistributable](http://www.microsoft.com/en-us/download/details.aspx?id=5555).
|
11
|
+
|
12
|
+
### Ruby Environment
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
gem 'mohawk'
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install mohawk
|
24
|
+
|
25
|
+
## Example
|
26
|
+
|
27
|
+
### Defining a screen
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'mohawk'
|
31
|
+
|
32
|
+
class LoginScreen
|
33
|
+
include Mohawk
|
34
|
+
window(:title => /Login/)
|
35
|
+
|
36
|
+
text(:username, :id => "UserNameField")
|
37
|
+
text(:password, :id => "PasswordField")
|
38
|
+
|
39
|
+
button(:login, :value => "Login")
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
### Using the Page-Object
|
44
|
+
```ruby
|
45
|
+
World(Mohawk::Navigation)
|
46
|
+
|
47
|
+
on(LoginScreen) do |screen|
|
48
|
+
screen.username = "levi"
|
49
|
+
screen.password = "secret"
|
50
|
+
screen.login
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
## Contributing
|
55
|
+
|
56
|
+
1. Fork it
|
57
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
58
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
59
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
60
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
require 'rubygems'
|
4
|
-
require 'cucumber'
|
5
|
-
require 'cucumber/rake/task'
|
6
|
-
|
7
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
8
|
-
spec.ruby_opts = "-I lib:spec"
|
9
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
10
|
-
spec.rspec_opts = "--color -f documentation"
|
11
|
-
end
|
12
|
-
task :spec
|
13
|
-
|
14
|
-
Cucumber::Rake::Task.new(:features) do |t|
|
15
|
-
t.profile = 'default'
|
16
|
-
end
|
17
|
-
|
18
|
-
task :default => :spec
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'rubygems'
|
4
|
+
require 'cucumber'
|
5
|
+
require 'cucumber/rake/task'
|
6
|
+
|
7
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
8
|
+
spec.ruby_opts = "-I lib:spec"
|
9
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
10
|
+
spec.rspec_opts = "--color -f documentation"
|
11
|
+
end
|
12
|
+
task :spec
|
13
|
+
|
14
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
15
|
+
t.profile = 'default'
|
16
|
+
end
|
17
|
+
|
18
|
+
task :default => :spec
|
data/features/label.feature
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Feature: Working with label controls
|
2
|
-
|
3
|
-
Scenario: Getting the value of the control
|
4
|
-
Then I know that the "label control" has the value "This is a sample text"
|
1
|
+
Feature: Working with label controls
|
2
|
+
|
3
|
+
Scenario: Getting the value of the control
|
4
|
+
Then I know that the "label control" has the value "This is a sample text"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Feature: Working with link controls
|
2
|
+
|
3
|
+
Scenario: Getting the value of the link
|
4
|
+
Then I know that the "link control text" has the value "linkLabel1"
|
5
|
+
|
6
|
+
Scenario: Clicking on the link
|
7
|
+
When I click the "link control"
|
8
|
+
Then I know that the "link control text" has the value "linkLabel1 (clicked 1 times)"
|
9
|
+
|
data/features/mohawk.feature
CHANGED
@@ -8,7 +8,10 @@ Scenario: Determining if a window is active
|
|
8
8
|
When we are using the "MainScreen"
|
9
9
|
Then we know that the window is active
|
10
10
|
|
11
|
-
@wip
|
12
11
|
Scenario: Determining if a window has text
|
13
12
|
When we are using the "MainScreen"
|
14
13
|
Then we can confirm the window has the text "Assorted UI Elements"
|
14
|
+
|
15
|
+
Scenario: Waiting for a particular control
|
16
|
+
When we are using the "MainScreen"
|
17
|
+
Then we can wait for the control with a value of "Data Entry Form"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Feature: Navigating by way of routes
|
2
|
+
|
3
|
+
Scenario: Defining a route through the application
|
4
|
+
When we decide to go a roundabout way to the datagrid
|
5
|
+
Then we should still arrive at our destination
|
6
|
+
|
7
|
+
Scenario: Giving extra information to the screen
|
8
|
+
When we give extra navigational information to a screen
|
9
|
+
Then it should listen to every word that we say
|
@@ -1,3 +1,3 @@
|
|
1
|
-
Then /^I know that the "(.*?)" has the value "(.*?)"$/ do |name, value|
|
2
|
-
on(MainScreen).send(name.to_field).should eq(value)
|
3
|
-
end
|
1
|
+
Then /^I know that the "(.*?)" has the value "(.*?)"$/ do |name, value|
|
2
|
+
on(MainScreen).send(name.to_field).should eq(value)
|
3
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
When /^we decide to go a roundabout way to the datagrid$/ do
|
2
|
+
navigate_to(DataEntryForm)
|
3
|
+
end
|
4
|
+
|
5
|
+
Then /^we should still arrive at our destination$/ do
|
6
|
+
on(DataEntryForm).should be_active
|
7
|
+
end
|
8
|
+
|
9
|
+
When /^we give extra navigational information to a screen$/ do
|
10
|
+
@which_screen = on(MainScreen, :pid => @process.pid)
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /^it should listen to every word that we say$/ do
|
14
|
+
@which_screen.should be_present
|
15
|
+
end
|
@@ -6,18 +6,34 @@ end
|
|
6
6
|
Then /^the table row information should look like the following:$/ do |row_items|
|
7
7
|
row_items.map_column!("row") { |r| r.to_i }
|
8
8
|
row_items.map_headers!("text" => :text, "row" => :row)
|
9
|
-
on(DataEntryForm).
|
9
|
+
on(DataEntryForm).people.map(&:to_hash).should eq row_items.hashes
|
10
10
|
end
|
11
11
|
|
12
12
|
When /^we select the table row with index "(.*?)"$/ do |row_index|
|
13
13
|
on(DataEntryForm).people = row_index.to_i
|
14
14
|
end
|
15
15
|
|
16
|
+
When /^we select the table row with the value "([^"]*)"$/ do |row_value|
|
17
|
+
on(DataEntryForm).people = row_value
|
18
|
+
end
|
19
|
+
|
20
|
+
When /^we select the "(.*?)"th table row$/ do |index|
|
21
|
+
on(DataEntryForm).people[index.to_i].select
|
22
|
+
end
|
23
|
+
|
16
24
|
Then /^the row with index "(.*?)" should be selected$/ do |which_row|
|
17
|
-
on(DataEntryForm).
|
25
|
+
on(DataEntryForm).people[which_row.to_i].should be_selected
|
18
26
|
end
|
19
27
|
|
20
28
|
Then /^the row with index "(.*?)" should look like the following:$/ do |which_row, table|
|
21
|
-
actual_cells = on(DataEntryForm).
|
29
|
+
actual_cells = on(DataEntryForm).people[which_row.to_i].cells
|
22
30
|
actual_cells.should eq table.rows.first
|
23
31
|
end
|
32
|
+
|
33
|
+
Then /^the table headers are "(.*?)"$/ do |expected_headers|
|
34
|
+
on(DataEntryForm).people_headers.should eq(expected_headers.split(", "))
|
35
|
+
end
|
36
|
+
|
37
|
+
Then /^the "(.*?)" for the row at index "(.*?)" is "(.*?)"$/ do |header, which_row, expected_value|
|
38
|
+
on(DataEntryForm).people[which_row.to_i].send(header).should eq(expected_value)
|
39
|
+
end
|
Binary file
|
@@ -0,0 +1,80 @@
|
|
1
|
+
namespace WindowsForms
|
2
|
+
{
|
3
|
+
partial class AboutBox
|
4
|
+
{
|
5
|
+
/// <summary>
|
6
|
+
/// Required designer variable.
|
7
|
+
/// </summary>
|
8
|
+
private System.ComponentModel.IContainer components = null;
|
9
|
+
|
10
|
+
/// <summary>
|
11
|
+
/// Clean up any resources being used.
|
12
|
+
/// </summary>
|
13
|
+
protected override void Dispose(bool disposing)
|
14
|
+
{
|
15
|
+
if (disposing && (components != null))
|
16
|
+
{
|
17
|
+
components.Dispose();
|
18
|
+
}
|
19
|
+
base.Dispose(disposing);
|
20
|
+
}
|
21
|
+
|
22
|
+
#region Windows Form Designer generated code
|
23
|
+
|
24
|
+
/// <summary>
|
25
|
+
/// Required method for Designer support - do not modify
|
26
|
+
/// the contents of this method with the code editor.
|
27
|
+
/// </summary>
|
28
|
+
private void InitializeComponent()
|
29
|
+
{
|
30
|
+
this.label1 = new System.Windows.Forms.Label();
|
31
|
+
this.button1 = new System.Windows.Forms.Button();
|
32
|
+
this.SuspendLayout();
|
33
|
+
//
|
34
|
+
// label1
|
35
|
+
//
|
36
|
+
this.label1.AutoSize = true;
|
37
|
+
this.label1.Location = new System.Drawing.Point(12, 9);
|
38
|
+
this.label1.Name = "label1";
|
39
|
+
this.label1.Size = new System.Drawing.Size(303, 13);
|
40
|
+
this.label1.TabIndex = 0;
|
41
|
+
this.label1.Text = "This is the about dialog for the RAutomation sample application";
|
42
|
+
//
|
43
|
+
// button1
|
44
|
+
//
|
45
|
+
this.button1.Location = new System.Drawing.Point(141, 80);
|
46
|
+
this.button1.Name = "button1";
|
47
|
+
this.button1.Size = new System.Drawing.Size(75, 23);
|
48
|
+
this.button1.TabIndex = 1;
|
49
|
+
this.button1.Text = "OK";
|
50
|
+
this.button1.UseVisualStyleBackColor = true;
|
51
|
+
this.button1.Click += new System.EventHandler(this.button1_Click);
|
52
|
+
//
|
53
|
+
// AboutBox
|
54
|
+
//
|
55
|
+
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
56
|
+
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
57
|
+
this.ClientSize = new System.Drawing.Size(339, 115);
|
58
|
+
this.Controls.Add(this.button1);
|
59
|
+
this.Controls.Add(this.label1);
|
60
|
+
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
61
|
+
this.MaximizeBox = false;
|
62
|
+
this.MinimizeBox = false;
|
63
|
+
this.Name = "AboutBox";
|
64
|
+
this.Padding = new System.Windows.Forms.Padding(9);
|
65
|
+
this.ShowIcon = false;
|
66
|
+
this.ShowInTaskbar = false;
|
67
|
+
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
68
|
+
this.Text = "About";
|
69
|
+
this.ResumeLayout(false);
|
70
|
+
this.PerformLayout();
|
71
|
+
|
72
|
+
}
|
73
|
+
|
74
|
+
#endregion
|
75
|
+
|
76
|
+
private System.Windows.Forms.Label label1;
|
77
|
+
private System.Windows.Forms.Button button1;
|
78
|
+
|
79
|
+
}
|
80
|
+
}
|
@@ -0,0 +1,103 @@
|
|
1
|
+
using System;
|
2
|
+
using System.Collections.Generic;
|
3
|
+
using System.ComponentModel;
|
4
|
+
using System.Drawing;
|
5
|
+
using System.Linq;
|
6
|
+
using System.Reflection;
|
7
|
+
using System.Windows.Forms;
|
8
|
+
|
9
|
+
namespace WindowsForms
|
10
|
+
{
|
11
|
+
partial class AboutBox : Form
|
12
|
+
{
|
13
|
+
public AboutBox()
|
14
|
+
{
|
15
|
+
InitializeComponent();
|
16
|
+
}
|
17
|
+
|
18
|
+
#region Assembly Attribute Accessors
|
19
|
+
|
20
|
+
public string AssemblyTitle
|
21
|
+
{
|
22
|
+
get
|
23
|
+
{
|
24
|
+
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
|
25
|
+
if (attributes.Length > 0)
|
26
|
+
{
|
27
|
+
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
|
28
|
+
if (titleAttribute.Title != "")
|
29
|
+
{
|
30
|
+
return titleAttribute.Title;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
public string AssemblyVersion
|
38
|
+
{
|
39
|
+
get
|
40
|
+
{
|
41
|
+
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
public string AssemblyDescription
|
46
|
+
{
|
47
|
+
get
|
48
|
+
{
|
49
|
+
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
|
50
|
+
if (attributes.Length == 0)
|
51
|
+
{
|
52
|
+
return "";
|
53
|
+
}
|
54
|
+
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
public string AssemblyProduct
|
59
|
+
{
|
60
|
+
get
|
61
|
+
{
|
62
|
+
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
|
63
|
+
if (attributes.Length == 0)
|
64
|
+
{
|
65
|
+
return "";
|
66
|
+
}
|
67
|
+
return ((AssemblyProductAttribute)attributes[0]).Product;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
public string AssemblyCopyright
|
72
|
+
{
|
73
|
+
get
|
74
|
+
{
|
75
|
+
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
|
76
|
+
if (attributes.Length == 0)
|
77
|
+
{
|
78
|
+
return "";
|
79
|
+
}
|
80
|
+
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
public string AssemblyCompany
|
85
|
+
{
|
86
|
+
get
|
87
|
+
{
|
88
|
+
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
|
89
|
+
if (attributes.Length == 0)
|
90
|
+
{
|
91
|
+
return "";
|
92
|
+
}
|
93
|
+
return ((AssemblyCompanyAttribute)attributes[0]).Company;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
#endregion
|
97
|
+
|
98
|
+
private void button1_Click(object sender, EventArgs e)
|
99
|
+
{
|
100
|
+
this.Close();
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|