funfx 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +18 -0
- data/License.txt +20 -0
- data/Manifest.txt +87 -0
- data/README.txt +48 -0
- data/Rakefile +5 -0
- data/config/hoe.rb +67 -0
- data/config/requirements.rb +15 -0
- data/ext/FunFX.swc +0 -0
- data/lib/funfx.rb +34 -0
- data/lib/funfx/browser/firewatir.rb +47 -0
- data/lib/funfx/browser/flex_app_lookup.rb +22 -0
- data/lib/funfx/browser/safariwatir.rb +47 -0
- data/lib/funfx/browser/watir.rb +41 -0
- data/lib/funfx/decoder.rb +67 -0
- data/lib/funfx/flex/element.rb +161 -0
- data/lib/funfx/flex/elements.rb +2712 -0
- data/lib/funfx/flex/flex_app_id.rb +15 -0
- data/lib/funfx/flex/tabular_data.rb +22 -0
- data/lib/funfx/meta/class_dot.erb +24 -0
- data/lib/funfx/meta/code.erb +33 -0
- data/lib/funfx/meta/generator.rb +18 -0
- data/lib/funfx/meta/parser.rb +190 -0
- data/lib/funfx/version.rb +9 -0
- data/rake_tasks/deployment.rake +34 -0
- data/rake_tasks/environment.rake +7 -0
- data/rake_tasks/generation.rake +37 -0
- data/rake_tasks/hoe_ext.rake +11 -0
- data/rake_tasks/rspec.rake +28 -0
- data/script/console +10 -0
- data/script/console.cmd +1 -0
- data/script/destroy +14 -0
- data/script/destroy.cmd +1 -0
- data/script/generate +14 -0
- data/script/generate.cmd +1 -0
- data/script/txt2html +82 -0
- data/script/txt2html.cmd +1 -0
- data/setup.rb +1585 -0
- data/spec/funfx/demo_app/accordion_spec.rb +38 -0
- data/spec/funfx/demo_app/advanced_data_grid_spec.rb +74 -0
- data/spec/funfx/demo_app/alert_spec.rb +33 -0
- data/spec/funfx/demo_app/button_bar_spec.rb +21 -0
- data/spec/funfx/demo_app/button_spec.rb +68 -0
- data/spec/funfx/demo_app/check_box_spec.rb +62 -0
- data/spec/funfx/demo_app/control_bar_spec.rb +19 -0
- data/spec/funfx/demo_app/controls_with_same_id_spec.rb +37 -0
- data/spec/funfx/demo_app/data_grid_editable_spec.rb +78 -0
- data/spec/funfx/demo_app/data_grid_spec.rb +65 -0
- data/spec/funfx/demo_app/date_chooser_spec.rb +67 -0
- data/spec/funfx/demo_app/date_field_spec.rb +36 -0
- data/spec/funfx/demo_app/form_spec.rb +22 -0
- data/spec/funfx/demo_app/grid_layout_spec.rb +23 -0
- data/spec/funfx/demo_app/h_scrollbar_spec.rb +25 -0
- data/spec/funfx/demo_app/h_slider_spec.rb +21 -0
- data/spec/funfx/demo_app/horizontal_list_spec.rb +24 -0
- data/spec/funfx/demo_app/label_spec.rb +18 -0
- data/spec/funfx/demo_app/link_bar_spec.rb +57 -0
- data/spec/funfx/demo_app/link_button_spec.rb +21 -0
- data/spec/funfx/demo_app/list_spec.rb +23 -0
- data/spec/funfx/demo_app/menu_bar_spec.rb +33 -0
- data/spec/funfx/demo_app/menu_spec.rb +27 -0
- data/spec/funfx/demo_app/numeric_stepper_spec.rb +37 -0
- data/spec/funfx/demo_app/popup_button_spec.rb +36 -0
- data/spec/funfx/demo_app/popup_menu_bar_spec.rb +42 -0
- data/spec/funfx/demo_app/progress_bar_spec.rb +24 -0
- data/spec/funfx/demo_app/radio_button_group_spec.rb +50 -0
- data/spec/funfx/demo_app/radio_button_spec.rb +26 -0
- data/spec/funfx/demo_app/record_test_spec.rb +20 -0
- data/spec/funfx/demo_app/repeater_control_spec.rb +65 -0
- data/spec/funfx/demo_app/tab_bar_spec.rb +19 -0
- data/spec/funfx/demo_app/tab_navigator_spec.rb +19 -0
- data/spec/funfx/demo_app/test_spec.rb +19 -0
- data/spec/funfx/demo_app/text_area_spec.rb +28 -0
- data/spec/funfx/demo_app/text_input_spec.rb +28 -0
- data/spec/funfx/demo_app/text_spec.rb +18 -0
- data/spec/funfx/demo_app/tile_button_spec.rb +20 -0
- data/spec/funfx/demo_app/tile_list_spec.rb +25 -0
- data/spec/funfx/demo_app/title_window_spec.rb +40 -0
- data/spec/funfx/demo_app/toggle_button_spec.rb +19 -0
- data/spec/funfx/demo_app/tree_drag_and_drop_spec.rb +39 -0
- data/spec/funfx/demo_app/tree_spec.rb +24 -0
- data/spec/funfx/demo_app/view_stack_spec.rb +27 -0
- data/spec/funfx/flex/element_spec.rb +115 -0
- data/spec/funfx/flex/flex_app_id_spec.rb +40 -0
- data/spec/funfx/meta/generator_spec.rb +16 -0
- data/spec/funfx/meta/parser_spec.rb +88 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +41 -0
- metadata +166 -0
@@ -0,0 +1,38 @@
|
|
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 raise error when click non existent" do
|
10
|
+
tree = @flex.tree({:id => 'objectTree'})
|
11
|
+
tree.open('Container controls')
|
12
|
+
tree.select('Container controls>Accordion1')
|
13
|
+
|
14
|
+
accordion = @flex.accordion({:id => 'accordion'})
|
15
|
+
|
16
|
+
lambda do
|
17
|
+
accordion.box({:automationName => 'Accordion Button for Panel 5'}).click
|
18
|
+
end.should raise_error("Error: Unable to resolve child with locator: {:automationName => 'Accordion Button for Panel 5'}, and parent: {:id => 'accordion'}")
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should click toggle button" do
|
22
|
+
tree = @flex.tree({:id => 'objectTree'})
|
23
|
+
tree.open('Container controls')
|
24
|
+
tree.select('Container controls>Accordion1')
|
25
|
+
|
26
|
+
accordion = @flex.accordion({:id => 'accordion'})
|
27
|
+
|
28
|
+
accordion.box({:automationName => 'Accordion Button for Panel 1'}).visible?.should == true
|
29
|
+
accordion.box({:automationName => 'Accordion Button for Panel 2'}).visible?.should == false
|
30
|
+
accordion.box({:automationName => 'Accordion Button for Panel 3'}).visible?.should == false
|
31
|
+
|
32
|
+
accordion.change("Accordion Button for Panel 3")
|
33
|
+
|
34
|
+
accordion.box({:automationName => 'Accordion Button for Panel 1'}).visible?.should == false
|
35
|
+
accordion.box({:automationName => 'Accordion Button for Panel 2'}).visible?.should == false
|
36
|
+
accordion.box({:automationName => 'Accordion Button for Panel 3'}).visible?.should == true
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,74 @@
|
|
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>AdvancedDataGrid1')
|
11
|
+
|
12
|
+
@advanced_data_grid = @flex.advanced_data_grid({:id => 'myADG'})
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should get data from an advanceddatagrid" do
|
16
|
+
@advanced_data_grid.column_names.should == ['Region', 'Territory']
|
17
|
+
|
18
|
+
@advanced_data_grid.values(0,1).should == [
|
19
|
+
["Southwest", " "]
|
20
|
+
]
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should get data from an open advanceddatagrid" do
|
24
|
+
@advanced_data_grid.item_open("*Southwest* | ")
|
25
|
+
@advanced_data_grid.item_open("*Nevada* | ")
|
26
|
+
|
27
|
+
@advanced_data_grid.column_names.should == ['Region', 'Territory']
|
28
|
+
|
29
|
+
@advanced_data_grid.values(0,4).should == [
|
30
|
+
["Southwest", " "],
|
31
|
+
["Arizona", " "],
|
32
|
+
["Central California", " "],
|
33
|
+
["Nevada", " "],
|
34
|
+
["Southwest", "Nevada"]
|
35
|
+
]
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should get data with commas" do
|
39
|
+
@advanced_data_grid.item_open("*Southwest* | ")
|
40
|
+
|
41
|
+
@advanced_data_grid.values(0,8).last.should == ["Territory With,Comma", " "]
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should get the number of columns in the advanceddatagrid" do
|
45
|
+
@advanced_data_grid.num_columns.should == 2
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should get the number of rows with data in a closed advanceddatagrid" do
|
49
|
+
@advanced_data_grid.num_rows.should == 1
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should get the number of rows with data in an open advanceddatagrid" do
|
53
|
+
@advanced_data_grid.item_open("*Southwest* | ")
|
54
|
+
@advanced_data_grid.num_rows.should == 7
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should select a row" do
|
58
|
+
@advanced_data_grid.select("*Southwest* | ")
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should open a row" do
|
62
|
+
@advanced_data_grid.item_open("*Southwest* | ")
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should close a row" do
|
66
|
+
@advanced_data_grid.item_open("*Southwest* | ")
|
67
|
+
@advanced_data_grid.item_close("*Southwest* | ")
|
68
|
+
end
|
69
|
+
|
70
|
+
it "should select a row by index" do
|
71
|
+
@advanced_data_grid.item_open("*Southwest* | ")
|
72
|
+
@advanced_data_grid.select_index(4)
|
73
|
+
end
|
74
|
+
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
|
+
end
|
8
|
+
|
9
|
+
it "should be able to navigate an alert" do
|
10
|
+
tree = @flex.tree({:id => 'objectTree'})
|
11
|
+
tree.open('General controls')
|
12
|
+
sleep(1)
|
13
|
+
# sleep command: I Have a small screen on my computer, and when the tree is expanded a scrollbar appears
|
14
|
+
# thus making the test exit as it has done the select properly, but it has not and the following steps fail.
|
15
|
+
# Hav tried to do some more sync work on the flex side, but it seems to be a bug
|
16
|
+
tree.select('General controls>Alert1')
|
17
|
+
|
18
|
+
button = @flex.button({:id => 'bWorld'})
|
19
|
+
button.click
|
20
|
+
|
21
|
+
alert = @flex.alert({:automationName => 'Message'})
|
22
|
+
alert.should be_visible
|
23
|
+
|
24
|
+
alert.text.strip.should == "Hello World!"
|
25
|
+
|
26
|
+
button = @flex.alert({:automationName => 'Message'}).button({:automationName => 'OK'})
|
27
|
+
button.click
|
28
|
+
|
29
|
+
lambda do
|
30
|
+
alert.visible?
|
31
|
+
end.should raise_error
|
32
|
+
end
|
33
|
+
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 button" do
|
10
|
+
tree = @flex.tree({:id => 'objectTree'})
|
11
|
+
tree.open('Button controls')
|
12
|
+
tree.select('Button controls>ButtonBar1')
|
13
|
+
|
14
|
+
button_bar = @flex.button_bar({:id => 'bBar'})
|
15
|
+
button_bar.change('Flash')
|
16
|
+
|
17
|
+
text_area = @flex.text_area({:id => 'myTA'})
|
18
|
+
text_area.text.strip.should == "Selected button index: 0\rSelected button label: Flash"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,68 @@
|
|
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 open tree and click default button" do
|
10
|
+
tree = @flex.tree({:id => 'objectTree'})
|
11
|
+
tree.open('Button controls')
|
12
|
+
tree.select('Button controls>Button1')
|
13
|
+
|
14
|
+
button = @flex.button({:automationName => 'Default Button'})
|
15
|
+
button.click
|
16
|
+
|
17
|
+
message = @flex.text_area({:id => 'message'})
|
18
|
+
message.text.strip.should == "Default Button pressed"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should raise error when firing event on nonexistant element" do
|
22
|
+
tree = @flex.tree({:id => 'nonsense'})
|
23
|
+
lambda do
|
24
|
+
tree.open('Button controls')
|
25
|
+
end.should raise_error("Error: Unable to resolve child with locator: {:id => 'nonsense'}")
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should be disabled" do
|
29
|
+
tree = @flex.tree({:id => 'objectTree'})
|
30
|
+
tree.open('Button controls')
|
31
|
+
tree.select('Button controls>Button1')
|
32
|
+
|
33
|
+
button = @flex.button({:id => 'bDisabledButton'})
|
34
|
+
button.enabled?.should == false
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should be able to get label" do
|
38
|
+
tree = @flex.tree({:id => 'objectTree'})
|
39
|
+
tree.open('Button controls')
|
40
|
+
tree.select('Button controls>Button1')
|
41
|
+
|
42
|
+
button = @flex.button({:automationName => 'Customized Button'})
|
43
|
+
button.label.should == "Customized Button"
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should be able to see what type of text" do
|
47
|
+
tree = @flex.tree({:id => 'objectTree'})
|
48
|
+
tree.open('Button controls')
|
49
|
+
tree.select('Button controls>Button1')
|
50
|
+
|
51
|
+
button = @flex.button({:automationName => 'Customized Button'})
|
52
|
+
|
53
|
+
pending "Find out why we can't look up fontStyle" do
|
54
|
+
button.font_style.should == "italic"
|
55
|
+
button.text_align.should == "left"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should look up elements in nested fashion" do
|
60
|
+
tree = @flex.tree({:id => 'objectTree'})
|
61
|
+
tree.open('Button controls')
|
62
|
+
tree.select('Button controls>Button1')
|
63
|
+
|
64
|
+
button = @flex.panel(:automationName => 'Button Control Example').button(:automationName => 'Customized Button')
|
65
|
+
button.label.should == "Customized Button"
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe "DemoApp" do
|
5
|
+
before do
|
6
|
+
browser.goto(DEMO_APP)
|
7
|
+
@flex = browser.flex_app('DemoAppId', 'DemoAppName')
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should click on a checkbox" do
|
11
|
+
tree = @flex.tree({:id => 'objectTree'})
|
12
|
+
tree.open('Button controls')
|
13
|
+
tree.select('Button controls>CheckBox1')
|
14
|
+
|
15
|
+
check_box = @flex.check_box({:id => 'milkCB'})
|
16
|
+
check_box.click
|
17
|
+
|
18
|
+
message = @flex.text_area({:id => 'cartItems'})
|
19
|
+
message.text.strip.should == "milk"
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should assert that it is checked" do
|
23
|
+
tree = @flex.tree({:id => 'objectTree'})
|
24
|
+
tree.open('Button controls')
|
25
|
+
tree.select('Button controls>CheckBox1')
|
26
|
+
|
27
|
+
check_box = @flex.check_box({:id => 'milkCB'})
|
28
|
+
|
29
|
+
check_box.selected? == false
|
30
|
+
|
31
|
+
check_box.click
|
32
|
+
|
33
|
+
check_box.selected? == true
|
34
|
+
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should select multiple checkboxes" do
|
39
|
+
tree = @flex.tree({:id => 'objectTree'})
|
40
|
+
tree.open('Button controls')
|
41
|
+
tree.select('Button controls>CheckBox1')
|
42
|
+
|
43
|
+
check_box = @flex.check_box({:id => 'milkCB'})
|
44
|
+
check_box.click
|
45
|
+
check_box = @flex.check_box({:id => 'eggsCB'})
|
46
|
+
check_box.click
|
47
|
+
|
48
|
+
|
49
|
+
message = @flex.text_area({:id => 'cartItems'})
|
50
|
+
message.text.strip.should == "milk\reggs"
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should check the label" do
|
54
|
+
tree = @flex.tree({:id => 'objectTree'})
|
55
|
+
tree.open('Button controls')
|
56
|
+
tree.select('Button controls>CheckBox1')
|
57
|
+
|
58
|
+
check_box = @flex.check_box({:id => 'milkCB'})
|
59
|
+
check_box.label.strip.should == "milk"
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe "ControlBar" 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('Container controls')
|
10
|
+
tree.select('Container controls>ControlBar')
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should click on button within controlbar" do
|
14
|
+
panel = @flex.panel({:id => 'controlBarPanel'})
|
15
|
+
panel.button({:id => 'cbButton'}).click
|
16
|
+
@flex.label({:id => 'cbLabel'}).text.should == "Button was clicked"
|
17
|
+
end
|
18
|
+
|
19
|
+
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', "1")
|
10
|
+
tree.select('General controls>SameIdControl1')
|
11
|
+
|
12
|
+
@panel6 = flex.box({:id => 'sameIdPanel', :automationIndex => 'index:6'})
|
13
|
+
@panel8 = flex.box({:id => 'sameIdPanel', :automationIndex => 'index:8'})
|
14
|
+
|
15
|
+
@label6 = @panel6.label_element({:id => 'lResult'})
|
16
|
+
@label8 = @panel8.label_element({:id => 'lResult'})
|
17
|
+
|
18
|
+
@label6.text.strip.should == ""
|
19
|
+
@label8.text.strip.should == ""
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should enter text into the first box" do
|
23
|
+
@panel6.text_area({:id => 'tInput'}).input("First control")
|
24
|
+
@panel6.button({:id => 'bOk'}).click
|
25
|
+
|
26
|
+
@label6.text.strip.should == "First control"
|
27
|
+
@label8.text.strip.should == ""
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should enter text into the second box" do
|
31
|
+
@panel8.text_area({:id => 'tInput'}).input("Second control")
|
32
|
+
@panel8.button({:id => 'bOk'}).click
|
33
|
+
|
34
|
+
@label8.text.strip.should == "Second control"
|
35
|
+
@label6.text.strip.should == ""
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe "EditableDataGrid" 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>EditableDataGrid1')
|
11
|
+
|
12
|
+
@data_grid = @flex.data_grid({:id => 'dgEditable'})
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should edit a cell in the datagrid by using automationIndex" do
|
16
|
+
@data_grid.values(0,3).should == [
|
17
|
+
["Christina Coenraets", "555-219-2270", "ccoenraets@fictitious.com", "true" ],
|
18
|
+
["Joanne Wall", "555-219-2012", "jwall@fictitious.com" , "true" ],
|
19
|
+
["Maurice Smith", "555-219-2012", "maurice@fictitious.com" , "false"],
|
20
|
+
["Mary Jones", "555-219-2000", "mjones@fictitious.com" , "true" ]
|
21
|
+
]
|
22
|
+
|
23
|
+
@data_grid.select("*Joanne Wall* | 555-219-2012 | jwall@fictitious.com | true")
|
24
|
+
@data_grid.text_area({:automationIndex => 'name:1'}).input('Peter')
|
25
|
+
@data_grid.select("Peter | *555-219-2012* | jwall@fictitious.com | true")
|
26
|
+
@data_grid.text_area({:automationIndex => 'phone:1'}).input('7777')
|
27
|
+
@flex.box({:id => 'dgPanel'}).click
|
28
|
+
|
29
|
+
@data_grid.values(0,3).should == [
|
30
|
+
["Christina Coenraets", "555-219-2270", "ccoenraets@fictitious.com", "true" ],
|
31
|
+
["Peter", "7777", "jwall@fictitious.com" , "true" ],
|
32
|
+
["Maurice Smith", "555-219-2012", "maurice@fictitious.com" , "false"],
|
33
|
+
["Mary Jones", "555-219-2000", "mjones@fictitious.com" , "true" ]
|
34
|
+
]
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should edit a cell with itemrenderer in the datagrid by using automationIndex" do
|
38
|
+
@data_grid.values(0,3).should == [
|
39
|
+
["Christina Coenraets", "555-219-2270", "ccoenraets@fictitious.com", "true" ],
|
40
|
+
["Joanne Wall", "555-219-2012", "jwall@fictitious.com" , "true" ],
|
41
|
+
["Maurice Smith", "555-219-2012", "maurice@fictitious.com" , "false"],
|
42
|
+
["Mary Jones", "555-219-2000", "mjones@fictitious.com" , "true" ]
|
43
|
+
]
|
44
|
+
|
45
|
+
@data_grid.select("Joanne Wall | 555-219-2012 | jwall@fictitious.com | *true*")
|
46
|
+
@data_grid.combo_box({:automationIndex => 'active:1'}).open
|
47
|
+
@data_grid.combo_box({:automationIndex => 'active:1'}).select('false')
|
48
|
+
@flex.box({:id => 'dgPanel'}).click
|
49
|
+
|
50
|
+
@data_grid.values(0,3).should == [
|
51
|
+
["Christina Coenraets", "555-219-2270", "ccoenraets@fictitious.com", "true" ],
|
52
|
+
["Joanne Wall", "555-219-2012", "jwall@fictitious.com" , "false"],
|
53
|
+
["Maurice Smith", "555-219-2012", "maurice@fictitious.com" , "false"],
|
54
|
+
["Mary Jones", "555-219-2000", "mjones@fictitious.com" , "true" ]
|
55
|
+
]
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should edit a cell in the datagrid by using automationValue" do
|
59
|
+
@data_grid.values(0,3).should == [
|
60
|
+
["Christina Coenraets", "555-219-2270", "ccoenraets@fictitious.com", "true" ],
|
61
|
+
["Joanne Wall", "555-219-2012", "jwall@fictitious.com" , "true" ],
|
62
|
+
["Maurice Smith", "555-219-2012", "maurice@fictitious.com" , "false"],
|
63
|
+
["Mary Jones", "555-219-2000", "mjones@fictitious.com" , "true" ]
|
64
|
+
]
|
65
|
+
|
66
|
+
@data_grid.select("*Joanne Wall* | 555-219-2012 | jwall@fictitious.com | true")
|
67
|
+
@data_grid.text_area({:automationValue => 'Joanne Wall'}).input('Peter')
|
68
|
+
@flex.box({:id => 'dgPanel'}).click
|
69
|
+
|
70
|
+
@data_grid.values(0,3).should == [
|
71
|
+
["Christina Coenraets", "555-219-2270", "ccoenraets@fictitious.com", "true" ],
|
72
|
+
["Peter", "555-219-2012", "jwall@fictitious.com" , "true" ],
|
73
|
+
["Maurice Smith", "555-219-2012", "maurice@fictitious.com" , "false"],
|
74
|
+
["Mary Jones", "555-219-2000", "mjones@fictitious.com" , "true" ]
|
75
|
+
]
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe "DataGrid" 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>DataGrid1')
|
11
|
+
|
12
|
+
@data_grid = @flex.data_grid({:id => 'dg'})
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should get columnnames from a datagrid" do
|
16
|
+
pending "Find out why invisible columns is shown" do
|
17
|
+
@data_grid.column_names.should == ['name', 'phone', 'email']
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should get data from a datagrid" do
|
22
|
+
pending "Find out why invisible columns is shown" do
|
23
|
+
@data_grid.values(0,3).should == [
|
24
|
+
["Christina Coenraets", "555-219-2270", "ccoenraets@fictitious.com"],
|
25
|
+
["Joanne Wall", "555-219-2012", "jwall@fictitious.com" ],
|
26
|
+
["Maurice Smith", "555-219-2012", "maurice@fictitious.com" ],
|
27
|
+
["Mary Jones", "555-219-2000", "mjones@fictitious.com" ]
|
28
|
+
]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should get num_columns from a datagrid" do
|
33
|
+
pending "Find out why invisible columns is shown" do
|
34
|
+
@data_grid.num_columns.should == 3
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should get num_rows from a datagrid" do
|
39
|
+
@data_grid.num_rows.should == 4
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should select row" do
|
43
|
+
@data_grid.select("*Joanne Wall* | 555-219-2012 | jwall@fictitious.com")
|
44
|
+
|
45
|
+
@data_grid.selected_index.should == 1
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should deselect row" do
|
49
|
+
@data_grid.select("*Joanne Wall* | 555-219-2012 | jwall@fictitious.com")
|
50
|
+
@data_grid.deselect("*Joanne Wall* | 555-219-2012 | jwall@fictitious.com")
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should drag and drop" do
|
54
|
+
pending "Find out why invisible columns is shown" do
|
55
|
+
@data_grid.drag_start("*Joanne Wall* | 555-219-2012 | jwall@fictitious.com")
|
56
|
+
|
57
|
+
data_grid_drop = @flex.data_grid({:id => 'dgDrop'})
|
58
|
+
data_grid_drop.drag_drop('copy')
|
59
|
+
|
60
|
+
data_grid_drop.values(0,0).should == [
|
61
|
+
["Joanne Wall", "555-219-2012", "jwall@fictitious.com"]
|
62
|
+
]
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|