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.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/.rspec +1 -0
- data/.rvmrc +1 -0
- data/.travis.yml +1 -2
- data/ChangeLog +218 -0
- data/Gemfile +2 -1
- data/README.md +64 -7
- data/Rakefile +1 -1
- data/druid.gemspec +25 -0
- data/features/async.feature +18 -0
- data/features/button.feature +42 -1
- data/features/checkbox.feature +7 -1
- data/features/div.feature +6 -0
- data/features/element.feature +100 -0
- data/features/file_field.feature +35 -0
- data/features/form.feature +12 -6
- data/features/frames.feature +57 -0
- data/features/heading.feature +164 -0
- data/features/hidden_field.feature +6 -0
- data/features/html/async.html +18 -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/iframes.html +12 -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/nested_elements.html +52 -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/static_elements.html +29 -23
- data/features/image.feature +8 -0
- data/features/link.feature +5 -0
- data/features/list_item.feature +5 -0
- data/features/modal_dialog.feature +9 -0
- data/features/nested_elements.feature +105 -0
- data/features/ordered_list.feature +6 -0
- data/features/page_level_actions.feature +48 -0
- data/features/paragraph.feature +33 -0
- data/features/radio_button.feature +6 -0
- data/features/select_list.feature +6 -1
- data/features/span.feature +6 -1
- data/features/step_definations/async_steps.rb +63 -0
- data/features/step_definations/button_steps.rb +25 -1
- data/features/step_definations/checkbox_steps.rb +5 -1
- data/features/step_definations/div_steps.rb +6 -1
- data/features/step_definations/element_steps.rb +55 -1
- data/features/step_definations/file_field_steps.rb +27 -0
- data/features/step_definations/form_steps.rb +8 -0
- data/features/step_definations/frame_steps.rb +112 -0
- data/features/step_definations/heading_steps.rb +39 -0
- data/features/step_definations/hidden_field_steps.rb +7 -3
- data/features/step_definations/image_steps.rb +7 -3
- data/features/step_definations/link_steps.rb +8 -3
- data/features/step_definations/list_item_steps.rb +9 -1
- data/features/step_definations/modal_dialog_steps.rb +38 -0
- data/features/step_definations/nested_elements_steps.rb +196 -0
- data/features/step_definations/ordered_list_steps.rb +11 -3
- data/features/step_definations/page_level_actions_steps.rb +72 -0
- data/features/step_definations/paragraph_steps.rb +15 -0
- data/features/step_definations/radio_button_steps.rb +5 -1
- data/features/step_definations/select_list_steps.rb +10 -2
- data/features/step_definations/span_steps.rb +5 -1
- data/features/step_definations/table_cell_steps.rb +5 -1
- data/features/step_definations/table_steps.rb +17 -3
- data/features/step_definations/text_area_steps.rb +18 -2
- data/features/step_definations/text_field_steps.rb +9 -1
- data/features/step_definations/unordered_list_steps.rb +11 -3
- data/features/support/env.rb +0 -15
- data/features/support/hooks.rb +7 -0
- data/features/support/page.rb +98 -1
- data/features/support/persistent_browser.rb +15 -0
- data/features/support/url_helper.rb +24 -1
- data/features/table.feature +7 -0
- data/features/table_cell.feature +6 -0
- data/features/text_area.feature +11 -0
- data/features/text_field.feature +6 -1
- data/features/unordered_list.feature +6 -0
- data/lib/druid.rb +251 -3
- data/lib/druid/accessors.rb +446 -158
- data/lib/druid/assist.rb +394 -0
- data/lib/druid/core_ext/string.rb +5 -0
- data/lib/druid/element_locators.rb +405 -0
- data/lib/druid/elements.rb +28 -0
- data/lib/druid/elements/button.rb +6 -1
- data/lib/druid/elements/check_box.rb +26 -0
- data/lib/druid/elements/div.rb +3 -1
- data/lib/druid/elements/element.rb +170 -5
- data/lib/druid/elements/file_field.rb +18 -0
- data/lib/druid/elements/form.rb +11 -0
- data/lib/druid/elements/heading.rb +14 -0
- data/lib/druid/elements/hidden_field.rb +12 -2
- data/lib/druid/elements/image.rb +13 -0
- data/lib/druid/elements/link.rb +2 -0
- data/lib/druid/elements/list_item.rb +3 -1
- data/lib/druid/elements/option.rb +9 -0
- data/lib/druid/elements/ordered_list.rb +4 -5
- data/lib/druid/elements/paragraph.rb +9 -0
- data/lib/druid/elements/radio_button.rb +25 -0
- data/lib/druid/elements/select_list.rb +10 -1
- data/lib/druid/elements/span.rb +3 -1
- data/lib/druid/elements/table.rb +20 -1
- data/lib/druid/elements/table_cell.rb +7 -0
- data/lib/druid/elements/table_row.rb +5 -1
- data/lib/druid/elements/text_area.rb +15 -1
- data/lib/druid/elements/text_field.rb +11 -1
- data/lib/druid/elements/unordered_list.rb +5 -5
- data/lib/druid/nested_elements.rb +103 -0
- data/lib/druid/page_factory.rb +4 -4
- data/lib/druid/page_populator.rb +71 -0
- data/spec/druid/accessors_spec.rb +789 -0
- data/spec/druid/druid_spec.rb +130 -7
- data/spec/druid/element_locators_spec.rb +160 -0
- data/spec/druid/elements/button_spec.rb +31 -0
- data/spec/druid/elements/check_box_spec.rb +38 -0
- data/spec/druid/elements/div_spec.rb +19 -0
- data/spec/druid/elements/element_spec.rb +150 -0
- data/spec/druid/elements/file_field_spec.rb +27 -0
- data/spec/druid/elements/form_spec.rb +27 -0
- data/spec/druid/elements/heading_spec.rb +39 -0
- data/spec/druid/elements/hidden_field_spec.rb +24 -0
- data/spec/druid/elements/image_spec.rb +32 -0
- data/spec/druid/elements/link_spec.rb +26 -0
- data/spec/druid/elements/list_item_spec.rb +19 -0
- data/spec/druid/elements/option_spec.rb +10 -0
- data/spec/druid/elements/ordered_list_spec.rb +42 -0
- data/spec/druid/elements/page_factory_spec.rb +40 -0
- data/spec/druid/elements/paragraph_spec.rb +21 -0
- data/spec/druid/elements/radio_button_spec.rb +38 -0
- data/spec/druid/elements/select_list_spec.rb +37 -0
- data/spec/druid/elements/span_spec.rb +19 -0
- data/spec/druid/elements/table_cell_spec.rb +23 -0
- data/spec/druid/elements/table_row_spec.rb +41 -0
- data/spec/druid/elements/table_spec.rb +52 -0
- data/spec/druid/elements/text_area_spec.rb +31 -0
- data/spec/druid/elements/text_field_spec.rb +31 -0
- data/spec/druid/elements/unordered_list_spec.rb +42 -0
- data/spec/druid/nested_element_spec.rb +128 -0
- data/spec/druid/page_populator_spec.rb +92 -0
- data/spec/spec_helper.rb +2 -1
- metadata +147 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1081889b9173a02ac8c5786c09771d230af18226
|
4
|
+
data.tar.gz: da6be1406dcb433fde5f47d4a699abb5c80bf9d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebb267bdf529e1b094d287883bb3422ff5d41ab0377a6b3e4f6421a0205a0a7dadf74f7a7ee6bdff335ccdccdd21e85cd31da43b3e481e9684c1225c0ac794fd
|
7
|
+
data.tar.gz: 79e0be33f4dfe5f136731d6b7c388e1dc3f69aa9c2680b8bbc3766518506e2d88b8b25167d703ae71e950817ba5181fd6d652d42e32358f3e8c295f0a4201487
|
data/.gitignore
CHANGED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color --format doc
|
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 2.3.0
|
data/.travis.yml
CHANGED
data/ChangeLog
ADDED
@@ -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
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
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
data/druid.gemspec
ADDED
@@ -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
|
data/features/button.feature
CHANGED
@@ -5,10 +5,23 @@ Feature: Button
|
|
5
5
|
Background:
|
6
6
|
Given I am on the static elements page
|
7
7
|
|
8
|
-
Scenario:
|
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
|