funfx 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,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
+ end
8
+
9
+ it "should select sent items from popup button" do
10
+ tree = @flex.tree({:id => 'objectTree'})
11
+ tree.open('Button controls')
12
+ tree.select('Button controls>PopUpButton1')
13
+
14
+ popup_button = @flex.pop_up_button({:id => 'popB'})
15
+ popup_button.open
16
+
17
+ menu = @flex.menu({:automationName => 'popMenu'})
18
+ menu.select("Sent Items")
19
+
20
+ popup_button.label.strip.should == "Put in: Sent Items"
21
+ end
22
+
23
+ it "should return the row count of the menu" do
24
+ tree = @flex.tree({:id => 'objectTree'})
25
+ tree.open('Button controls')
26
+ tree.select('Button controls>PopUpButton1')
27
+
28
+ popup_button = @flex.pop_up_button({:id => 'popB'})
29
+ popup_button.open
30
+
31
+ menu = @flex.menu({:automationName => 'popMenu'})
32
+
33
+ menu.row_count.should == 3
34
+ end
35
+
36
+ end
@@ -0,0 +1,42 @@
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>PopUpMenuButton1')
11
+ end
12
+
13
+ it "should select from popup menu" do
14
+ popup_menu = @flex.pop_up_menu_button({:id => 'p2'})
15
+ popup_menu.open
16
+
17
+ menu = popup_menu.menu({:automationIndex => 'index:0'})
18
+ menu.select('Calendar')
19
+
20
+ alert = @flex.alert({:automationName => 'Message'})
21
+
22
+
23
+ alert.visible?.should == true
24
+
25
+ end
26
+
27
+ it "should check selected item" do
28
+ popup_menu = @flex.pop_up_menu_button({:id => 'p2'})
29
+ popup_menu.open
30
+
31
+ menu = popup_menu.menu({:automationIndex => 'index:0'})
32
+ menu.select('Calendar')
33
+
34
+ alert = @flex.alert({:automationName => 'Message'})
35
+ button = @flex.alert({:automationName => 'Message'}).button({:automationName => 'OK'})
36
+ button.click
37
+
38
+ popup_menu.label.should == 'Calendar'
39
+
40
+ end
41
+
42
+ 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>ProgressBar1')
11
+ end
12
+
13
+ it "should read the value of the progress" do
14
+ button = @flex.button({:id => 'Speed'})
15
+ button.click('0')
16
+
17
+ progress_bar = @flex.progress_bar({:id => 'bar'})
18
+ progress_bar.percent_complete.should == 10
19
+
20
+ button.click('0')
21
+
22
+ progress_bar.percent_complete.should == 20
23
+ end
24
+ end
@@ -0,0 +1,50 @@
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 select mastercard" do
10
+ tree = @flex.tree({:id => 'objectTree'})
11
+ tree.open('Button controls')
12
+ tree.select('Button controls>RadioButtonGroup1')
13
+
14
+ radio_button = @flex.radio_button({:id => 'masterCard'})
15
+
16
+ radio_button.selected?.should == false
17
+ radio_button.click
18
+ @flex.button({:automationName => 'Selection'}, {:automationName => 'OK'}).click
19
+ radio_button.selected?.should == true
20
+ end
21
+
22
+ it "should check that the group hangs together" do
23
+ tree = @flex.tree({:id => 'objectTree'})
24
+ tree.open('Button controls')
25
+ tree.select('Button controls>RadioButtonGroup1')
26
+
27
+ radio_button_american_express = @flex.radio_button({:id => 'americanExpress'})
28
+ radio_button_mastercard = @flex.radio_button({:id => 'masterCard'})
29
+ radio_button_visa = @flex.radio_button({:id => 'visa'})
30
+
31
+ radio_button_american_express.selected?.should == false
32
+ radio_button_mastercard.selected?.should == false
33
+ radio_button_visa.selected?.should == false
34
+
35
+ radio_button_mastercard.click
36
+ @flex.button({:automationName => 'Selection'}, {:automationName => 'OK'}).click
37
+
38
+ radio_button_american_express.selected?.should == false
39
+ radio_button_mastercard.selected?.should == true
40
+ radio_button_visa.selected?.should == false
41
+
42
+ radio_button_visa.click
43
+ @flex.button({:automationName => 'Selection'}, {:automationName => 'OK'}).click
44
+
45
+ radio_button_american_express.selected?.should == false
46
+ radio_button_mastercard.selected?.should == false
47
+ radio_button_visa.selected?.should == true
48
+
49
+ end
50
+ end
@@ -0,0 +1,26 @@
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 select radiobutton" do
10
+ tree = @flex.tree({:id => 'objectTree'})
11
+ tree.open('Button controls')
12
+ tree.select('Button controls>RadioButton1')
13
+
14
+ radio_button = @flex.radio_button({:automationName => '1942'})
15
+
16
+ radio_button.selected?.should == false
17
+ radio_button.click
18
+ radio_button.selected?.should == true
19
+ radio_button.label.strip.should == "1942"
20
+ radio_button = @flex.radio_button({:automationName => '1972'})
21
+ radio_button.selected?.should == false
22
+ radio_button.click
23
+ radio_button.selected?.should == true
24
+ radio_button.label.strip.should == "1972"
25
+ end
26
+ end
@@ -0,0 +1,20 @@
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
+
9
+ end
10
+
11
+ it "should selct from a horizontallist" do
12
+
13
+ @flex.tree({:id => 'objectTree', :automationName => 'objectTree', :automationIndex => 'index:1'}).open('Date controls', '1')
14
+ @flex.tree({:id => 'objectTree', :automationName => 'objectTree', :automationIndex => 'index:1'}).select('Date controls>DateField1', '1', '0')
15
+ @flex.date_field({:id => 'dateField1', :automationName => 'dateField1', :automationIndex => 'index:7'}).open
16
+ @flex.date_field({:id => 'dateField1', :automationName => 'dateField1', :automationIndex => 'index:7'}).change('Tue Oct 21 2008')
17
+
18
+ end
19
+
20
+ end
@@ -0,0 +1,65 @@
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 reach a repeater item by index" do
10
+ tree = @flex.tree({:id => 'objectTree'})
11
+ tree.open('Repeater controls')
12
+ tree.select('Repeater controls>Repeater1')
13
+
14
+ box = @flex.box({:automationName => 'Repeater'})
15
+
16
+ button = box.button({:automationIndex => 'index:1', :id => 'repeaterButton'})
17
+ button.click
18
+
19
+ label = @flex.label({:id => 'lLabel'})
20
+ label.text.strip.should == "2"
21
+ end
22
+
23
+ it "should reach a repeater item by automationname" do
24
+ tree = @flex.tree({:id => 'objectTree'})
25
+ tree.open('Repeater controls')
26
+ tree.select('Repeater controls>Repeater1')
27
+
28
+ button = @flex.box({:automationName => 'Repeater'}).button({:automationName => '2'})
29
+ button.click
30
+
31
+ label = @flex.label({:id => 'lLabel'})
32
+ label.text.strip.should == "2"
33
+ end
34
+
35
+ it "should insert text into repeater items" do
36
+ tree = @flex.tree({:id => 'objectTree'})
37
+ tree.open('Repeater controls')
38
+ tree.select('Repeater controls>Repeater2')
39
+
40
+ button = @flex.box({:automationName => 'Repeater'}).button({:id => 'bAddItem'})
41
+ button.click
42
+ button.click
43
+
44
+ text_area_first_item = @flex.box({:automationName => 'Repeater'}).repeater({:id => 'rp'}).text_area({:automationIndex => 'index:0', :id => 'tTextInput'})
45
+ text_area_first_item.input('First item')
46
+ text_area_first_item.text.strip.should == "First item"
47
+
48
+ text_area_second_item = @flex.box({:automationName => 'Repeater'}).repeater({:id => 'rp'}).text_area({:automationIndex => 'index:1', :id => 'tTextInput'})
49
+ text_area_second_item.input('Second item')
50
+ text_area_second_item.text.strip.should == "Second item"
51
+ end
52
+
53
+ it "should insert text into first repeater item" do
54
+ tree = @flex.tree({:id => 'objectTree'})
55
+ tree.open('Repeater controls')
56
+ tree.select('Repeater controls>Repeater2')
57
+
58
+ button = @flex.box({:automationName => 'Repeater'}).button({:id => 'bAddItem'})
59
+ button.click
60
+
61
+ text_area = @flex.box({:automationName => 'Repeater'}).repeater({:id => 'rp'}).text_area({:automationIndex => 'index:0', :id => 'tTextInput'})
62
+ text_area.input('Test')
63
+ text_area.text.strip.should == "Test"
64
+ end
65
+ end
@@ -0,0 +1,19 @@
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>TabBar1')
11
+ end
12
+
13
+ it "click on bar and change view" do
14
+ tab_bar = @flex.tab_bar({:id => 'bar'})
15
+ tab_bar.selected_index.should == "0"
16
+ tab_bar.change('Alaska')
17
+ tab_bar.selected_index.should == "1"
18
+ end
19
+ end
@@ -0,0 +1,19 @@
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 switch tab in a tab navigator" do
10
+ tree = @flex.tree({:id => 'objectTree'})
11
+ tree.open('Container controls')
12
+ tree.select('Container controls>TabNavigator1')
13
+
14
+ tab_navigator = @flex.tab_navigator({:id => 'tabNav'})
15
+ tab_navigator.selected_index.should == 0
16
+ tab_navigator.change("View 2: Sales Trends Chart")
17
+ tab_navigator.selected_index.should == 1
18
+ end
19
+ end
@@ -0,0 +1,19 @@
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 switch tab in a tab navigator" do
10
+ @flex.tree({:id => 'objectTree', :automationName => 'objectTree'}).open('Repeater controls', '1')
11
+ @flex.tree({:id => 'objectTree', :automationName => 'objectTree'}).select('Repeater controls>Repeater2', '1', '0')
12
+ @flex.button({:id => 'bAddItem', :automationName => 'Add item'}).click('0')
13
+ @flex.button({:id => 'bAddItem', :automationName => 'Add item'}).click('0')
14
+ @flex.text_input({:id => 'tTextInput', :automationName => 'tTextInput', :automationIndex => 'index:0'}).select_text('0', '0')
15
+ @flex.text_input({:id => 'tTextInput', :automationName => 'tTextInput', :automationIndex => 'index:0'}).input('Test1')
16
+ @flex.text_input({:id => 'tTextInput', :automationName => 'tTextInput', :automationIndex => 'index:1'}).select_text('0', '0')
17
+ @flex.text_input({:id => 'tTextInput', :automationName => 'tTextInput', :automationIndex => 'index:1'}).input('Test2')
18
+ end
19
+ end
@@ -0,0 +1,28 @@
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>TextArea1')
11
+ end
12
+
13
+ it "should enter text" do
14
+ text_area = @flex.text_area({:id => 'tTextArea'})
15
+ text_area.input('Text')
16
+
17
+ text_area.text.should == "Text"
18
+ end
19
+
20
+ it "should select text and enter new text" do
21
+ text_area = @flex.text_area({:id => 'tTextArea'})
22
+ text_area.input('Old text message')
23
+ text_area.select_text('0', '3')
24
+ text_area.input('New')
25
+ text_area.text.should == 'New text message'
26
+ end
27
+
28
+ end
@@ -0,0 +1,28 @@
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>TextInput1')
11
+ end
12
+
13
+ it "should enter text" do
14
+ text_input = @flex.text_input({:id => 'tSrc'})
15
+ text_input.input('Text')
16
+
17
+ text_input.text.should == "Text"
18
+ end
19
+
20
+ it "should select text and enter new text" do
21
+ text_input = @flex.text_input({:id => 'tSrc'})
22
+ text_input.input('Old text message')
23
+ text_input.select_text('0', '3')
24
+ text_input.input('New')
25
+ text_input.text.should == 'New text message'
26
+ end
27
+
28
+ 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>Text1')
11
+ end
12
+
13
+ it "should get text from text" do
14
+ text = @flex.text({:id => 'tText'})
15
+ text.text.should == "This is a multiline, non-editable text component."
16
+ end
17
+
18
+ end
@@ -0,0 +1,20 @@
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 switch tab in a tab navigator" do
10
+ tree = @flex.tree({:id => 'objectTree'})
11
+ tree.open('Container controls')
12
+ tree.select('Container controls>TabNavigator1')
13
+
14
+ tab_navigator = @flex.tab_navigator({:id => 'tabNav'})
15
+ tab_navigator.selected_index.should == 0
16
+ tab_navigator.change("View 2: Sales Trends Chart")
17
+ tab_navigator.selected_index.should == 1
18
+
19
+ end
20
+ 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>TileList1')
11
+ end
12
+
13
+ it "select an item from the list" do
14
+ tile_list = @flex.tile_list({:id => 'CameraSelection'})
15
+ tile_list.select('Nokia 6680')
16
+ end
17
+
18
+ it "should scroll a tile list" do
19
+ tile_list = @flex.tile_list({:id => 'CameraSelection'})
20
+ tile_list.select('Nokia 6680')
21
+ tile_list.scroll('1', '2', '5')
22
+ tile_list.scroll('2', '2', '5')
23
+ tile_list.select('Nokia LMV')
24
+ end
25
+ end