druid-ts 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +18 -3
- data/ChangeLog +27 -0
- data/Gemfile +9 -7
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/druid.gemspec +6 -5
- data/features/async.feature +2 -10
- data/features/audio.feature +20 -24
- data/features/element.feature +31 -0
- data/features/html/multi_elements.html +1 -0
- data/features/html/static_elements.html +5 -11
- data/features/image.feature +4 -0
- data/features/italic.feature +21 -0
- data/features/link.feature +8 -0
- data/features/multi_elements.feature +6 -0
- data/features/{html → sample-app/public}/04-Death_Becomes_Fur.mp4 +0 -0
- data/features/{html → sample-app/public}/04-Death_Becomes_Fur.oga +0 -0
- data/features/sample-app/public/audio_video.html +19 -0
- data/features/section.feature +4 -0
- data/features/select_list.feature +1 -1
- data/features/step_definations/audio_steps.rb +26 -10
- data/features/step_definations/div_steps.rb +1 -1
- data/features/step_definations/element_steps.rb +44 -0
- data/features/step_definations/image_steps.rb +8 -0
- data/features/step_definations/italic_steps.rb +11 -0
- data/features/step_definations/multi_elements_steps.rb +17 -0
- data/features/step_definations/section_steps.rb +9 -0
- data/features/step_definations/select_list_steps.rb +1 -1
- data/features/step_definations/table_row_steps.rb +23 -0
- data/features/step_definations/video_steps.rb +11 -3
- data/features/support/audio_video_page.rb +23 -0
- data/features/support/env.rb +1 -1
- data/features/support/hooks.rb +0 -4
- data/features/support/page.rb +20 -18
- data/features/support/persistent_browser.rb +3 -3
- data/features/table_row.feature +30 -0
- data/features/text_field.feature +0 -1
- data/features/video.feature +24 -7
- data/lib/druid.rb +22 -4
- data/lib/druid/accessors.rb +81 -5
- data/lib/druid/assist.rb +47 -1
- data/lib/druid/elements.rb +1 -0
- data/lib/druid/elements/canvas.rb +0 -13
- data/lib/druid/elements/element.rb +101 -26
- data/lib/druid/elements/italic.rb +9 -0
- data/lib/druid/elements/option.rb +6 -0
- data/lib/druid/elements/ordered_list.rb +7 -5
- data/lib/druid/elements/text_area.rb +14 -0
- data/lib/druid/elements/text_field.rb +1 -1
- data/lib/druid/elements/unordered_list.rb +11 -5
- data/lib/druid/elements/video.rb +0 -9
- data/lib/druid/locator_generator.rb +47 -0
- data/lib/druid/section_collection.rb +17 -0
- data/lib/druid/version.rb +1 -1
- data/spec/druid/accessors_spec.rb +29 -1
- data/spec/druid/druid_spec.rb +36 -3
- data/spec/druid/element_locators_spec.rb +44 -0
- data/spec/druid/elements/canvas_spec.rb +2 -2
- data/spec/druid/elements/element_spec.rb +98 -13
- data/spec/druid/elements/itatic_spec.rb +20 -0
- data/spec/druid/elements/media_spec.rb +61 -0
- data/spec/druid/elements/option_spec.rb +11 -0
- data/spec/druid/elements/ordered_list_spec.rb +2 -9
- data/spec/druid/elements/text_field_spec.rb +1 -1
- data/spec/druid/elements/unordered_list_spec.rb +2 -9
- data/spec/druid/elements/video_spec.rb +25 -0
- data/spec/druid/javascript_framework_facade_spec.rb +2 -2
- data/spec/druid/page_factory_spec.rb +1 -1
- data/spec/druid/page_section_spec.rb +10 -1
- data/spec/spec_helper.rb +1 -1
- metadata +49 -16
- data/lib/druid/sections.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2dec581163c0013714c91706f42d9cb98b57528
|
4
|
+
data.tar.gz: 2021b07a2de1dd8f82f09d8917d393b84f543aa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bb08a0611d113d459b1937df83a8c817b275da04a4af823c9eedbddd9efb2ae2cbe32cfdcd5d9d53dc2f03093a629229220cc22d196091ec5ad143369b2e3bf
|
7
|
+
data.tar.gz: 4a2bf46cda253433dffbeb5b3d49047149ec106e4b0d35223db96a3e64cc68f0e0993f1bc38a3018b1aae6369171f9b0216878bd823d327e37a95a63ba017d5d
|
data/.travis.yml
CHANGED
@@ -1,7 +1,22 @@
|
|
1
|
-
|
1
|
+
sudo: required
|
2
|
+
dist: trusty
|
2
3
|
rvm:
|
3
|
-
- 2.
|
4
|
+
- 2.2.5
|
5
|
+
- 2.3.1
|
6
|
+
cache: bundler
|
4
7
|
before_script:
|
8
|
+
- export CHROME_BIN=/usr/bin/google-chrome
|
5
9
|
- "export DISPLAY=:99.0"
|
6
10
|
- "sh -e /etc/init.d/xvfb start"
|
7
|
-
|
11
|
+
- sudo apt-get update
|
12
|
+
- sudo apt-get install -y libappindicator1 fonts-liberation
|
13
|
+
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
14
|
+
- sudo dpkg -i google-chrome*.deb
|
15
|
+
- CHROMEDRIVER_VERSION=$(curl -s http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
|
16
|
+
- curl -L -O "http://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
|
17
|
+
- unzip chromedriver_linux64.zip
|
18
|
+
- chmod +x chromedriver
|
19
|
+
- sudo mv chromedriver /usr/local/bin
|
20
|
+
script: bundle exec rake $RAKE_TASK
|
21
|
+
env:
|
22
|
+
- RAKE_TASK=features:watir
|
data/ChangeLog
CHANGED
@@ -1,6 +1,33 @@
|
|
1
|
+
===Version 1.2.1/ 2017-01-26
|
2
|
+
* Enhancements
|
3
|
+
* Added array methods to section collections
|
4
|
+
* Added ability to call style method with no parameters
|
5
|
+
* clean up frame and iframe nesting
|
6
|
+
* Update travis.yml
|
7
|
+
* Added numerous missing element types
|
8
|
+
* Added two new methods that check without throwing exception
|
9
|
+
* Update to use watir 6 instead of watir-webdriver
|
10
|
+
* Added focused? method on element
|
11
|
+
* Added the following methods to Element
|
12
|
+
- outer_html
|
13
|
+
- inner_html
|
14
|
+
- stale?
|
15
|
+
* Added the selected? method to Option
|
16
|
+
* Added the append method to TextArea
|
17
|
+
=== 2017-01-25
|
18
|
+
* Enhancements
|
19
|
+
* Added list_items method to UnorderedList to get an array of children.
|
20
|
+
* Speed optimizations for UnorderedList
|
21
|
+
* Added list_items method to OrderedList to get an array of children
|
22
|
+
* Speed optimization for OrderedList
|
23
|
+
* Added support for the Italic(i) element
|
24
|
+
* Added size and location methods to all elements
|
25
|
+
* Added width, height, and centre methods for elements
|
1
26
|
===Version 1.2.0/ 2017-01-24
|
2
27
|
* Enhancements
|
3
28
|
* Added new page_section/ page_sections method to accessor
|
29
|
+
* Added row accessors method and support for finding row elements directly
|
30
|
+
* Default element tag to element
|
4
31
|
=== Version 1.1.9/2017-01-22
|
5
32
|
* Enhancements
|
6
33
|
* Populate_page_with now supports radio groups
|
data/Gemfile
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
|
3
|
+
# adding rake so travis-ci will build properly
|
4
4
|
gem 'rake'
|
5
|
-
gem '
|
6
|
-
gem '
|
7
|
-
gem 'rspec'
|
8
|
-
gem 'cucumber'
|
9
|
-
gem 'rack'
|
5
|
+
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
|
6
|
+
gem 'listen', '3.0.8'
|
10
7
|
gem 'net-http-persistent'
|
11
|
-
|
8
|
+
|
9
|
+
if ENV['WATIR_BRANCH']
|
10
|
+
gem 'watir', :git => 'https://github.com/watir/watir.git', :branch => ENV['WATIR_BRANCH']
|
11
|
+
end
|
12
|
+
|
13
|
+
gemspec
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
[![Build Status](https://travis-ci.org/timsheng/druid.png)](https://travis-ci.org/timsheng)
|
3
3
|
|
4
4
|
|
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
|
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
|
6
6
|
|
7
7
|
### Defining your page object
|
8
8
|
|
@@ -58,7 +58,7 @@ login_page.login_with 'cheezy', 'secret'
|
|
58
58
|
````
|
59
59
|
|
60
60
|
### Creating your druid
|
61
|
-
druid supports [watir
|
61
|
+
druid supports [watir](https://github.com/watir/watir)
|
62
62
|
The page object can be create like this:
|
63
63
|
|
64
64
|
````ruby
|
data/Rakefile
CHANGED
@@ -27,7 +27,7 @@ task :default => :spec
|
|
27
27
|
|
28
28
|
|
29
29
|
namespace :features do
|
30
|
-
Cucumber::Rake::Task.new(:
|
30
|
+
Cucumber::Rake::Task.new(:watir, "Run features with Watir webdriver") do |t|
|
31
31
|
t.profile = "watir"
|
32
32
|
end
|
33
33
|
end
|
data/druid.gemspec
CHANGED
@@ -13,15 +13,16 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.summary = %q{Druid DSL for browser testing}
|
14
14
|
s.description = %q{Druid DSL that works with Watir}
|
15
15
|
s.license = 'MIT'
|
16
|
-
s.
|
16
|
+
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(pkg|spec|features|coverage)/})}
|
17
17
|
s.files = `git ls-files`.split("\n")
|
18
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f)}
|
20
20
|
s.require_paths = ["lib"]
|
21
|
-
|
22
|
-
s.add_dependency "watir-webdriver", ">= 0.9.1"
|
21
|
+
s.add_dependency "watir", "~> 6.0"
|
23
22
|
s.add_dependency "page_navigation", ">= 0.10"
|
24
|
-
s.
|
25
|
-
|
23
|
+
s.add_dependency "net-http-persistent", "~> 2.9.4"
|
24
|
+
|
25
|
+
s.add_development_dependency "rspec", ">= 3.0.0"
|
26
|
+
s.add_development_dependency "cucumber", ">= 2.0.0"
|
26
27
|
s.add_development_dependency "rack", ">= 1.0"
|
27
28
|
end
|
data/features/async.feature
CHANGED
@@ -1,24 +1,16 @@
|
|
1
1
|
Feature: Handling Asynch calls
|
2
2
|
|
3
|
-
|
4
|
-
Given I am on the
|
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
|
3
|
+
Background:
|
4
|
+
Given I am on the async elements page
|
10
5
|
|
11
6
|
Scenario: Click a button when it is visible
|
12
|
-
Given I am on the async elements page
|
13
7
|
When I make the button invisible
|
14
8
|
Then I should be able to click it when it becomes visible
|
15
9
|
|
16
10
|
Scenario: Wait until something is not visible
|
17
|
-
Given I am on the async elements page
|
18
11
|
Then I should be able to wait until the button becomes invisible
|
19
12
|
|
20
13
|
Scenario: Wait for an element to disappear from the page
|
21
|
-
Given I am on the async elements page
|
22
14
|
When I add a button a few seconds from now
|
23
15
|
And I remove a button a few seconds from now
|
24
16
|
Then I should not be able to find the button
|
data/features/audio.feature
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Feature: Support for the audio element
|
2
2
|
|
3
3
|
Background:
|
4
|
-
Given I am on the
|
4
|
+
Given I am on the audio video page
|
5
5
|
|
6
6
|
Scenario: Finding an audio element
|
7
|
-
When I retrieve the audio element
|
7
|
+
When I retrieve the audio element from the page
|
8
8
|
Then I should know it exists
|
9
9
|
And I should know it is visible
|
10
10
|
|
@@ -31,37 +31,33 @@ Feature: Support for the audio element
|
|
31
31
|
| name | index |
|
32
32
|
|
33
33
|
Scenario: Should know if it is autoplay
|
34
|
-
When I retrieve the audio element
|
34
|
+
When I retrieve the audio element from the page
|
35
35
|
Then I should know the audio is not autoplay
|
36
36
|
|
37
37
|
Scenario: Should know if the controls are displayed
|
38
|
-
When I retrieve the audio element
|
38
|
+
When I retrieve the audio element from the page
|
39
39
|
Then I should know that the controls are displayed
|
40
40
|
|
41
41
|
Scenario: Should know if it is paused
|
42
|
-
When I retrieve the audio element
|
42
|
+
When I retrieve the audio element from the page
|
43
43
|
Then I should know that the audio is paused
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
Scenario: Should know its volume
|
46
|
+
When I retrieve the audio element from the page
|
47
|
+
Then I should know that its volume is 1
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
Scenario: Should know if it has ended
|
50
|
+
When I retrieve the audio element from the page
|
51
|
+
Then I should know that it has not ended
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
Scenario: Should know if it is seeking
|
54
|
+
When I retrieve the audio element from the page
|
55
|
+
Then I should know that it is not seeking
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
Scenario: Should know if it is in a loop
|
58
|
+
When I retrieve the audio element from the page
|
59
|
+
Then I should know that it is not in a loop
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
#Scenario: Should know if it is muted
|
66
|
-
#When I retrieve the audio element
|
67
|
-
#Then I should know that it is muted
|
61
|
+
Scenario: Should know if it is muted
|
62
|
+
When I retrieve the audio element from the page
|
63
|
+
Then I should know that it is muted
|
data/features/element.feature
CHANGED
@@ -15,6 +15,16 @@ Feature: Elements
|
|
15
15
|
When I set the focus to the test text_field
|
16
16
|
Then I should know that the text_field has the focus
|
17
17
|
|
18
|
+
Scenario: Checking focus of the element with focus
|
19
|
+
And I set the focus to the test text_field
|
20
|
+
When I retrieve the focus state of the text_field
|
21
|
+
Then I should know that the text_field is focused
|
22
|
+
|
23
|
+
Scenario: Checking focus of the element without focus
|
24
|
+
And I set the focus off the test text_field
|
25
|
+
When I retrieve the focus state of the text_field
|
26
|
+
Then I should know that the text_field is not focused
|
27
|
+
|
18
28
|
Scenario: Link element methods
|
19
29
|
When I retrieve a link element
|
20
30
|
Then I should know it exists
|
@@ -259,3 +269,24 @@ Feature: Elements
|
|
259
269
|
|
260
270
|
Scenario: Selecting the text for an element
|
261
271
|
Then I should be able to select "Elements" from the paragraph
|
272
|
+
|
273
|
+
Scenario: Element location
|
274
|
+
When I retrieve a link element
|
275
|
+
Then I should be able to know its location
|
276
|
+
|
277
|
+
Scenario: Element size
|
278
|
+
When I retrieve a link element
|
279
|
+
Then I should be able to know its size
|
280
|
+
|
281
|
+
Scenario: Getting the height of an element
|
282
|
+
When I retrieve a link element
|
283
|
+
Then the element height is not 0
|
284
|
+
|
285
|
+
Scenario: Getting the width of an element
|
286
|
+
When I retrieve a link element
|
287
|
+
Then the element width is not 0
|
288
|
+
|
289
|
+
Scenario: Getting the centre of an element
|
290
|
+
When I retrieve a button element
|
291
|
+
Then the element centre should be greater than element y position
|
292
|
+
And the element centre should be greater than element x position
|
@@ -42,16 +42,6 @@
|
|
42
42
|
ctx.fillRect=(0,0,150,75);
|
43
43
|
</script>
|
44
44
|
|
45
|
-
<audio controls id="audio" name="audio" class="audio">
|
46
|
-
<!-- <source src="04-Death_Becomes_Fur.mp4" type='audio/mp4'/> -->
|
47
|
-
<!-- <source src="04-Death_Becomes_Fur.oga" type='audio/ogg; codecs=vorbis'/> -->
|
48
|
-
<p>Your user agent does not support the HTML5 Audio element.</p>
|
49
|
-
</audio>
|
50
|
-
|
51
|
-
<video width="320" height="240" controls="controls" id="video" name="video" class="video">
|
52
|
-
Your Browser does not support the video tag.
|
53
|
-
</video>
|
54
|
-
|
55
45
|
<svg width="100" height="100" id="the_svg">
|
56
46
|
<circle cx="50" cy="50" r="40" fill="red" stroke="blue" stroke-width="5" />
|
57
47
|
</svg>
|
@@ -96,7 +86,7 @@
|
|
96
86
|
</tr>
|
97
87
|
</thead>
|
98
88
|
<tbody>
|
99
|
-
<tr>
|
89
|
+
<tr id="tr_id" class='tr_class'>
|
100
90
|
<td>Data1</td>
|
101
91
|
<td>Data2</td>
|
102
92
|
</tr>
|
@@ -175,6 +165,7 @@
|
|
175
165
|
|
176
166
|
<a href="success.html" target="_blank">New Window</a>
|
177
167
|
<input type="text" id="onfocus_text_field" onfocus="document.getElementById('onfocus_test').innerHTML = 'changed by onfocus event'" />
|
168
|
+
<input type="text" id="unfocus_text_field" />
|
178
169
|
<div id="onfocus_test"></div>
|
179
170
|
|
180
171
|
<div id="parent_div">
|
@@ -194,5 +185,8 @@
|
|
194
185
|
<img src="images/img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228">
|
195
186
|
</figure>
|
196
187
|
This text have <b id="b_id" class="b_class" name="b_name">some text in bold</b>
|
188
|
+
This text have <i id="i_id" class="i_class" name="i_name">some text in italic</i>
|
189
|
+
<input id="input_button" type="button" value="This button is a input" />
|
190
|
+
<img src="images/non_existent.jpg" id="non_existent" >
|
197
191
|
</body>
|
198
192
|
</html>
|
data/features/image.feature
CHANGED
@@ -41,3 +41,7 @@ Feature: Image
|
|
41
41
|
Then I should see that the image exists
|
42
42
|
And the image should be "106" pixels wide
|
43
43
|
And the image should be "106" pixels tall
|
44
|
+
|
45
|
+
Scenario: Check an image loaded
|
46
|
+
When I get the image element load status
|
47
|
+
Then I should see that the image loaded
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Feature: Italic
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given I am on the static elements page
|
5
|
+
|
6
|
+
Scenario: Getting the text of headings
|
7
|
+
When I get the italic text for the "i" element
|
8
|
+
Then I should see "some text in italic" in italic
|
9
|
+
|
10
|
+
Scenario Outline: Locating i on the page
|
11
|
+
When I search italic text for the i by "<search_by>"
|
12
|
+
Then I should see "some text in italic" in italic
|
13
|
+
|
14
|
+
Examples:
|
15
|
+
| search_by |
|
16
|
+
| id |
|
17
|
+
| class |
|
18
|
+
| name |
|
19
|
+
| xpath |
|
20
|
+
| index |
|
21
|
+
| css |
|
data/features/link.feature
CHANGED
@@ -48,3 +48,11 @@ Feature: Links
|
|
48
48
|
Scenario: Getting the href for a link
|
49
49
|
When I get the href for the link
|
50
50
|
Then I should know it was "success.html"
|
51
|
+
|
52
|
+
Scenario: Link element methods
|
53
|
+
Given I am on the static elements page
|
54
|
+
When I retrieve a link element
|
55
|
+
Then I should be able to wait until it is present
|
56
|
+
And I should be able to wait until it is visible
|
57
|
+
And I should be able to wait until it is not visible
|
58
|
+
And I should be able to wait until a block returns true
|
@@ -490,3 +490,9 @@ Feature: Multi Elements
|
|
490
490
|
Then I should have 2 bs
|
491
491
|
And the text for b 1 should be "One B"
|
492
492
|
And the text for b 2 should be "Two B"
|
493
|
+
|
494
|
+
Scenario: Selecting is using an identifier
|
495
|
+
When I select the is
|
496
|
+
Then I should have 2 is
|
497
|
+
And the text for i 1 should be "One I"
|
498
|
+
And the text for i 2 should be "Two I"
|
File without changes
|
File without changes
|
@@ -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>
|
data/features/section.feature
CHANGED
@@ -126,3 +126,7 @@ Feature: Sections
|
|
126
126
|
Given I select multiple sections
|
127
127
|
When I filter by a specific value of the sections
|
128
128
|
Then I will find all sections with that value
|
129
|
+
|
130
|
+
Scenario: Sections roots can be accessed
|
131
|
+
When I have a page section
|
132
|
+
Then methods called on the section are passed to the root if missing
|
@@ -76,7 +76,7 @@ Feature: Select List
|
|
76
76
|
|
77
77
|
Scenario: Selecting an option by its value
|
78
78
|
When I select an option using the value "option2"
|
79
|
-
Then the selected option should be "Test 2
|
79
|
+
Then the selected option should be "Test 2"
|
80
80
|
|
81
81
|
Scenario: Getting the value from a selected option
|
82
82
|
When I select an option using the value "option2"
|
@@ -1,13 +1,9 @@
|
|
1
|
-
When(/^I retrieve the audio element$/) do
|
2
|
-
@element = @page.audio_id_element
|
3
|
-
end
|
4
|
-
|
5
1
|
When(/^I search for the audio element by "([^"]*)"$/) do |how|
|
6
|
-
@element = @
|
2
|
+
@element = @avpage.send "audio_#{how}_element"
|
7
3
|
end
|
8
4
|
|
9
5
|
When(/^I search for the audio element by "([^"]*)" and "([^"]*)"$/) do |param1, param2|
|
10
|
-
@element = @
|
6
|
+
@element = @avpage.send "audio_#{param1}_#{param2}_element"
|
11
7
|
end
|
12
8
|
|
13
9
|
Then(/^I should know the audio is not autoplay$/) do
|
@@ -22,10 +18,30 @@ Then(/^I should know that the audio is paused$/) do
|
|
22
18
|
expect(@element).to be_paused
|
23
19
|
end
|
24
20
|
|
25
|
-
Then(/^I should know that the duration is greater than (\d+) seconds$/) do |duration|
|
26
|
-
expect(@element.duration).to be > duration.to_f
|
27
|
-
end
|
28
|
-
|
29
21
|
Then(/^I should know that its volume is (\d+)$/) do |volume|
|
30
22
|
expect(@element.volume).to eql volume.to_i
|
31
23
|
end
|
24
|
+
|
25
|
+
Given(/^I am on the audio video page$/) do
|
26
|
+
@avpage = visit AudioVideoPage
|
27
|
+
end
|
28
|
+
|
29
|
+
When(/^I retrieve the audio element from the page$/) do
|
30
|
+
@element = @avpage.audio_id_element
|
31
|
+
end
|
32
|
+
|
33
|
+
Then(/^I should know that it has not ended$/) do
|
34
|
+
expect(@element).not_to be_ended
|
35
|
+
end
|
36
|
+
|
37
|
+
Then(/^I should know that it is not seeking$/) do
|
38
|
+
expect(@element).not_to be_seeking
|
39
|
+
end
|
40
|
+
|
41
|
+
Then(/^I should know that it is not in a loop$/) do
|
42
|
+
expect(@element).not_to be_loop
|
43
|
+
end
|
44
|
+
|
45
|
+
Then(/^I should know that it is muted$/) do
|
46
|
+
expect(@element).not_to be_muted
|
47
|
+
end
|