druid-ts 0.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.rspec +1 -0
  4. data/.rvmrc +1 -0
  5. data/.travis.yml +1 -2
  6. data/ChangeLog +218 -0
  7. data/Gemfile +2 -1
  8. data/README.md +64 -7
  9. data/Rakefile +1 -1
  10. data/druid.gemspec +25 -0
  11. data/features/async.feature +18 -0
  12. data/features/button.feature +42 -1
  13. data/features/checkbox.feature +7 -1
  14. data/features/div.feature +6 -0
  15. data/features/element.feature +100 -0
  16. data/features/file_field.feature +35 -0
  17. data/features/form.feature +12 -6
  18. data/features/frames.feature +57 -0
  19. data/features/heading.feature +164 -0
  20. data/features/hidden_field.feature +6 -0
  21. data/features/html/async.html +18 -0
  22. data/features/html/frame_1.html +18 -0
  23. data/features/html/frame_2.html +16 -0
  24. data/features/html/frame_3.html +14 -0
  25. data/features/html/frames.html +12 -0
  26. data/features/html/iframes.html +12 -0
  27. data/features/html/modal.html +17 -0
  28. data/features/html/modal_1.html +38 -0
  29. data/features/html/modal_2.html +27 -0
  30. data/features/html/nested_elements.html +52 -0
  31. data/features/html/nested_frame_1.html +1 -0
  32. data/features/html/nested_frame_2.html +11 -0
  33. data/features/html/nested_frame_3.html +14 -0
  34. data/features/html/nested_frames.html +10 -0
  35. data/features/html/static_elements.html +29 -23
  36. data/features/image.feature +8 -0
  37. data/features/link.feature +5 -0
  38. data/features/list_item.feature +5 -0
  39. data/features/modal_dialog.feature +9 -0
  40. data/features/nested_elements.feature +105 -0
  41. data/features/ordered_list.feature +6 -0
  42. data/features/page_level_actions.feature +48 -0
  43. data/features/paragraph.feature +33 -0
  44. data/features/radio_button.feature +6 -0
  45. data/features/select_list.feature +6 -1
  46. data/features/span.feature +6 -1
  47. data/features/step_definations/async_steps.rb +63 -0
  48. data/features/step_definations/button_steps.rb +25 -1
  49. data/features/step_definations/checkbox_steps.rb +5 -1
  50. data/features/step_definations/div_steps.rb +6 -1
  51. data/features/step_definations/element_steps.rb +55 -1
  52. data/features/step_definations/file_field_steps.rb +27 -0
  53. data/features/step_definations/form_steps.rb +8 -0
  54. data/features/step_definations/frame_steps.rb +112 -0
  55. data/features/step_definations/heading_steps.rb +39 -0
  56. data/features/step_definations/hidden_field_steps.rb +7 -3
  57. data/features/step_definations/image_steps.rb +7 -3
  58. data/features/step_definations/link_steps.rb +8 -3
  59. data/features/step_definations/list_item_steps.rb +9 -1
  60. data/features/step_definations/modal_dialog_steps.rb +38 -0
  61. data/features/step_definations/nested_elements_steps.rb +196 -0
  62. data/features/step_definations/ordered_list_steps.rb +11 -3
  63. data/features/step_definations/page_level_actions_steps.rb +72 -0
  64. data/features/step_definations/paragraph_steps.rb +15 -0
  65. data/features/step_definations/radio_button_steps.rb +5 -1
  66. data/features/step_definations/select_list_steps.rb +10 -2
  67. data/features/step_definations/span_steps.rb +5 -1
  68. data/features/step_definations/table_cell_steps.rb +5 -1
  69. data/features/step_definations/table_steps.rb +17 -3
  70. data/features/step_definations/text_area_steps.rb +18 -2
  71. data/features/step_definations/text_field_steps.rb +9 -1
  72. data/features/step_definations/unordered_list_steps.rb +11 -3
  73. data/features/support/env.rb +0 -15
  74. data/features/support/hooks.rb +7 -0
  75. data/features/support/page.rb +98 -1
  76. data/features/support/persistent_browser.rb +15 -0
  77. data/features/support/url_helper.rb +24 -1
  78. data/features/table.feature +7 -0
  79. data/features/table_cell.feature +6 -0
  80. data/features/text_area.feature +11 -0
  81. data/features/text_field.feature +6 -1
  82. data/features/unordered_list.feature +6 -0
  83. data/lib/druid.rb +251 -3
  84. data/lib/druid/accessors.rb +446 -158
  85. data/lib/druid/assist.rb +394 -0
  86. data/lib/druid/core_ext/string.rb +5 -0
  87. data/lib/druid/element_locators.rb +405 -0
  88. data/lib/druid/elements.rb +28 -0
  89. data/lib/druid/elements/button.rb +6 -1
  90. data/lib/druid/elements/check_box.rb +26 -0
  91. data/lib/druid/elements/div.rb +3 -1
  92. data/lib/druid/elements/element.rb +170 -5
  93. data/lib/druid/elements/file_field.rb +18 -0
  94. data/lib/druid/elements/form.rb +11 -0
  95. data/lib/druid/elements/heading.rb +14 -0
  96. data/lib/druid/elements/hidden_field.rb +12 -2
  97. data/lib/druid/elements/image.rb +13 -0
  98. data/lib/druid/elements/link.rb +2 -0
  99. data/lib/druid/elements/list_item.rb +3 -1
  100. data/lib/druid/elements/option.rb +9 -0
  101. data/lib/druid/elements/ordered_list.rb +4 -5
  102. data/lib/druid/elements/paragraph.rb +9 -0
  103. data/lib/druid/elements/radio_button.rb +25 -0
  104. data/lib/druid/elements/select_list.rb +10 -1
  105. data/lib/druid/elements/span.rb +3 -1
  106. data/lib/druid/elements/table.rb +20 -1
  107. data/lib/druid/elements/table_cell.rb +7 -0
  108. data/lib/druid/elements/table_row.rb +5 -1
  109. data/lib/druid/elements/text_area.rb +15 -1
  110. data/lib/druid/elements/text_field.rb +11 -1
  111. data/lib/druid/elements/unordered_list.rb +5 -5
  112. data/lib/druid/nested_elements.rb +103 -0
  113. data/lib/druid/page_factory.rb +4 -4
  114. data/lib/druid/page_populator.rb +71 -0
  115. data/spec/druid/accessors_spec.rb +789 -0
  116. data/spec/druid/druid_spec.rb +130 -7
  117. data/spec/druid/element_locators_spec.rb +160 -0
  118. data/spec/druid/elements/button_spec.rb +31 -0
  119. data/spec/druid/elements/check_box_spec.rb +38 -0
  120. data/spec/druid/elements/div_spec.rb +19 -0
  121. data/spec/druid/elements/element_spec.rb +150 -0
  122. data/spec/druid/elements/file_field_spec.rb +27 -0
  123. data/spec/druid/elements/form_spec.rb +27 -0
  124. data/spec/druid/elements/heading_spec.rb +39 -0
  125. data/spec/druid/elements/hidden_field_spec.rb +24 -0
  126. data/spec/druid/elements/image_spec.rb +32 -0
  127. data/spec/druid/elements/link_spec.rb +26 -0
  128. data/spec/druid/elements/list_item_spec.rb +19 -0
  129. data/spec/druid/elements/option_spec.rb +10 -0
  130. data/spec/druid/elements/ordered_list_spec.rb +42 -0
  131. data/spec/druid/elements/page_factory_spec.rb +40 -0
  132. data/spec/druid/elements/paragraph_spec.rb +21 -0
  133. data/spec/druid/elements/radio_button_spec.rb +38 -0
  134. data/spec/druid/elements/select_list_spec.rb +37 -0
  135. data/spec/druid/elements/span_spec.rb +19 -0
  136. data/spec/druid/elements/table_cell_spec.rb +23 -0
  137. data/spec/druid/elements/table_row_spec.rb +41 -0
  138. data/spec/druid/elements/table_spec.rb +52 -0
  139. data/spec/druid/elements/text_area_spec.rb +31 -0
  140. data/spec/druid/elements/text_field_spec.rb +31 -0
  141. data/spec/druid/elements/unordered_list_spec.rb +42 -0
  142. data/spec/druid/nested_element_spec.rb +128 -0
  143. data/spec/druid/page_populator_spec.rb +92 -0
  144. data/spec/spec_helper.rb +2 -1
  145. metadata +147 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 181b245e5051d6a93aeb37fb0bcc085df08af882
4
- data.tar.gz: 811f5667bce43ddbd185e0b981dc8910c25b0491
3
+ metadata.gz: 1081889b9173a02ac8c5786c09771d230af18226
4
+ data.tar.gz: da6be1406dcb433fde5f47d4a699abb5c80bf9d7
5
5
  SHA512:
6
- metadata.gz: 41377cfa4542f102a921be37370dcc350d0b76c97e5764437e7d4eab1ff486392271e181f188b2d2f85c040f86f47e6116d4123e0c7c7fc19585315a08d31b2b
7
- data.tar.gz: d03f1173add3fdc7ac149e299405c960e9ae752d383aaa6b28e6d7f697498d57da5ef94b90df038cddab8264ce50b0ad948ad1567a144ad61ba07afdce75b946
6
+ metadata.gz: ebb267bdf529e1b094d287883bb3422ff5d41ab0377a6b3e4f6421a0205a0a7dadf74f7a7ee6bdff335ccdccdd21e85cd31da43b3e481e9684c1225c0ac794fd
7
+ data.tar.gz: 79e0be33f4dfe5f136731d6b7c388e1dc3f69aa9c2680b8bbc3766518506e2d88b8b25167d703ae71e950817ba5181fd6d652d42e32358f3e8c295f0a4201487
data/.gitignore CHANGED
@@ -1,2 +1,7 @@
1
1
  Gemfile.lock
2
2
  coverage
3
+ druid*.gem
4
+ .idea/
5
+ pkg
6
+ *.swp
7
+ .DS_Store
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color --format doc
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 2.3.0
@@ -4,5 +4,4 @@ rvm:
4
4
  before_script:
5
5
  - "export DISPLAY=:99.0"
6
6
  - "sh -e /etc/init.d/xvfb start"
7
- script: rake features:watir
8
-
7
+ script: rake features:watir_webdriver
@@ -0,0 +1,218 @@
1
+ ******1.1.0******
2
+ === 2016-11-14
3
+ * Enhancements
4
+ * Added ability to find a parent of an Element
5
+ * Added #focus method to Element
6
+ === 2016-08-05
7
+ * Enhancements
8
+ * Added ability to find Checkbox by :value
9
+ * Added ability to find HiddenField by :value
10
+ * Added #fire_event method to Element
11
+ * Fixes
12
+ * Updated #populate_page_with to no longer attempt to set a value in a field that is disabled
13
+ === 2016-08-04
14
+ * Enhancements
15
+ * Added ability to find TextField by :title
16
+ * Added ability to find Image by :alt
17
+ * Added ability to find Form by :action
18
+ * Added ability to find Image by :src
19
+ === 2016-08-03
20
+ * Enhancements
21
+ * Added ability to find image buttons by src
22
+ * Added ability to find image buttons by alt
23
+ * Added first_row and last_row methods to table
24
+ * Added new module PagePopulator with single method populate_page_with
25
+ * Added deprecation warning to the method_missing method on Element.
26
+ * Added all of the file_field locators
27
+ * Added full support for file_field element
28
+ === 2016-08-02
29
+ * Enhancements
30
+ * Added all of the h5 locators
31
+ * Added all of the h6 locators
32
+ * Added all of the paragraph locators
33
+ * Added the Paragraph class
34
+ * Added #current_url to Druid
35
+ * Added #style to Element
36
+ * Added #inspect to Element
37
+ * Added #clear_cookies to Druid
38
+ * Added #save_screenshot to Druid
39
+ * Changed PageFactory so it also sets and instance variable @current_page to the newly created page
40
+ * now can find radio buttons by value
41
+ * Added instance level in_frame, in_iframe method
42
+ * Support for nesting all *_element instance methods inside in_frame call
43
+ * Support for nesting alerts inside an in_frame call
44
+ * Support for nesting confirms inside an in_frame call
45
+ * Support for nesting prompts inside an in_frame call
46
+ === 2016-08-01
47
+ * Enhancements
48
+ * Added #clear method for TextArea
49
+ * Element#when_present now returns the element object
50
+ * Element#when_visible now returns the element object
51
+ * Element#when_not_visible now returns the element object
52
+ * Added all of the h2 locators
53
+ * Added all of the h3 locators
54
+ * Added all of the h4 locators
55
+ === 2016-07-31
56
+ * Enhancements
57
+ * Added support for Heading element
58
+ * Added all of the h1 locators
59
+ === 2016-07-29
60
+ * Enhancements
61
+ * Support for locating the following elements when nested
62
+ * Link
63
+ * Button
64
+ * TextField
65
+ * HiddenField
66
+ * TextArea
67
+ * SelectList
68
+ * CheckBox
69
+ * RadioButton
70
+ * Div
71
+ * Span
72
+ * Table
73
+ * TableCell
74
+ * Image
75
+ * Form
76
+ * OrderedList
77
+ * UnOrderedList
78
+ * ListItem
79
+ * Added #modal_dialog to Druid to override the default modal dialog behavior
80
+ === 2016-07-11
81
+ * Enhancements
82
+ * Added the following instance methods to Druid via ElementLocators
83
+ * #button_element
84
+ * #text_field_element
85
+ * #hidden_field_element
86
+ * #text_area_element
87
+ * #select_list_element
88
+ * #link_element
89
+ * #checkbox_element
90
+ * #radio_button_element
91
+ * #div_element
92
+ * #span_element
93
+ * #table_element
94
+ * #cell_element
95
+ * #image_element
96
+ * #form_element
97
+ * #list_item_element
98
+ * #unordered_list_element
99
+ * #ordered_list_element
100
+ === 2016-07-05
101
+ * Enhancements
102
+ * Added #value= to TextField and TextArea
103
+ * Added #select to SelectList
104
+ * Added #check, #uncheck, and #checked? to CheckBox
105
+ * Added #select, #clear, and #selected? to RadioButton
106
+ === 2016-07-04
107
+ * Enhancements
108
+ * Can now find span by :text
109
+ * Can now find button by :value
110
+ * Added #forward and #back methods to druid object
111
+ * Added #right_click and #double_click methods to Element
112
+ === 2016-07-03
113
+ * Enhancements
114
+ * Will call callback method #initialize_page method if it exists on a page object
115
+ * Renamed all *_<element_type> methods to *_element. Created alias for backward compatibility
116
+ * Delegating unknown method calls on Element to the driver element object
117
+
118
+ === 2016-06-30
119
+ * Enhancements
120
+ * Can now find a TableCell by its' text
121
+ * If we receive an error calling #attach_to_window, wait one second and try again
122
+ === 2016-06-29
123
+ * Enhancements
124
+ * Added ability to locate div by the contained text
125
+ * Added #attach_to_window so a page object can operate on another window
126
+ * Added #send_keys to Druid::Elements::Element
127
+ * Added #refresh to page object
128
+ * Added #clear method to Element
129
+ * Added #in_frame to Accessors to handle frame and iframe access
130
+ === 2016-06-21
131
+ * Enhancements
132
+ * Handling popups
133
+ * Added #alert to page object to override default alert popup behavior
134
+ * Added #confirm to page object to override default confirm popup behavior
135
+ * Added #prompt to page object to override default prompt popup behavior
136
+ === 2016-06-20
137
+ * Enhancements
138
+ * Async handling
139
+ * Added #wait_until to page object to support for async events at page level
140
+ * Added the following methods to Druid::Elements::Element
141
+ * #when_present
142
+ * #when_visible
143
+ * #when_not_visible
144
+ * #wait_until
145
+ === Version 1.0.0
146
+ === 2016-06-04
147
+ * Enhancements
148
+ * Support for using multiple identifiers when locating the following element:
149
+ * Link
150
+ * TextField
151
+ * HiddenField
152
+ * TextArea
153
+ * SelectList
154
+ * CheckBox
155
+ * RadioButton
156
+ * Button
157
+ * Div
158
+ * Span
159
+ * Table
160
+ * TableCell
161
+ * Image
162
+ * Form
163
+ * ListItem
164
+ * UnorderedList
165
+ * OrderedList
166
+
167
+ * Support name for identification across all elements in Watir
168
+ * Added [] method to SelectList to index Options
169
+ * Added options method to Select
170
+
171
+ === 2016-06-2
172
+ * Enhancements
173
+ * Added rows method to Table to return number of rows
174
+ * Added [] method to Table to index table row element
175
+ * Added columns method to TableRow to return the number of columns
176
+ * Added [] method to TableRow to index table cell element
177
+ * Added each method to Table to iterate over the TableRows
178
+ * Added each method to TableRow to iterate over TableCells
179
+ * Added items method to UnorderedList to return number of ListItems
180
+ * Added items method to OrderedList to return number of ListItems
181
+ * Added each method to UnorderedList to iterate over the ListItems
182
+ * Added each method to OrderedList to iterate over the ListItems
183
+ * Created PageFactory module to add factory methods to your step definitions
184
+
185
+
186
+ === 2016-05-31
187
+ * Enhancements
188
+ * Added support for the following elements
189
+ * hidden field
190
+ * form
191
+ * list item
192
+ * unordered list
193
+ * ordered list
194
+ * text area
195
+
196
+ === 2016-05-30
197
+ * Enhancements
198
+ * Added support for the following elements
199
+ * div
200
+ * button
201
+ * table
202
+ * table row
203
+ * table cell
204
+ * span
205
+ * image
206
+
207
+ === 2016-05-22
208
+ * Enhancements
209
+ * Support for the following elements
210
+ * check box
211
+ * link
212
+ * radio button
213
+ * select list
214
+ * text field
215
+ * Support for the following page level functions
216
+ * text
217
+ * html
218
+ * title
data/Gemfile CHANGED
@@ -2,6 +2,7 @@ source "http://rubygems.org"
2
2
 
3
3
  gem 'simplecov', :require => false, :group => :test
4
4
  gem 'rake'
5
- gem 'watir-webdriver'
5
+ gem 'watir-webdriver', '0.9.3'
6
+ gem 'selenium-webdriver', '2.53.4'
6
7
  gem 'rspec'
7
8
  gem 'cucumber'
data/README.md CHANGED
@@ -1,11 +1,68 @@
1
1
  # druid
2
+ [![Build Status](https://travis-ci.org/timsheng/druid.png)](https://travis-ci.org/timsheng)
2
3
 
3
- A simple gem that assists testers in creating flexible page objects for testing browser based applications
4
4
 
5
- # Note on Patches/Pull Requests
5
+ A simple gem that assists in creating flexible page objects for testing browser based applications. The goal is to facilitate creating abstraction layers in your tests to decouple the tests from the item they are testing and to provide a simple interface to the elements on a page. It works with watir-webdriver
6
6
 
7
- Fork the project
8
- Test drive your feature addition or bug fix. Adding specs is importing so I don't break it in a future version unintentionally.
9
- Commit, do not mess with rakefile, version, or history.
10
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
11
- Send me a pull request. Bonus points for topic branches.
7
+ ### Defining your page object
8
+
9
+ You define a new druid by including the Druid module:
10
+
11
+ class LoginPage
12
+ include Druid
13
+ end
14
+
15
+ When you include this module numerous methods are added to your class that allow you to easily define your page. For the login page you might add the following:
16
+
17
+ class LoginPage
18
+ include Druid
19
+
20
+ text_field(:username, :id => 'username')
21
+ text_field(:password, :id => 'password')
22
+ button(:login, :id => 'login')
23
+ end
24
+
25
+ Calling the _text_field_ and _button_ methods adds several methods to our druid that allow us to interact with the items on the page. To login using this page we could simply write the following code:
26
+
27
+ login_page.username = 'cheezy'
28
+ login_page.password = 'secret'
29
+ login_page.login
30
+
31
+ Another approach might be to create higher level methods on our druid that hide the implementation details even further. Our druid might look like this:
32
+
33
+ class LoginPage
34
+ include Druid
35
+
36
+ text_field(:username, :id => 'username')
37
+ text_field(:password, :id => 'password')
38
+ button(:login, :id => 'login')
39
+
40
+ def login_with(username, password)
41
+ self.username = username
42
+ self.password = password
43
+ login
44
+ end
45
+ end
46
+
47
+ and your usage of the page would become:
48
+
49
+ login_page.login_with 'cheezy', 'secret'
50
+
51
+ ### Creating your druid
52
+ druid supports [watir-webdriver](https://github.com/jarib/watir-webdriver)
53
+ The page object can be create like this:
54
+
55
+ browser = Watir::Browser.new :firefox
56
+ my_druid = MyDruid.new(browser)
57
+
58
+
59
+
60
+
61
+ ## Contribute
62
+
63
+ * Fork the project.
64
+ * Test drive your feature addition or bug fix. Adding specs is important and I will not accept a pull request that does not have tests
65
+ * Make sure you describe your new feature with a cucumber feature.
66
+ * Commit, do not mess with rakefile, version, or history.
67
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
68
+ * Send me a pull request. Bonus points for topic branches.
data/Rakefile CHANGED
@@ -27,7 +27,7 @@ task :default => :spec
27
27
 
28
28
 
29
29
  namespace :features do
30
- Cucumber::Rake::Task.new(:watir, "Run features with Watir") do |t|
30
+ Cucumber::Rake::Task.new(:watir_webdriver, "Run features with Watir webdriver") do |t|
31
31
  t.profile = "watir"
32
32
  end
33
33
  end
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "druid/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "druid-ts"
7
+ s.platform = Gem::Platform::RUBY
8
+ s.version = Druid::VERSION
9
+ s.date = '2016-06-07'
10
+ s.authors = ["Tim Sheng"]
11
+ s.email = ["278570038@qq.com"]
12
+ s.homepage = "http://github.com/timsheng/druid"
13
+ s.summary = %q{Druid DSL for browser testing}
14
+ s.description = %q{Druid DSL that works with Watir}
15
+ s.license = 'MIT'
16
+ s.rubyforge_project = "druid"
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f)}
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_dependency "watir-webdriver", "0.9", ">= 0.9.1"
23
+ s.add_development_dependency "rspec", ">= 3.4.0"
24
+ s.add_development_dependency "cucumber", ">= 1.3.20"
25
+ end
@@ -0,0 +1,18 @@
1
+ Feature: Handling Asynch calls
2
+
3
+ Scenario: Link element methods
4
+ Given I am on the static elements page
5
+ When I retrieve a link element
6
+ Then I should be able to wait until it is present
7
+ And I should be able to wait until it is visible
8
+ And I should be able to wait until it is not visible
9
+ And I should be able to wait until a block returns true
10
+
11
+ Scenario: Click a button when it is visible
12
+ Given I am on the async elements page
13
+ When I make the button invisible
14
+ Then I should be able to click it when it becomes visible
15
+
16
+ Scenario: Wait until something is not visible
17
+ Given I am on the async elements page
18
+ Then I should be able to wait until the button becomes invisible
@@ -5,10 +5,23 @@ Feature: Button
5
5
  Background:
6
6
  Given I am on the static elements page
7
7
 
8
- Scenario: Selecting a button
8
+ Scenario: Clicking a button (type=submit)
9
9
  When I click the button
10
10
  Then I should be on the success page
11
11
 
12
+ Scenario: Clicking a button (type=image)
13
+ When I click the button with type image
14
+ Then I should be on the success page
15
+
16
+ Scenario: Clicking an image button by src
17
+ When I click the image button using src
18
+ Then I should be on the success page
19
+
20
+ Scenario: Clicking an image button by alt
21
+ When I click the image button using alt
22
+ Then I should be on the success page
23
+
24
+ @name
12
25
  Scenario Outline: Locating buttons on the page
13
26
  When I locate the button by "<locate_by>"
14
27
  Then I should be able to click the button
@@ -21,6 +34,19 @@ Feature: Button
21
34
  | xpath |
22
35
  | index |
23
36
  | text |
37
+ | value |
38
+
39
+ Scenario Outline: Locating real buttons on the page
40
+ When I locate the button by "<locate_by>"
41
+ Then I should be able to click the real button
42
+
43
+ Examples:
44
+ | locate_by |
45
+ | id |
46
+ | class |
47
+ | name |
48
+ | index |
49
+ | value |
24
50
 
25
51
  Scenario: Retrieve a button element
26
52
  When I retrieve a button element
@@ -36,3 +62,18 @@ Feature: Button
36
62
  | param1 | param2 |
37
63
  | class | index |
38
64
  | name | index |
65
+
66
+ @multi
67
+ Scenario Outline: Locating real button using multiple parameters
68
+ When I search for the button by "<param1>" and "<param2>"
69
+ Then I should be able to click the real button
70
+
71
+ Examples:
72
+ | param1 | param2 |
73
+ | class | index |
74
+ | name | index |
75
+
76
+ @locator
77
+ Scenario: Finding a button dynamically
78
+ When I find a button while the script is executing
79
+ Then I should be able to click the button element