funfx 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/History.txt +18 -0
  2. data/License.txt +20 -0
  3. data/Manifest.txt +87 -0
  4. data/README.txt +48 -0
  5. data/Rakefile +5 -0
  6. data/config/hoe.rb +67 -0
  7. data/config/requirements.rb +15 -0
  8. data/ext/FunFX.swc +0 -0
  9. data/lib/funfx.rb +34 -0
  10. data/lib/funfx/browser/firewatir.rb +47 -0
  11. data/lib/funfx/browser/flex_app_lookup.rb +22 -0
  12. data/lib/funfx/browser/safariwatir.rb +47 -0
  13. data/lib/funfx/browser/watir.rb +41 -0
  14. data/lib/funfx/decoder.rb +67 -0
  15. data/lib/funfx/flex/element.rb +161 -0
  16. data/lib/funfx/flex/elements.rb +2712 -0
  17. data/lib/funfx/flex/flex_app_id.rb +15 -0
  18. data/lib/funfx/flex/tabular_data.rb +22 -0
  19. data/lib/funfx/meta/class_dot.erb +24 -0
  20. data/lib/funfx/meta/code.erb +33 -0
  21. data/lib/funfx/meta/generator.rb +18 -0
  22. data/lib/funfx/meta/parser.rb +190 -0
  23. data/lib/funfx/version.rb +9 -0
  24. data/rake_tasks/deployment.rake +34 -0
  25. data/rake_tasks/environment.rake +7 -0
  26. data/rake_tasks/generation.rake +37 -0
  27. data/rake_tasks/hoe_ext.rake +11 -0
  28. data/rake_tasks/rspec.rake +28 -0
  29. data/script/console +10 -0
  30. data/script/console.cmd +1 -0
  31. data/script/destroy +14 -0
  32. data/script/destroy.cmd +1 -0
  33. data/script/generate +14 -0
  34. data/script/generate.cmd +1 -0
  35. data/script/txt2html +82 -0
  36. data/script/txt2html.cmd +1 -0
  37. data/setup.rb +1585 -0
  38. data/spec/funfx/demo_app/accordion_spec.rb +38 -0
  39. data/spec/funfx/demo_app/advanced_data_grid_spec.rb +74 -0
  40. data/spec/funfx/demo_app/alert_spec.rb +33 -0
  41. data/spec/funfx/demo_app/button_bar_spec.rb +21 -0
  42. data/spec/funfx/demo_app/button_spec.rb +68 -0
  43. data/spec/funfx/demo_app/check_box_spec.rb +62 -0
  44. data/spec/funfx/demo_app/control_bar_spec.rb +19 -0
  45. data/spec/funfx/demo_app/controls_with_same_id_spec.rb +37 -0
  46. data/spec/funfx/demo_app/data_grid_editable_spec.rb +78 -0
  47. data/spec/funfx/demo_app/data_grid_spec.rb +65 -0
  48. data/spec/funfx/demo_app/date_chooser_spec.rb +67 -0
  49. data/spec/funfx/demo_app/date_field_spec.rb +36 -0
  50. data/spec/funfx/demo_app/form_spec.rb +22 -0
  51. data/spec/funfx/demo_app/grid_layout_spec.rb +23 -0
  52. data/spec/funfx/demo_app/h_scrollbar_spec.rb +25 -0
  53. data/spec/funfx/demo_app/h_slider_spec.rb +21 -0
  54. data/spec/funfx/demo_app/horizontal_list_spec.rb +24 -0
  55. data/spec/funfx/demo_app/label_spec.rb +18 -0
  56. data/spec/funfx/demo_app/link_bar_spec.rb +57 -0
  57. data/spec/funfx/demo_app/link_button_spec.rb +21 -0
  58. data/spec/funfx/demo_app/list_spec.rb +23 -0
  59. data/spec/funfx/demo_app/menu_bar_spec.rb +33 -0
  60. data/spec/funfx/demo_app/menu_spec.rb +27 -0
  61. data/spec/funfx/demo_app/numeric_stepper_spec.rb +37 -0
  62. data/spec/funfx/demo_app/popup_button_spec.rb +36 -0
  63. data/spec/funfx/demo_app/popup_menu_bar_spec.rb +42 -0
  64. data/spec/funfx/demo_app/progress_bar_spec.rb +24 -0
  65. data/spec/funfx/demo_app/radio_button_group_spec.rb +50 -0
  66. data/spec/funfx/demo_app/radio_button_spec.rb +26 -0
  67. data/spec/funfx/demo_app/record_test_spec.rb +20 -0
  68. data/spec/funfx/demo_app/repeater_control_spec.rb +65 -0
  69. data/spec/funfx/demo_app/tab_bar_spec.rb +19 -0
  70. data/spec/funfx/demo_app/tab_navigator_spec.rb +19 -0
  71. data/spec/funfx/demo_app/test_spec.rb +19 -0
  72. data/spec/funfx/demo_app/text_area_spec.rb +28 -0
  73. data/spec/funfx/demo_app/text_input_spec.rb +28 -0
  74. data/spec/funfx/demo_app/text_spec.rb +18 -0
  75. data/spec/funfx/demo_app/tile_button_spec.rb +20 -0
  76. data/spec/funfx/demo_app/tile_list_spec.rb +25 -0
  77. data/spec/funfx/demo_app/title_window_spec.rb +40 -0
  78. data/spec/funfx/demo_app/toggle_button_spec.rb +19 -0
  79. data/spec/funfx/demo_app/tree_drag_and_drop_spec.rb +39 -0
  80. data/spec/funfx/demo_app/tree_spec.rb +24 -0
  81. data/spec/funfx/demo_app/view_stack_spec.rb +27 -0
  82. data/spec/funfx/flex/element_spec.rb +115 -0
  83. data/spec/funfx/flex/flex_app_id_spec.rb +40 -0
  84. data/spec/funfx/meta/generator_spec.rb +16 -0
  85. data/spec/funfx/meta/parser_spec.rb +88 -0
  86. data/spec/spec.opts +1 -0
  87. data/spec/spec_helper.rb +41 -0
  88. metadata +166 -0
@@ -0,0 +1,67 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+
8
+ tree = @flex.tree({:id => 'objectTree'})
9
+ tree.open('Date controls')
10
+ tree.select('Date controls>DateChooser1')
11
+ end
12
+
13
+ it "should shift date" do
14
+ date_chooser = @flex.date_chooser({:id => 'dateChooser1'})
15
+ date_chooser.change("May 8 2008")
16
+
17
+ date_chooser.selected_date.should == Date.new(2008, 5, 8)
18
+ end
19
+
20
+ it "should shift month" do
21
+ date_chooser = @flex.date_chooser({:id => 'dateChooser1'})
22
+ date_chooser.change("May 8 2008")
23
+
24
+ date_chooser.displayed_month.should == 4
25
+ date_chooser.scroll("3")
26
+ date_chooser.displayed_month.should == 3
27
+ date_chooser.scroll("1")
28
+ date_chooser.displayed_month.should == 4
29
+ end
30
+
31
+ it "should get disabled dates" do
32
+ date_chooser = @flex.date_chooser({:id => 'dateChooser1'})
33
+ date_chooser.change("May 8 2010")
34
+
35
+ pending "Find out how we can get the diabled dates" do
36
+ date_chooser.disabled_ranges.should == [Date.new(2008, 5, 1), Date.new(2008, 5, 2), Date.new(2008, 5, 3), Date.new(2008, 5, 3),]
37
+ end
38
+ end
39
+
40
+ it "should shift year" do
41
+ date_chooser = @flex.date_chooser({:id => 'dateChooser1'})
42
+ date_chooser.change("May 8 2010")
43
+
44
+ date_chooser.displayed_year.should == 2010
45
+ date_chooser.scroll("2")
46
+ date_chooser.displayed_year.should == 2011
47
+ pending "Find out why we can't scroll downwards with years" do
48
+ date_chooser.scroll("4")
49
+ date_chooser.displayed_year.should == 2010
50
+ end
51
+ end
52
+
53
+ it "should not allow mutliple selection" do
54
+ date_chooser = @flex.date_chooser({:id => 'dateChooser1'})
55
+ date_chooser.allow_multiple_selection?.should == false
56
+ end
57
+
58
+ it "should allow mutliple selection" do
59
+ date_chooser = @flex.date_chooser({:id => 'dateChooserMultipleSelection'})
60
+ date_chooser.allow_multiple_selection?.should == true
61
+ date_chooser.change("May 8 2010")
62
+ date_chooser.change("May 10 2010")
63
+ pending "Find out why we can't scroll downwards with years" do
64
+ date_chooser.selected_ranges.should == [Date.new(2010, 5, 8), Date.new(2010, 5, 10)]
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,36 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+
8
+ tree = @flex.tree({:id => 'objectTree'})
9
+ tree.open('Date controls')
10
+ tree.select('Date controls>DateField1')
11
+ end
12
+
13
+ it "should shift date" do
14
+ date_field = @flex.date_field({:id => 'dateField1'})
15
+ date_field.open
16
+ date_field.change("May 8 2008")
17
+
18
+ date_field.selected_date.should == Date.new(2008, 5, 8)
19
+ end
20
+
21
+ it "should shift month" do
22
+ date_field = @flex.date_field({:id => 'dateField1'})
23
+ date_field.open
24
+ date_field.change("May 8 2008")
25
+
26
+ date_field.open
27
+ date_field.displayed_month.should == 4
28
+
29
+ pending "Find out why it is not possible to scroll" do
30
+ date_field.scroll("1")
31
+ date_field.displayed_month.should == 3
32
+ date_field.scroll("3")
33
+ date_field.displayed_month.should == 4
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,22 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+ end
8
+
9
+ it "should enter information in a form" do
10
+ tree = @flex.tree({:id => 'objectTree'})
11
+ tree.open('Container controls')
12
+ tree.select('Container controls>Form1')
13
+
14
+ text_area_first_name = @flex.text_area({:id => 'frmFname'})
15
+ text_area_email_address = @flex.text_area({:id => 'frmEmail'})
16
+
17
+ text_area_first_name.input("Test Testing")
18
+ text_area_first_name.text.strip.should == "Test Testing"
19
+ text_area_email_address.input("test@testing.com")
20
+ text_area_email_address.text.strip.should == "test@testing.com"
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+ end
8
+
9
+ it "should click on button in a grid" do
10
+ tree = @flex.tree({:id => 'objectTree'})
11
+ tree.open('Container controls')
12
+ tree.select('Container controls>GridLayout1')
13
+
14
+ button = @flex.button({:automationName => 'Row 2 Col 1'})
15
+
16
+ button.click
17
+
18
+ label = @flex.label({:id => 'lLabel'})
19
+ label.text.strip.should == "Row 2 Col 1"
20
+
21
+
22
+ end
23
+ end
@@ -0,0 +1,25 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+
8
+ tree = @flex.tree({:id => 'objectTree'})
9
+ tree.open('General controls')
10
+ tree.select('General controls>HScrollBar1')
11
+ end
12
+
13
+ it "should scroll" do
14
+ scroll_bar = @flex.h_scroll_bar({:id => 'bar'})
15
+
16
+ scroll_bar.scroll_position.should == '0'
17
+
18
+ scroll_bar.scroll('50', '1', '7')
19
+ scroll_bar.scroll('100', '1', '7')
20
+
21
+ scroll_bar.scroll_position.should == '100'
22
+ end
23
+
24
+
25
+ end
@@ -0,0 +1,21 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+
8
+ tree = @flex.tree({:id => 'objectTree'})
9
+ tree.open('General controls')
10
+ tree.select('General controls>HSlider1')
11
+ end
12
+
13
+ it "should change value" do
14
+ slider = @flex.h_slider({:id => 'hSlider'})
15
+ slider.value.should == 100
16
+ slider.change('80')
17
+ slider.value.should == 80
18
+ end
19
+
20
+
21
+ end
@@ -0,0 +1,24 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+
8
+ tree = @flex.tree({:id => 'objectTree'})
9
+ tree.open('General controls')
10
+ tree.select('General controls>HorizontalList1')
11
+ end
12
+
13
+ it "should selct from a horizontallist" do
14
+ list = @flex.list({:id => 'list'})
15
+ list.select('Nokia 6630')
16
+ end
17
+
18
+ it "should scroll horizontal" do
19
+ list = @flex.list({:id => 'list'})
20
+ list.scroll('1', '1', '7')
21
+ list.scroll('2', '1', '7')
22
+ list.select('Nokia LGV', '1', '0')
23
+ end
24
+ end
@@ -0,0 +1,18 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+
8
+ tree = @flex.tree({:id => 'objectTree'})
9
+ tree.open('Text controls')
10
+ tree.select('Text controls>Label1')
11
+ end
12
+
13
+ it "should get text from label" do
14
+ label = @flex.label({:id => 'simpleLabel'})
15
+ label.text.should == "This Label displays plain text."
16
+ end
17
+
18
+ end
@@ -0,0 +1,57 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+ end
8
+
9
+ it "should change view of the linkbar" do
10
+ tree = @flex.tree({:id => 'objectTree'})
11
+ tree.open('Button controls')
12
+ tree.select('Button controls>LinkBar1')
13
+
14
+ @flex.box({:id => 'linkBarViewStack'}, {:id => 'searchBar'}).visible? == true
15
+ @flex.box({:id => 'linkBarViewStack'}, {:id => 'custInfoBar'}).visible? == false
16
+ @flex.box({:id => 'linkBarViewStack'}, {:id => 'accountInfoBar'}).visible? == false
17
+
18
+ link_bar = @flex.link_bar({:id => 'lbLinkBar'})
19
+ link_bar.change('Customer Info')
20
+
21
+ @flex.box({:id => 'linkBarViewStack'}, {:id => 'searchBar'}).visible? == false
22
+ @flex.box({:id => 'linkBarViewStack'}, {:id => 'custInfoBar'}).visible? == true
23
+ @flex.box({:id => 'linkBarViewStack'}, {:id => 'accountInfoBar'}).visible? == false
24
+ end
25
+
26
+ it "should count number of children" do
27
+ tree = @flex.tree({:id => 'objectTree'})
28
+ tree.open('Button controls')
29
+ tree.select('Button controls>LinkBar1')
30
+
31
+ link_bar = @flex.link_bar({:id => 'lbLinkBar'})
32
+
33
+ link_bar.num_children.should == 3
34
+ end
35
+
36
+ it "should state the selected index" do
37
+ tree = @flex.tree({:id => 'objectTree'})
38
+ tree.open('Button controls')
39
+ tree.select('Button controls>LinkBar1')
40
+
41
+ link_bar = @flex.link_bar({:id => 'lbLinkBar'})
42
+ link_bar.change('Customer Info')
43
+
44
+ link_bar.selected_index.should == 1
45
+ end
46
+
47
+ it "should state the direction" do
48
+ tree = @flex.tree({:id => 'objectTree'})
49
+ tree.open('Button controls')
50
+ tree.select('Button controls>LinkBar1')
51
+
52
+ link_bar = @flex.link_bar({:id => 'lbLinkBar'})
53
+
54
+ link_bar.direction.should == "horizontal"
55
+
56
+ end
57
+ end
@@ -0,0 +1,21 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+ end
8
+
9
+ it "should click on linkbutton" do
10
+ tree = @flex.tree({:id => 'objectTree'})
11
+ tree.open('Button controls')
12
+ tree.select('Button controls>LinkButton1')
13
+
14
+ link_button = @flex.button({:id => 'lbButton'})
15
+ link_button.click
16
+
17
+ alert = @flex.alert({:automationName => 'LinkButtonMessage'})
18
+ alert.should be_visible
19
+ end
20
+
21
+ end
@@ -0,0 +1,23 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+
8
+ tree = @flex.tree({:id => 'objectTree'})
9
+ tree.open('General controls')
10
+ tree.select('General controls>List1')
11
+ end
12
+
13
+ it "should select a row" do
14
+ list = @flex.list({:id => 'source'})
15
+
16
+ list.selected_index.should == -1
17
+ list.select('Arizona')
18
+ list.selected_index.should == 2
19
+
20
+ end
21
+
22
+
23
+ end
@@ -0,0 +1,33 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+
8
+ tree = @flex.tree({:id => 'objectTree'})
9
+ tree.open('Menu controls')
10
+ tree.select('Menu controls>MenuBar1')
11
+ end
12
+
13
+ it "should select from menu bar" do
14
+ menu_bar = @flex.menu_bar({:id => 'menuBar'})
15
+ menu_bar.show('Menu2')
16
+
17
+ pending "Find out why it does not work to select from the sub menu" do
18
+ menu = @flex.menu({:id => 'menuBar', :automationName => 'menuBar', :automationIndex => 'index:6'}, {:id => 'undefined', :automationName => 'Menu2', :automationIndex => 'index:3'})
19
+ menu.show('MenuItem 2-B')
20
+
21
+ menu = @flex.menu({:id => 'menuBar'}, {:automationName => 'Menu2'}, {:automationName => 'MenuItem%202-B'})
22
+ menu.select('SubMenuItem 3-A')
23
+
24
+ alert = @flex.alert({:automationName => 'Clicked%20menu%20item'})
25
+
26
+ lambda do
27
+ alert.visible?
28
+ end.should raise_error
29
+ end
30
+ end
31
+
32
+ end
33
+
@@ -0,0 +1,27 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+
8
+ tree = @flex.tree({:id => 'objectTree'})
9
+ tree.open('Menu controls')
10
+ tree.select('Menu controls>Menu1')
11
+ end
12
+
13
+ it "should select from menu" do
14
+ button = @flex.button({:id => 'mybutton'})
15
+ button.click
16
+
17
+ menu = @flex.menu({:automationName => 'menu'})
18
+ menu.select('MenuItem 1')
19
+
20
+ alert = @flex.alert({:automationName => 'Clicked%20menu%20item'})
21
+
22
+ lambda do
23
+ alert.visible?
24
+ end.should raise_error
25
+ end
26
+
27
+ end
@@ -0,0 +1,37 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "DemoApp" do
4
+ before do
5
+ browser.goto(DEMO_APP)
6
+ @flex = browser.flex_app('DemoAppId', 'DemoAppName')
7
+
8
+ tree = @flex.tree({:id => 'objectTree'})
9
+ tree.open('General controls')
10
+ tree.select('General controls>NumericStepper1')
11
+ end
12
+
13
+ it "should step up and down" do
14
+ numeric_stepper = @flex.numeric_stepper({:id => 'stdNumericStepper'})
15
+ numeric_stepper.change('1')
16
+ numeric_stepper.value.should == 1
17
+ numeric_stepper.next_value.should == 2
18
+ numeric_stepper.previous_value.should == 0
19
+ numeric_stepper.change('0')
20
+ numeric_stepper.value.should == 0
21
+ end
22
+
23
+ it "should select and enter text" do
24
+ numeric_stepper = @flex.numeric_stepper({:id => 'stdNumericStepper'})
25
+ numeric_stepper.select_text('0', '1')
26
+ numeric_stepper.input('8')
27
+ numeric_stepper.value.should == 8
28
+ end
29
+
30
+ it "should not go over maximum size" do
31
+ numeric_stepper = @flex.numeric_stepper({:id => 'stdNumericStepper'})
32
+ numeric_stepper.select_text('0', '1')
33
+ numeric_stepper.input('20')
34
+ numeric_stepper.maximum.should == 10
35
+ numeric_stepper.value.should == 10
36
+ end
37
+ end