druid-s 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.rspec +1 -0
- data/.rvmrc +1 -0
- data/.travis.yml +27 -0
- data/ChangeLog +541 -0
- data/Gemfile +8 -0
- data/README.md +78 -0
- data/Rakefile +33 -0
- data/cucumber.yml +6 -0
- data/druid.gemspec +30 -0
- data/features/area.feature +33 -0
- data/features/async.feature +16 -0
- data/features/audio.feature +61 -0
- data/features/bold.feature +20 -0
- data/features/button.feature +81 -0
- data/features/canvas.feature +34 -0
- data/features/checkbox.feature +48 -0
- data/features/div.feature +45 -0
- data/features/element.feature +281 -0
- data/features/file_field.feature +38 -0
- data/features/form.feature +37 -0
- data/features/frames.feature +76 -0
- data/features/generic_elements.feature +29 -0
- data/features/heading.feature +160 -0
- data/features/hidden_field.feature +39 -0
- data/features/html/async.html +31 -0
- data/features/html/frame_1.html +18 -0
- data/features/html/frame_2.html +16 -0
- data/features/html/frame_3.html +14 -0
- data/features/html/frames.html +12 -0
- data/features/html/hover.html +11 -0
- data/features/html/iframes.html +12 -0
- data/features/html/images/circle.png +0 -0
- data/features/html/images/img_pulpit.jpg +0 -0
- data/features/html/modal.html +17 -0
- data/features/html/modal_1.html +38 -0
- data/features/html/modal_2.html +27 -0
- data/features/html/multi_elements.html +145 -0
- data/features/html/nested_elements.html +75 -0
- data/features/html/nested_frame_1.html +1 -0
- data/features/html/nested_frame_2.html +11 -0
- data/features/html/nested_frame_3.html +14 -0
- data/features/html/nested_frames.html +10 -0
- data/features/html/planets.gif +0 -0
- data/features/html/static_elements.html +203 -0
- data/features/html/success.html +8 -0
- data/features/html/sun.gif +0 -0
- data/features/html/sun.html +7 -0
- data/features/image.feature +47 -0
- data/features/italic.feature +20 -0
- data/features/javascript.feature +28 -0
- data/features/label.feature +43 -0
- data/features/link.feature +56 -0
- data/features/list_item.feature +37 -0
- data/features/modal_dialog.feature +9 -0
- data/features/multi_elements.feature +498 -0
- data/features/nested_elements.feature +121 -0
- data/features/ordered_list.feature +46 -0
- data/features/page_level_actions.feature +116 -0
- data/features/paragraph.feature +33 -0
- data/features/populate_page_with.feature +25 -0
- data/features/radio_button.feature +51 -0
- data/features/radio_button_group.feature +28 -0
- data/features/sample-app/public/04-Death_Becomes_Fur.mp4 +0 -0
- data/features/sample-app/public/04-Death_Becomes_Fur.oga +0 -0
- data/features/sample-app/public/audio_video.html +19 -0
- data/features/sample-app/public/jquery-1.3.2.js +4376 -0
- data/features/sample-app/public/jquery.html +28 -0
- data/features/sample-app/public/movie.mp4 +0 -0
- data/features/sample-app/public/movie.ogg +0 -0
- data/features/sample-app/public/prototype-1.6.0.3.js +4320 -0
- data/features/sample-app/public/prototype.html +32 -0
- data/features/sample-app/sample_app.rb +35 -0
- data/features/section.feature +132 -0
- data/features/select_list.feature +84 -0
- data/features/span.feature +43 -0
- data/features/step_definations/area_steps.rb +23 -0
- data/features/step_definations/async_steps.rb +80 -0
- data/features/step_definations/audio_steps.rb +47 -0
- data/features/step_definations/bold_steps.rb +11 -0
- data/features/step_definations/button_steps.rb +52 -0
- data/features/step_definations/canvas_steps.rb +19 -0
- data/features/step_definations/checkbox_steps.rb +39 -0
- data/features/step_definations/div_steps.rb +28 -0
- data/features/step_definations/element_steps.rb +217 -0
- data/features/step_definations/file_field_steps.rb +31 -0
- data/features/step_definations/form_steps.rb +23 -0
- data/features/step_definations/frame_steps.rb +189 -0
- data/features/step_definations/generic_element_steps.rb +31 -0
- data/features/step_definations/heading_steps.rb +39 -0
- data/features/step_definations/hidden_field_steps.rb +27 -0
- data/features/step_definations/image_steps.rb +35 -0
- data/features/step_definations/italic_steps.rb +11 -0
- data/features/step_definations/javasript_steps.rb +52 -0
- data/features/step_definations/label_steps.rb +19 -0
- data/features/step_definations/link_steps.rb +42 -0
- data/features/step_definations/list_item_steps.rb +24 -0
- data/features/step_definations/modal_dialog_steps.rb +38 -0
- data/features/step_definations/multi_elements_steps.rb +557 -0
- data/features/step_definations/nested_elements_steps.rb +219 -0
- data/features/step_definations/ordered_list_steps.rb +49 -0
- data/features/step_definations/page_level_actions_steps.rb +172 -0
- data/features/step_definations/page_traversal_steps.rb +4 -0
- data/features/step_definations/paragraph_steps.rb +19 -0
- data/features/step_definations/populate_page_with_steps.rb +3 -0
- data/features/step_definations/radio_button_group_steps.rb +32 -0
- data/features/step_definations/radio_button_steps.rb +31 -0
- data/features/step_definations/section_steps.rb +271 -0
- data/features/step_definations/select_list_steps.rb +91 -0
- data/features/step_definations/span_steps.rb +23 -0
- data/features/step_definations/table_cell_steps.rb +27 -0
- data/features/step_definations/table_row_steps.rb +23 -0
- data/features/step_definations/table_steps.rb +109 -0
- data/features/step_definations/text_area_steps.rb +39 -0
- data/features/step_definations/text_field_steps.rb +39 -0
- data/features/step_definations/unordered_list_steps.rb +27 -0
- data/features/step_definations/video_steps.rb +27 -0
- data/features/support/ajax_test_environment.rb +26 -0
- data/features/support/audio_video_page.rb +23 -0
- data/features/support/env.rb +5 -0
- data/features/support/hooks.rb +3 -0
- data/features/support/page.rb +372 -0
- data/features/support/persistent_browser.rb +58 -0
- data/features/support/targets/firefox14_osx.rb +5 -0
- data/features/support/targets/firefox14_windows7.rb +5 -0
- data/features/support/url_helper.rb +50 -0
- data/features/table.feature +127 -0
- data/features/table_cell.feature +42 -0
- data/features/table_row.feature +30 -0
- data/features/text_area.feature +44 -0
- data/features/text_field.feature +53 -0
- data/features/unordered_list.feature +46 -0
- data/features/video.feature +66 -0
- data/lib/druid/accessors.rb +1082 -0
- data/lib/druid/assist.rb +653 -0
- data/lib/druid/element_locators.rb +21 -0
- data/lib/druid/elements/area.rb +9 -0
- data/lib/druid/elements/audio.rb +9 -0
- data/lib/druid/elements/bold.rb +8 -0
- data/lib/druid/elements/button.rb +12 -0
- data/lib/druid/elements/canvas.rb +9 -0
- data/lib/druid/elements/check_box.rb +9 -0
- data/lib/druid/elements/div.rb +9 -0
- data/lib/druid/elements/element.rb +187 -0
- data/lib/druid/elements/file_field.rb +9 -0
- data/lib/druid/elements/form.rb +9 -0
- data/lib/druid/elements/heading.rb +14 -0
- data/lib/druid/elements/hidden_field.rb +9 -0
- data/lib/druid/elements/image.rb +9 -0
- data/lib/druid/elements/italic.rb +9 -0
- data/lib/druid/elements/label.rb +8 -0
- data/lib/druid/elements/link.rb +9 -0
- data/lib/druid/elements/list_item.rb +9 -0
- data/lib/druid/elements/media.rb +11 -0
- data/lib/druid/elements/option.rb +9 -0
- data/lib/druid/elements/ordered_list.rb +29 -0
- data/lib/druid/elements/paragraph.rb +9 -0
- data/lib/druid/elements/radio_button.rb +9 -0
- data/lib/druid/elements/select_list.rb +30 -0
- data/lib/druid/elements/span.rb +9 -0
- data/lib/druid/elements/table.rb +92 -0
- data/lib/druid/elements/table_cell.rb +11 -0
- data/lib/druid/elements/table_row.rb +50 -0
- data/lib/druid/elements/text_area.rb +10 -0
- data/lib/druid/elements/text_field.rb +11 -0
- data/lib/druid/elements/unordered_list.rb +32 -0
- data/lib/druid/elements/video.rb +8 -0
- data/lib/druid/elements.rb +55 -0
- data/lib/druid/javascript/angularjs.rb +12 -0
- data/lib/druid/javascript/jquery.rb +12 -0
- data/lib/druid/javascript/prototype.rb +12 -0
- data/lib/druid/javascript/yui.rb +19 -0
- data/lib/druid/javascript_framework_facade.rb +76 -0
- data/lib/druid/locator_generator.rb +181 -0
- data/lib/druid/nested_elements.rb +56 -0
- data/lib/druid/page_factory.rb +115 -0
- data/lib/druid/page_populator.rb +104 -0
- data/lib/druid/section_collection.rb +17 -0
- data/lib/druid/version.rb +3 -0
- data/lib/druid.rb +452 -0
- data/spec/druid/accessors_spec.rb +1209 -0
- data/spec/druid/druid_spec.rb +295 -0
- data/spec/druid/element_locators_spec.rb +750 -0
- data/spec/druid/elements/bold_spec.rb +12 -0
- data/spec/druid/elements/button_spec.rb +23 -0
- data/spec/druid/elements/check_box_spec.rb +14 -0
- data/spec/druid/elements/div_spec.rb +10 -0
- data/spec/druid/elements/element_spec.rb +250 -0
- data/spec/druid/elements/file_field_spec.rb +13 -0
- data/spec/druid/elements/form_spec.rb +18 -0
- data/spec/druid/elements/heading_spec.rb +30 -0
- data/spec/druid/elements/hidden_field_spec.rb +10 -0
- data/spec/druid/elements/image_spec.rb +23 -0
- data/spec/druid/elements/itatic_spec.rb +11 -0
- data/spec/druid/elements/label_spec.rb +10 -0
- data/spec/druid/elements/link_spec.rb +10 -0
- data/spec/druid/elements/list_item_spec.rb +10 -0
- data/spec/druid/elements/media_spec.rb +12 -0
- data/spec/druid/elements/option_spec.rb +21 -0
- data/spec/druid/elements/ordered_list_spec.rb +38 -0
- data/spec/druid/elements/page_factory_spec.rb +40 -0
- data/spec/druid/elements/paragraph_spec.rb +12 -0
- data/spec/druid/elements/radio_button_spec.rb +14 -0
- data/spec/druid/elements/select_list_spec.rb +51 -0
- data/spec/druid/elements/span_spec.rb +10 -0
- data/spec/druid/elements/table_cell_spec.rb +14 -0
- data/spec/druid/elements/table_row_spec.rb +34 -0
- data/spec/druid/elements/table_spec.rb +47 -0
- data/spec/druid/elements/text_area_spec.rb +13 -0
- data/spec/druid/elements/text_field_spec.rb +22 -0
- data/spec/druid/elements/unordered_list_spec.rb +39 -0
- data/spec/druid/javascript_framework_facade_spec.rb +59 -0
- data/spec/druid/nested_element_spec.rb +128 -0
- data/spec/druid/page_factory_spec.rb +235 -0
- data/spec/druid/page_populator_spec.rb +173 -0
- data/spec/druid/page_section_spec.rb +70 -0
- data/spec/spec_helper.rb +9 -0
- metadata +517 -0
@@ -0,0 +1,116 @@
|
|
1
|
+
Feature: Page level actions
|
2
|
+
In order to act on pages from a web site
|
3
|
+
Testers will need to use the page object to encapsulate access
|
4
|
+
|
5
|
+
Scenario: Getting the text from a web page
|
6
|
+
Given I am on the static elements page
|
7
|
+
Then the page should contain the text "Static Elements Page"
|
8
|
+
|
9
|
+
Scenario: Getting the html from a web page
|
10
|
+
Given I am on the static elements page
|
11
|
+
Then the page should contain the html "<title>Static Elements Page</title>"
|
12
|
+
|
13
|
+
Scenario: Getting the title from a web page
|
14
|
+
Given I am on the static elements page
|
15
|
+
Then the page should have the title "Static Elements Page"
|
16
|
+
|
17
|
+
Scenario: Going to baidu.com from a web page
|
18
|
+
Given I am on the static elements page
|
19
|
+
Then I am able to go to baidu.com
|
20
|
+
|
21
|
+
Scenario: Going to baidu.com by default
|
22
|
+
Given I can goto baidu.com by default
|
23
|
+
Then the page should have the title "百度"
|
24
|
+
|
25
|
+
Scenario: Using the visit_page methods without block
|
26
|
+
Given I can goto baidu.com using visit_page without block
|
27
|
+
Then the page should have the title "百度" using on_page without block
|
28
|
+
|
29
|
+
Scenario: Using the visit_page methods with block
|
30
|
+
Given I can goto baidu.com using visit_page with block
|
31
|
+
Then the page should have the title "百度" using on_page with block
|
32
|
+
|
33
|
+
Scenario: Validating the page title
|
34
|
+
Given I am on the static elements page
|
35
|
+
Then the page should have the expected title
|
36
|
+
|
37
|
+
Scenario: Validating the expected element
|
38
|
+
Given I am on the static elements page
|
39
|
+
Then the page should have the expected element
|
40
|
+
|
41
|
+
Scenario: Validating that an expected element does not exist
|
42
|
+
Given I am on the static elements page
|
43
|
+
Then the page should not have the expected element
|
44
|
+
|
45
|
+
Scenario: Waiting for something
|
46
|
+
Given I am on the static elements page
|
47
|
+
Then I should be able to wait for a block to return true
|
48
|
+
|
49
|
+
Scenario: Handling alert popups
|
50
|
+
Given I am on the static elements page
|
51
|
+
When I handle the alert
|
52
|
+
Then I should be able to get the alert's message
|
53
|
+
|
54
|
+
Scenario: Handling possible alert popups
|
55
|
+
Given I am on the static elements page
|
56
|
+
When I handle the possible alert
|
57
|
+
Then I should be able to verify the popup didn't have a message
|
58
|
+
|
59
|
+
Scenario: Handling alert popups that reload the page
|
60
|
+
Given I am on the static elements page
|
61
|
+
When I handle the alert that reloads the page
|
62
|
+
Then I should be able to get the alert's message
|
63
|
+
|
64
|
+
Scenario: Handling confirm popups
|
65
|
+
Given I am on the static elements page
|
66
|
+
When I handle the confirm
|
67
|
+
Then I should be able to get the confirm's message
|
68
|
+
|
69
|
+
Scenario: Handling possible confirm popups
|
70
|
+
Given I am on the static elements page
|
71
|
+
When I handle the possible confirm
|
72
|
+
Then I should be able to verify the popup didn't have a message
|
73
|
+
|
74
|
+
Scenario: Handling confirm popups that reload the page
|
75
|
+
Given I am on the static elements page
|
76
|
+
When I handle the confirm that reloads the page
|
77
|
+
Then I should be able to get the confirm's message
|
78
|
+
|
79
|
+
Scenario: Handling prompt popups
|
80
|
+
Given I am on the static elements page
|
81
|
+
When I handle the prompt
|
82
|
+
Then I should be able to get the message and default value
|
83
|
+
|
84
|
+
Scenario: Handling possible prompt popups
|
85
|
+
Given I am on the static elements page
|
86
|
+
When I handle the possible prompt
|
87
|
+
Then I should be able to verify the popup didn't have a message
|
88
|
+
|
89
|
+
Scenario: Attach to window using title
|
90
|
+
Given I am on the static elements page
|
91
|
+
When I open a second window
|
92
|
+
Then I should be able to attach to page object using title
|
93
|
+
|
94
|
+
Scenario: Attach to window using url
|
95
|
+
Given I am on the static elements page
|
96
|
+
When I open a second window
|
97
|
+
Then I should be able to attach to page object using url
|
98
|
+
|
99
|
+
Scenario: Attach to widnow using index
|
100
|
+
Given I am on the static elements page
|
101
|
+
When I open a second window
|
102
|
+
Then I should be able to attach to page object using index
|
103
|
+
|
104
|
+
Scenario: Refreshing the page
|
105
|
+
Given I am on the static elements page
|
106
|
+
Then I should be able to refresh the page
|
107
|
+
|
108
|
+
@dev
|
109
|
+
Scenario: Going back and forward
|
110
|
+
Given I am on the static elements page
|
111
|
+
When I select the link labeled "Google Search"
|
112
|
+
Then the page should contain the text "Success"
|
113
|
+
When I press the back button
|
114
|
+
Then the page should contain the text "Static Elements Page"
|
115
|
+
When I press the forward button
|
116
|
+
Then the page should contain the text "Success"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Feature: Paragraph
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given I am on the static elements page
|
5
|
+
|
6
|
+
Scenario: Getting the text from a paragraph
|
7
|
+
When I get the text from the paragraph
|
8
|
+
Then the text should be "Static Elements Page"
|
9
|
+
|
10
|
+
Scenario Outline: Locating paragraphs on the page
|
11
|
+
When I search for the paragraph by "<search_by>"
|
12
|
+
Then the text should be "Static Elements Page"
|
13
|
+
|
14
|
+
Examples:
|
15
|
+
| search_by |
|
16
|
+
| id |
|
17
|
+
| class |
|
18
|
+
| xpath |
|
19
|
+
| index |
|
20
|
+
| css |
|
21
|
+
|
22
|
+
Scenario Outline: Locating paragraphs using multiple parameters
|
23
|
+
When I search for the paragraph by "<param1>" and "<param2>"
|
24
|
+
Then the text should be "Static Elements Page"
|
25
|
+
|
26
|
+
Examples:
|
27
|
+
| param1 | param2 |
|
28
|
+
| class | index |
|
29
|
+
|
30
|
+
Scenario: Finding a paragraph dynamically
|
31
|
+
When I get the text from a paragraph while the script is executing
|
32
|
+
Then I should see that the paragraph exists
|
33
|
+
And the text should be "Static Elements Page"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Feature: Populate Page With
|
2
|
+
In order to quickly fill out forms on a page
|
3
|
+
A tester will use the populate_page_with method
|
4
|
+
To fill in text, select options, check boxes, and select radio buttons
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given I am on the static elements page
|
8
|
+
|
9
|
+
Scenario:
|
10
|
+
When I populate the page with the data:
|
11
|
+
| text_field_id | abcDEF |
|
12
|
+
| text_area_id | abcdefghijklmnop |
|
13
|
+
| select_list_id | Test 2 |
|
14
|
+
| cb_id | check |
|
15
|
+
| butter_id | check |
|
16
|
+
| favorite_cheese | muen |
|
17
|
+
Then the text field should contain "abcDEF"
|
18
|
+
And the text area should contain "abcdefghijklmnop"
|
19
|
+
And the selected option should be "Test 2"
|
20
|
+
And the First check box should be selected
|
21
|
+
And the "Butter" radio button should be selected
|
22
|
+
And the "muen" radio button should be selected in the group
|
23
|
+
When I populate the page with the data:
|
24
|
+
| select_list_id | option3 |
|
25
|
+
Then the selected option should be "Test/Test 3"
|
@@ -0,0 +1,51 @@
|
|
1
|
+
Feature: Radio Buttons
|
2
|
+
In order to interact with radio buttons
|
3
|
+
Testers will need access and interrogation ability
|
4
|
+
|
5
|
+
Background:
|
6
|
+
Given I am on the static elements page
|
7
|
+
|
8
|
+
Scenario: Selecting a radio button
|
9
|
+
When I select the "Milk" radio button
|
10
|
+
Then the "Milk" radio button should be selected
|
11
|
+
When I select the "Butter" radio button
|
12
|
+
Then the "Butter" radio button should be selected
|
13
|
+
|
14
|
+
@dev
|
15
|
+
Scenario Outline: Locating radio buttons on the Page
|
16
|
+
When I locate the radio button by "<locate_by>"
|
17
|
+
And I select the radio button
|
18
|
+
Then the "Milk" radio button should be selected
|
19
|
+
|
20
|
+
Scenarios:
|
21
|
+
| locate_by |
|
22
|
+
| id |
|
23
|
+
| class |
|
24
|
+
| name |
|
25
|
+
| xpath |
|
26
|
+
| index |
|
27
|
+
| value |
|
28
|
+
| label |
|
29
|
+
| css |
|
30
|
+
|
31
|
+
Scenario: Retrieve a radio button
|
32
|
+
When I retrieve a radio button
|
33
|
+
Then I should know it exists
|
34
|
+
And I should know it is visible
|
35
|
+
|
36
|
+
@multi
|
37
|
+
Scenario Outline: Locating radio buttons using multiple parameters
|
38
|
+
When I search for the radio button by "<param1>" and "<param2>"
|
39
|
+
And I select the radio button
|
40
|
+
Then the "Milk" radio button should be selected
|
41
|
+
|
42
|
+
Examples:
|
43
|
+
| param1 | param2 |
|
44
|
+
| class | index |
|
45
|
+
| name | index |
|
46
|
+
|
47
|
+
@locator
|
48
|
+
Scenario: Finding a radio button dynamically
|
49
|
+
When I select the radio button while the script is executing
|
50
|
+
Then I should see that the radio button exists
|
51
|
+
And the "Milk" radio button should be selected
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Feature: Radio Button Groups
|
2
|
+
In order to interact with radio button groups
|
3
|
+
Testers will need access and interrogation ability
|
4
|
+
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given I am on the static elements page
|
8
|
+
|
9
|
+
Scenario: Confirm existence of a radio button group
|
10
|
+
Then I should see that the radio button group exists
|
11
|
+
|
12
|
+
Scenario: No radio buttons in the group have been selected
|
13
|
+
Then no radio buttons should be selected in the group
|
14
|
+
|
15
|
+
Scenario: Selecting grouped radio buttons by value
|
16
|
+
When I select the "ched" radio button in the group
|
17
|
+
Then the "ched" radio button should be selected in the group
|
18
|
+
And the "emmen" radio button should not be selected
|
19
|
+
And the "muen" radio button should not be selected
|
20
|
+
When I select the "muen" radio button in the group
|
21
|
+
Then the "ched" radio button should not be selected
|
22
|
+
And the "emmen" radio button should not be selected
|
23
|
+
And the "muen" radio button should be selected in the group
|
24
|
+
|
25
|
+
Scenario: Getting an array of elements for each radio button in the group
|
26
|
+
When I ask for the elements of a radio button group
|
27
|
+
Then I should have an array with elements for each radio button
|
28
|
+
And the radio button element values should be "ched", "emmen", "muen"
|
Binary file
|
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Audio and Video</title>
|
4
|
+
</head>
|
5
|
+
<body>
|
6
|
+
<h2>Audio & Video</h2>
|
7
|
+
<audio controls id="audio" name="audio" class="audio">
|
8
|
+
<source src="04-Death_Becomes_Fur.mp4" type="audio/mp4">
|
9
|
+
<source src="04-Death_Becomes_Fur.oga" type="audio/ogg; codecs=vorbis">
|
10
|
+
<p>Your user agent does not support the HTML5 Audio element.</p>
|
11
|
+
</audio>
|
12
|
+
|
13
|
+
<video width="320" height="240" controls="controls" id="video" name="video" class="video">
|
14
|
+
<source src="movie.mp4" type="video/mp4" />
|
15
|
+
<source src="movie.ogg" type="video/ogg" />
|
16
|
+
Your browser does not support the video tag.
|
17
|
+
</video>
|
18
|
+
</body>
|
19
|
+
</html>
|