mohawk 0.2.1 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/Changelog +5 -0
  2. data/lib/mohawk/accessors.rb +16 -0
  3. data/lib/mohawk/adapters/uia/text_box.rb +5 -1
  4. data/lib/mohawk/adapters/uia/window.rb +12 -7
  5. data/lib/mohawk/version.rb +1 -1
  6. data/mohawk.gemspec +2 -2
  7. data/spec/lib/mohawk/button_spec.rb +14 -0
  8. data/spec/lib/mohawk/checkbox_spec.rb +23 -0
  9. data/spec/lib/mohawk/combo_box_spec.rb +52 -0
  10. data/spec/lib/mohawk/control_spec.rb +17 -0
  11. data/spec/lib/mohawk/label_spec.rb +8 -0
  12. data/spec/lib/mohawk/link_spec.rb +16 -0
  13. data/spec/lib/mohawk/menu_spec.rb +20 -0
  14. data/spec/lib/mohawk/navigation_spec.rb +25 -0
  15. data/spec/lib/mohawk/radio_spec.rb +22 -0
  16. data/spec/lib/mohawk/spinner_spec.rb +31 -0
  17. data/spec/lib/mohawk/text_spec.rb +40 -0
  18. data/spec/lib/mohawk/tree_view_spec.rb +54 -0
  19. data/spec/lib/mohawk/window_spec.rb +84 -0
  20. data/spec/lib/mohawk_spec.rb +25 -0
  21. data/spec/screens/about.rb +7 -0
  22. data/spec/screens/data_entry_form.rb +4 -0
  23. data/spec/screens/main_form.rb +32 -0
  24. data/spec/spec_helper.rb +19 -1
  25. data/spec/tabs_spec.rb +26 -0
  26. metadata +44 -68
  27. data/features/button.feature +0 -10
  28. data/features/checkbox.feature +0 -12
  29. data/features/combo_box.feature +0 -44
  30. data/features/control.feature +0 -9
  31. data/features/label.feature +0 -4
  32. data/features/link.feature +0 -9
  33. data/features/menu.feature +0 -13
  34. data/features/mohawk.feature +0 -25
  35. data/features/navigation.feature +0 -9
  36. data/features/radio.feature +0 -5
  37. data/features/spinner.feature +0 -12
  38. data/features/step_definitions/button_steps.rb +0 -15
  39. data/features/step_definitions/checkbox_steps.rb +0 -19
  40. data/features/step_definitions/combo_box_steps.rb +0 -48
  41. data/features/step_definitions/control_steps.rb +0 -11
  42. data/features/step_definitions/label_steps.rb +0 -3
  43. data/features/step_definitions/link_steps.rb +0 -3
  44. data/features/step_definitions/menu_steps.rb +0 -10
  45. data/features/step_definitions/mohawk_steps.rb +0 -35
  46. data/features/step_definitions/navigation_steps.rb +0 -15
  47. data/features/step_definitions/radio_steps.rb +0 -7
  48. data/features/step_definitions/spinner_steps.rb +0 -18
  49. data/features/step_definitions/tabs_steps.rb +0 -23
  50. data/features/step_definitions/text_steps.rb +0 -15
  51. data/features/step_definitions/tree_view_steps.rb +0 -35
  52. data/features/tabs.feature +0 -22
  53. data/features/text.feature +0 -18
  54. data/features/tree_view.feature +0 -52
  55. data/spec/ffi_stub.rb +0 -16
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mohawk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: '0.3'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-14 00:00:00.000000000 Z
12
+ date: 2014-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: uia
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '0.4'
21
+ version: 0.4.4
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: '0.4'
29
+ version: 0.4.4
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: require_all
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 0.3.9
69
+ version: '0.5'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: 0.3.9
77
+ version: '0.5'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: cucumber
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -255,32 +255,7 @@ files:
255
255
  - README.md
256
256
  - Rakefile
257
257
  - cucumber.yml
258
- - features/button.feature
259
- - features/checkbox.feature
260
- - features/combo_box.feature
261
- - features/control.feature
262
- - features/label.feature
263
- - features/link.feature
264
- - features/menu.feature
265
- - features/mohawk.feature
266
- - features/navigation.feature
267
- - features/radio.feature
268
- - features/spinner.feature
269
- - features/step_definitions/button_steps.rb
270
- - features/step_definitions/checkbox_steps.rb
271
- - features/step_definitions/combo_box_steps.rb
272
- - features/step_definitions/control_steps.rb
273
- - features/step_definitions/label_steps.rb
274
- - features/step_definitions/link_steps.rb
275
- - features/step_definitions/menu_steps.rb
276
- - features/step_definitions/mohawk_steps.rb
277
- - features/step_definitions/navigation_steps.rb
278
- - features/step_definitions/radio_steps.rb
279
- - features/step_definitions/spinner_steps.rb
280
258
  - features/step_definitions/table_steps.rb
281
- - features/step_definitions/tabs_steps.rb
282
- - features/step_definitions/text_steps.rb
283
- - features/step_definitions/tree_view_steps.rb
284
259
  - features/support/FizzWare.NBuilder.dll
285
260
  - features/support/UIA.Extensions.dll
286
261
  - features/support/WindowsForms.exe
@@ -317,9 +292,6 @@ files:
317
292
  - features/support/screens/screen_with_container.rb
318
293
  - features/support/string.rb
319
294
  - features/table.feature
320
- - features/tabs.feature
321
- - features/text.feature
322
- - features/tree_view.feature
323
295
  - lib/mohawk.rb
324
296
  - lib/mohawk/accessors.rb
325
297
  - lib/mohawk/adapters/uia/button.rb
@@ -344,13 +316,29 @@ files:
344
316
  - lib/mohawk/waiter.rb
345
317
  - lib/mohawk/win_32.rb
346
318
  - mohawk.gemspec
347
- - spec/ffi_stub.rb
348
319
  - spec/lib/mohawk/adapters/uia/control_spec.rb
349
320
  - spec/lib/mohawk/adapters/uia/table_row_spec.rb
321
+ - spec/lib/mohawk/button_spec.rb
322
+ - spec/lib/mohawk/checkbox_spec.rb
323
+ - spec/lib/mohawk/combo_box_spec.rb
324
+ - spec/lib/mohawk/control_spec.rb
325
+ - spec/lib/mohawk/label_spec.rb
326
+ - spec/lib/mohawk/link_spec.rb
327
+ - spec/lib/mohawk/menu_spec.rb
328
+ - spec/lib/mohawk/navigation_spec.rb
329
+ - spec/lib/mohawk/radio_spec.rb
330
+ - spec/lib/mohawk/spinner_spec.rb
331
+ - spec/lib/mohawk/text_spec.rb
332
+ - spec/lib/mohawk/tree_view_spec.rb
350
333
  - spec/lib/mohawk/waiter_spec.rb
334
+ - spec/lib/mohawk/window_spec.rb
351
335
  - spec/lib/mohawk_spec.rb
352
336
  - spec/lib/navigation_spec.rb
337
+ - spec/screens/about.rb
338
+ - spec/screens/data_entry_form.rb
339
+ - spec/screens/main_form.rb
353
340
  - spec/spec_helper.rb
341
+ - spec/tabs_spec.rb
354
342
  homepage: http://github.com/leviwilson/mohawk
355
343
  licenses:
356
344
  - MIT
@@ -366,7 +354,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
366
354
  version: '0'
367
355
  segments:
368
356
  - 0
369
- hash: 2622237
357
+ hash: 402393491
370
358
  required_rubygems_version: !ruby/object:Gem::Requirement
371
359
  none: false
372
360
  requirements:
@@ -375,7 +363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
363
  version: '0'
376
364
  segments:
377
365
  - 0
378
- hash: 2622237
366
+ hash: 402393491
379
367
  requirements: []
380
368
  rubyforge_project:
381
369
  rubygems_version: 1.8.28
@@ -383,32 +371,7 @@ signing_key:
383
371
  specification_version: 3
384
372
  summary: Provides a page-object style driver for automating Windows applications
385
373
  test_files:
386
- - features/button.feature
387
- - features/checkbox.feature
388
- - features/combo_box.feature
389
- - features/control.feature
390
- - features/label.feature
391
- - features/link.feature
392
- - features/menu.feature
393
- - features/mohawk.feature
394
- - features/navigation.feature
395
- - features/radio.feature
396
- - features/spinner.feature
397
- - features/step_definitions/button_steps.rb
398
- - features/step_definitions/checkbox_steps.rb
399
- - features/step_definitions/combo_box_steps.rb
400
- - features/step_definitions/control_steps.rb
401
- - features/step_definitions/label_steps.rb
402
- - features/step_definitions/link_steps.rb
403
- - features/step_definitions/menu_steps.rb
404
- - features/step_definitions/mohawk_steps.rb
405
- - features/step_definitions/navigation_steps.rb
406
- - features/step_definitions/radio_steps.rb
407
- - features/step_definitions/spinner_steps.rb
408
374
  - features/step_definitions/table_steps.rb
409
- - features/step_definitions/tabs_steps.rb
410
- - features/step_definitions/text_steps.rb
411
- - features/step_definitions/tree_view_steps.rb
412
375
  - features/support/FizzWare.NBuilder.dll
413
376
  - features/support/UIA.Extensions.dll
414
377
  - features/support/WindowsForms.exe
@@ -445,13 +408,26 @@ test_files:
445
408
  - features/support/screens/screen_with_container.rb
446
409
  - features/support/string.rb
447
410
  - features/table.feature
448
- - features/tabs.feature
449
- - features/text.feature
450
- - features/tree_view.feature
451
- - spec/ffi_stub.rb
452
411
  - spec/lib/mohawk/adapters/uia/control_spec.rb
453
412
  - spec/lib/mohawk/adapters/uia/table_row_spec.rb
413
+ - spec/lib/mohawk/button_spec.rb
414
+ - spec/lib/mohawk/checkbox_spec.rb
415
+ - spec/lib/mohawk/combo_box_spec.rb
416
+ - spec/lib/mohawk/control_spec.rb
417
+ - spec/lib/mohawk/label_spec.rb
418
+ - spec/lib/mohawk/link_spec.rb
419
+ - spec/lib/mohawk/menu_spec.rb
420
+ - spec/lib/mohawk/navigation_spec.rb
421
+ - spec/lib/mohawk/radio_spec.rb
422
+ - spec/lib/mohawk/spinner_spec.rb
423
+ - spec/lib/mohawk/text_spec.rb
424
+ - spec/lib/mohawk/tree_view_spec.rb
454
425
  - spec/lib/mohawk/waiter_spec.rb
426
+ - spec/lib/mohawk/window_spec.rb
455
427
  - spec/lib/mohawk_spec.rb
456
428
  - spec/lib/navigation_spec.rb
429
+ - spec/screens/about.rb
430
+ - spec/screens/data_entry_form.rb
431
+ - spec/screens/main_form.rb
457
432
  - spec/spec_helper.rb
433
+ - spec/tabs_spec.rb
@@ -1,10 +0,0 @@
1
- Feature: Working with button controls
2
-
3
- Scenario: Clicking buttons
4
- When I click the "Data Entry Form" button
5
- Then I should see the "DataEntryForm" window
6
-
7
- Scenario: Getting button values
8
- When I look at the value of the "Data Entry Form button" control
9
- Then the value should be "Data Entry Form"
10
-
@@ -1,12 +0,0 @@
1
- Feature: Working with checkbox controls
2
-
3
- Scenario: Setting the checkbox
4
- When I check the "first checkbox"
5
- Then the "first checkbox" should be checked
6
-
7
- Scenario: Clearing the checkbox
8
- When I uncheck the "first checkbox"
9
- Then the "first checkbox" should not be checked
10
-
11
- Scenario: Getting the value of the checkbox
12
- Then I know that the "first checkbox" value is "checkBox"
@@ -1,44 +0,0 @@
1
- Feature: Working with combo boxes
2
-
3
- Scenario: Selecting items by index
4
- When I select index "2" from the "fruits" combo box
5
- Then the "Coconut" option should be selected in the "fruits" combo box
6
-
7
- Scenario: Selecting items by value
8
- When I select the value "Orange" from the "fruits" combo box
9
- Then the "Orange" option should be selected in the "fruits" combo box
10
-
11
- Scenario: Selecting items by regex
12
- When I select the regex value "[Or]an" from the "fruits" combo box
13
- Then the "Orange" option should be selected in the "fruits" combo box
14
-
15
- Scenario: Selecting multiple items
16
- Given we toggle the multi-select button
17
- When I select indexes "0, 1, 2" from the "fruits_list" combo box
18
- Then the "Apple, Orange, Mango" options should be selected in the "fruits_list" combo box
19
-
20
- Scenario: Clearing items by index
21
- Given we toggle the multi-select button
22
- When I select indexes "0, 1, 2" from the "fruits_list" combo box
23
- But I clear the item at index "1" from the "fruits_list" combo box
24
- Then the "Apple, Mango" options should be selected in the "fruits_list" combo box
25
-
26
- Scenario: Clearing items by value
27
- Given we toggle the multi-select button
28
- When I select indexes "0, 1, 2" from the "fruits_list" combo box
29
- But I clear item "Mango" from the "fruits_list" combo box
30
- Then the "Apple, Orange" options should be selected in the "fruits_list" combo box
31
-
32
- Scenario: Getting the available options
33
- When I look at the options for the "fruits" combo box"
34
- Then I should see the following options:
35
- | Option |
36
- | Apple |
37
- | Caimito |
38
- | Coconut |
39
- | Orange |
40
- | Passion Fruit |
41
-
42
- Scenario: Interacting with ListBox controls
43
- When I select the value "Orange" from the "fruits_list" combo box
44
- Then the application should know that "Orange" was selected
@@ -1,9 +0,0 @@
1
- Feature: Working with controls
2
-
3
- Scenario: Getting and setting the value of value controls
4
- When I set the "value control field" to the value "12/25/2012"
5
- Then the value of the "value control field" control should be "12/25/2012 12:00:00 AM"
6
-
7
- Scenario: Clicking controls
8
- When I click the control identified by "about_control"
9
- Then the "About" screen should be shown
@@ -1,4 +0,0 @@
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,9 +0,0 @@
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
-
@@ -1,13 +0,0 @@
1
- Feature: Working with menu items
2
-
3
- Scenario: Selecting a menu item by text
4
- When I select the menu item by text
5
- Then I should see the "About" window
6
-
7
- Scenario: Selecting an item from the menu
8
- When I select the menu item in the path "File | Roundabout Way | To | About"
9
- Then I should see the "About" window
10
-
11
- Scenario: Clicking an item from the menu
12
- When I click the menu item in the path "File | Roundabout Way | To | About"
13
- Then I should see the "About" window
@@ -1,25 +0,0 @@
1
- Feature: Using Mohawk
2
-
3
- Scenario: Determining if a window exists
4
- When we are using the "MainScreen"
5
- Then the window should exist
6
-
7
- Scenario: Determining if a window is active
8
- When we are using the "MainScreen"
9
- Then we know that the window is active
10
-
11
- Scenario: Determining if a window has text
12
- When we are using the "MainScreen"
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"
18
-
19
- Scenario: Specifying a parent container
20
- When we are using the "ScreenWithContainer"
21
- Then our parent is the container, not the main window
22
-
23
- Scenario: Forcing the search scope to children only
24
- When we tell the screen to limit searches to children only
25
- Then we notice a performance increase, especially when data grid views are involved
@@ -1,9 +0,0 @@
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,5 +0,0 @@
1
- Feature: Working with radio controls
2
-
3
- Scenario: Setting and getting radio button values
4
- When I set the "first radio"
5
- Then the "first radio" should be set
@@ -1,12 +0,0 @@
1
- Feature: Spinner controls
2
-
3
- Scenario: Getting and setting spinner values
4
- Then I can set the spinner to "50.8"
5
-
6
- Scenario: Incrementing the spinner
7
- When the spinner is set to "10.0"
8
- Then we can crank it up to "11.0"
9
-
10
- Scenario: Decrementing the spinner
11
- When the spinner is set to "40.3"
12
- Then we can knock it down to "39.3"
@@ -1,15 +0,0 @@
1
- When /^I click the "(.*?)" button$/ do |name|
2
- on(MainScreen).send "#{name.to_field}_button"
3
- end
4
-
5
- Then /^I should see the "(.*?)" window$/ do |window_title|
6
- Mohawk::Waiter.wait_until { Uia.find_element title: window_title }
7
- end
8
-
9
- When /^I look at the value of the "(.*?)" control$/ do |name|
10
- @last_value = on(MainScreen).send "#{name.to_field}_value"
11
- end
12
-
13
- Then /^the value should be "(.*?)"$/ do |value|
14
- @last_value.should eq(value)
15
- end
@@ -1,19 +0,0 @@
1
- When /^I check the "(.*?)"$/ do |name|
2
- on(MainScreen).send "#{name.to_field}=", true
3
- end
4
-
5
- When /^I uncheck the "(.*?)"$/ do |name|
6
- on(MainScreen).send "#{name.to_field}=", false
7
- end
8
-
9
- Then /^the "(.*?)" should be checked$/ do |name|
10
- on(MainScreen).send("#{name.to_field}").should be_true
11
- end
12
-
13
- Then /^the "(.*?)" should not be checked$/ do |name|
14
- on(MainScreen).send("#{name.to_field}").should be_false
15
- end
16
-
17
- Then /^I know that the "(.*?)" value is "(.*?)"$/ do |name, expected_value|
18
- on(MainScreen).send("#{name.to_field}_value").should eq(expected_value)
19
- end
@@ -1,48 +0,0 @@
1
- When /^I select index(es)? "(.*?)" from the "(.*?)" combo box$/ do |_, indexes, name|
2
- on(MainScreen) do |screen|
3
- indexes.split(', ').map(&:to_i).each do |index|
4
- screen.send "select_#{name.to_field}", index
5
- end
6
- end
7
- end
8
-
9
- When /^I select the value "(.*?)" from the "(.*?)" combo box$/ do |index, name|
10
- on(MainScreen).send "#{name.to_field}=", index
11
- end
12
-
13
- When(/^I select the regex value "([^"]*)" from the "([^"]*)" combo box$/) do |regex, name|
14
- on(MainScreen).send "#{name.to_field}=", /#{regex}/
15
- end
16
-
17
- When(/^I clear the item at index "([^"]*)" from the "([^"]*)" combo box$/) do |which, name|
18
- on(MainScreen).send("clear_#{name.to_field}", which.to_i)
19
- end
20
-
21
- When(/^I clear item "([^"]*)" from the "([^"]*)" combo box$/) do |which, name|
22
- on(MainScreen).send("clear_#{name.to_field}", which)
23
- end
24
-
25
- Then /^the "(.*?)" option(s)? should be selected in the "(.*?)" combo box$/ do |value, has_multiple, name|
26
- if has_multiple
27
- on(MainScreen).send("#{name.to_field}_selections").should eq(value.split(', '))
28
- else
29
- on(MainScreen).send("#{name.to_field}").should eq(value)
30
- end
31
- end
32
-
33
- When /^I look at the options for the "(.*?)" combo box"$/ do |name|
34
- @options = on(MainScreen).send("#{name.to_field}_options")
35
- end
36
-
37
- Then /^I should see the following options:$/ do |table|
38
- expected_options = table.hashes.map {|row| row["Option"] }
39
- @options.should eq(expected_options)
40
- end
41
-
42
- Given(/^we toggle the multi-select button$/) do
43
- on(MainScreen).toggle_multi
44
- end
45
-
46
- Then(/^the application should know that "([^"]*)" was selected$/) do |expected_value|
47
- on(MainScreen).fruits_label.should eq(expected_value)
48
- end
@@ -1,11 +0,0 @@
1
- Then /^the value of the "([^"]*)" control should be "(.*?)"$/ do |which, what|
2
- on(MainScreen).send("#{which.to_method}_value").should eq(what)
3
- end
4
-
5
- When(/^I click the control identified by "([^"]*)"$/) do |what|
6
- on(MainScreen).send("click_#{what}")
7
- end
8
-
9
- Then(/^the "([^"]*)" screen should be shown$/) do |screen|
10
- on(AboutScreen).should be_present
11
- end
@@ -1,3 +0,0 @@
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,3 +0,0 @@
1
- When /^I click the "([^"]*)"$/ do |name|
2
- on(MainScreen).send("click_#{name.to_field}")
3
- end
@@ -1,10 +0,0 @@
1
- When(/^I select the menu item by text$/) do
2
- on(MainScreen).menu_item_by_text
3
- end
4
-
5
- When /^I (select|click) the menu item in the path "(.*?)"$/ do |select_or_click, menu_path|
6
- menu_item_method = menu_path.gsub(/ (\| )?/, "_").downcase
7
- menu_item_method.prepend('click_') if select_or_click == 'click'
8
- on(MainScreen).send menu_item_method
9
- end
10
-
@@ -1,35 +0,0 @@
1
- When /^we are using the "(.*?)"$/ do |expected_screen|
2
- @screen = on(expected_screen.to_class)
3
- end
4
-
5
- Then /^the window should exist$/ do
6
- @screen.should exist
7
- end
8
-
9
- Then /^we know that the window is active$/ do
10
- @screen.should be_active
11
- end
12
-
13
- Then /^we can confirm the window has the text "(.*?)"$/ do |what_text|
14
- @screen.should have_text(what_text)
15
- end
16
-
17
- Then /^we can wait for the control with a value of "(.*?)"$/ do |value|
18
- @screen.wait_for_control :value => value
19
- end
20
-
21
- Then /^our parent is the container, not the main window$/ do
22
- @screen.adapter.window.title.should_not match(/MainForm/)
23
- @screen.up_view.control_name.should eq('Forward')
24
- end
25
-
26
- When(/^we tell the screen to limit searches to children only$/) do
27
- on(MainScreen).data_grid
28
- on(ScreenScopedToChildren).should be_active
29
- end
30
-
31
- Then(/^we notice a performance increase, especially when data grid views are involved$/) do
32
- start = Time.now
33
- on(ScreenScopedToChildren).close
34
- (Time.now - start).should be < 2
35
- end
@@ -1,15 +0,0 @@
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 => Mohawk.app.pid)
11
- end
12
-
13
- Then /^it should listen to every word that we say$/ do
14
- @which_screen.should be_present
15
- end
@@ -1,7 +0,0 @@
1
- When /^I set the "([^\"]*)"$/ do |name|
2
- on(MainScreen).send name.to_field
3
- end
4
-
5
- Then /^the "(.*?)" should be set$/ do |name|
6
- on(MainScreen).send("#{name.to_field}?").should be_true
7
- end
@@ -1,18 +0,0 @@
1
- Then(/^I can set the spinner to "([^"]*)"$/) do |value|
2
- on(MainScreen) do |screen|
3
- screen.spinner = value.to_f
4
- screen.spinner.should eq(value.to_f)
5
- end
6
- end
7
-
8
- When(/^the spinner is set to "([^"]*)"$/) do |value|
9
- on(MainScreen).spinner = value.to_f
10
- end
11
-
12
- Then(/^we can crank it up to "([^"]*)"$/) do |expected_value|
13
- on(MainScreen).increment_spinner.should eq(expected_value.to_f)
14
- end
15
-
16
- Then(/^we can knock it down to "([^"]*)"$/) do |expected_value|
17
- on(MainScreen).decrement_spinner.should eq(expected_value.to_f)
18
- end
@@ -1,23 +0,0 @@
1
- Given(/^we are looking at the about screen$/) do
2
- on(MainScreen).about
3
- end
4
-
5
- Then(/^we know that the currently selected tab is "([^"]*)"$/) do |expected_tab|
6
- on(AboutScreen).tab.should eq(expected_tab)
7
- end
8
-
9
- Then(/^we know that the available tabs are "([^"]*)"$/) do |tabs|
10
- on(AboutScreen).tab_items.should eq(tabs.split(', '))
11
- end
12
-
13
- When(/^we select the tab at index "([^"]*)"$/) do |tab_index|
14
- on(AboutScreen).tab = tab_index.to_i
15
- end
16
-
17
- When(/^we select the tab with the text "([^"]*)"$/) do |which|
18
- on(AboutScreen).tab = which
19
- end
20
-
21
- When(/^we select the tab with the regex "([^"]*)"$/) do |which_regex|
22
- on(AboutScreen).tab = /#{which_regex}/
23
- end
@@ -1,15 +0,0 @@
1
- When /^I set the "(.*)" to the value "(.*)"$/ do |name, value|
2
- on(MainScreen).send "#{name.to_field}=", value
3
- end
4
-
5
- When /^I enter into "(.*?)" the values "(.*?)"$/ do |name, value|
6
- on(MainScreen).send "enter_#{name.to_field}", value
7
- end
8
-
9
- When /^I clear the "(.*)"$/ do |name|
10
- on(MainScreen).send "clear_#{name.to_field}"
11
- end
12
-
13
- Then /^the "(.*)" should be "(.*)"$/ do |name, value|
14
- on(MainScreen).send("#{name.to_field}").should eq(value)
15
- end
@@ -1,35 +0,0 @@
1
- When /^I select the item with index "(.*?)" in the TreeView$/ do |which_index|
2
- on(MainScreen).tree_view = which_index.to_i
3
- end
4
-
5
- When /^I select the item "(.*?)" in the TreeView$/ do |expected_value|
6
- on(MainScreen).tree_view = expected_value
7
- end
8
-
9
- Then /^the selected TreeView value should be "(.*?)"$/ do |expected_value|
10
- on(MainScreen).tree_view.should eq expected_value
11
- end
12
-
13
- Then /^the available tree items should be:$/ do |tree_items|
14
- on(MainScreen).tree_view_items.should eq tree_items.rows.flatten
15
- end
16
-
17
- When /^I expand the tree item with index "(.*?)"$/ do |which_index|
18
- on(MainScreen).expand_tree_view_item which_index.to_i
19
- end
20
-
21
- When /^I expand the tree item "(.*?)"$/ do |which_item|
22
- on(MainScreen).expand_tree_view_item which_item
23
- end
24
-
25
- When /^I collapse the tree item with index "(.*?)"$/ do |which_index|
26
- on(MainScreen).collapse_tree_view_item which_index.to_i
27
- end
28
-
29
- When /^I collapse the tree item "(.*?)"$/ do |which_item|
30
- on(MainScreen).collapse_tree_view_item which_item
31
- end
32
-
33
- Then /^I am able to interact with the raw tree view$/ do
34
- on(MainScreen).tree_view_view.should be_visible
35
- end