pickles 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cucumber/pickles/check_in.rb +6 -3
- data/lib/cucumber/pickles/config.rb +6 -2
- data/lib/cucumber/pickles/fill_in.rb +4 -4
- data/lib/cucumber/pickles/steps/can_see.rb +2 -12
- data/lib/cucumber/pickles/steps/check_in/factory.rb +1 -1
- data/lib/cucumber/pickles/steps/check_in/image.rb +20 -0
- data/lib/cucumber/pickles/steps/check_in/select.rb +21 -0
- data/lib/cucumber/pickles/steps/check_in/video.rb +20 -0
- data/lib/cucumber/pickles/steps/fill_in/select.rb +2 -1
- data/lib/cucumber/pickles/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b746089e7f029550a9e14d08b69364b0c50d0ac7
|
4
|
+
data.tar.gz: 825badd42378c243944baec9593407ea1ae8463b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cb28a5d19919cb9b0213bebc6a40c1e93242323e0a49795e5e0ac808a307d06ad4e6c8ba7c42281e33f4aace0c419ded5355d06369fe67bd03203dc6c1ed16c
|
7
|
+
data.tar.gz: ec85c96a5f7924d10cc5d017bab1be715c2a3035665444705437d9fc9d672e177f9d6f992acd709cb972a19868ba7ae563b8159f71e49a85189d0ce9eec5806d
|
@@ -2,9 +2,12 @@ module CheckIn
|
|
2
2
|
|
3
3
|
_dir = 'cucumber/pickles/steps/check_in/'
|
4
4
|
|
5
|
-
autoload :Factory,
|
6
|
-
autoload :Input,
|
7
|
-
autoload :Text,
|
5
|
+
autoload :Factory, _dir + 'factory'
|
6
|
+
autoload :Input, _dir + 'input'
|
7
|
+
autoload :Text, _dir + 'text'
|
8
|
+
autoload :Select, _dir + 'select'
|
9
|
+
autoload :Image, _dir + 'image'
|
10
|
+
autoload :Video, _dir + 'video'
|
8
11
|
autoload :ComplexInput, _dir + 'complex_input'
|
9
12
|
|
10
13
|
end
|
@@ -22,8 +22,12 @@ class Pickles::Config
|
|
22
22
|
@css_node_map = {}
|
23
23
|
@log_xhr_response = false
|
24
24
|
@xpath_node_map = {}
|
25
|
-
@fill_tag_steps_map = { 'select' => FillIN::Select,
|
26
|
-
|
25
|
+
@fill_tag_steps_map = { 'select' => FillIN::Select,
|
26
|
+
'jselect' => FillIN::JsSelect }
|
27
|
+
@check_tag_steps_map = { 'text' => CheckIn::Text,
|
28
|
+
'select' => CheckIn::Select,
|
29
|
+
'image' => CheckIn::Image,
|
30
|
+
'video' => CheckIn::Video }
|
27
31
|
end
|
28
32
|
|
29
33
|
def css_node_map=(map)
|
@@ -2,10 +2,10 @@ module FillIN
|
|
2
2
|
|
3
3
|
_dir = 'cucumber/pickles/steps/fill_in/'
|
4
4
|
|
5
|
-
autoload :Factory,
|
6
|
-
autoload :Input,
|
7
|
-
autoload :JsSelect,
|
8
|
-
autoload :Select,
|
5
|
+
autoload :Factory, _dir + 'factory'
|
6
|
+
autoload :Input, _dir + 'input'
|
7
|
+
autoload :JsSelect, _dir + 'js_select'
|
8
|
+
autoload :Select, _dir + 'select'
|
9
9
|
autoload :ComplexInput, _dir + 'complex_input'
|
10
10
|
|
11
11
|
end
|
@@ -38,21 +38,11 @@ Then(/^I can(not)? see:( within (?:.*))?$/) do |is_not, within_block, table|
|
|
38
38
|
end
|
39
39
|
|
40
40
|
And(/^I can(not)? see video (".*?")( within (?:.*))?$/) do |is_not, video_src, within|
|
41
|
-
within
|
42
|
-
if is_not
|
43
|
-
expect(within).not_to have_selector("iframe[src=#{video_src}]")
|
44
|
-
else
|
45
|
-
expect(within).to have_selector("iframe[src=#{video_src}]")
|
46
|
-
end
|
41
|
+
CheckIn::Video.new(video_src, within).call(is_not)
|
47
42
|
end
|
48
43
|
|
49
44
|
And(/^I can(not)? see image (".*?")( within (?:.*))?$/) do |is_not, image_src, within|
|
50
|
-
within
|
51
|
-
if is_not
|
52
|
-
expect(within).not_to have_selector("img[src=#{image_src}]")
|
53
|
-
else
|
54
|
-
expect(within).to have_selector("img[src=#{image_src}]")
|
55
|
-
end
|
45
|
+
CheckIn::Image.new(image_src, within).call(is_not)
|
56
46
|
end
|
57
47
|
|
58
48
|
Then /^focus is on (.*) ?"(.*?)"$/ do |identifier, locator|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CheckIn::Image
|
2
|
+
|
3
|
+
include RSpec::Expectations
|
4
|
+
include RSpec::Matchers
|
5
|
+
|
6
|
+
def initialize(label = nil, value, within)
|
7
|
+
@label = label
|
8
|
+
@value = value
|
9
|
+
@within = within || Capybara.current_session
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(is_not = false)
|
13
|
+
if is_not
|
14
|
+
expect(@within).not_to have_selector("img[src*='#@value']")
|
15
|
+
else
|
16
|
+
expect(@within).to have_selector("img[src*='#@value']")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CheckIn::Select
|
2
|
+
|
3
|
+
include RSpec::Expectations
|
4
|
+
include RSpec::Matchers
|
5
|
+
|
6
|
+
def initialize(label, value, within)
|
7
|
+
@label = label
|
8
|
+
@value = value
|
9
|
+
@within = within || Capybara.current_session
|
10
|
+
end
|
11
|
+
|
12
|
+
def call
|
13
|
+
locator, wait = Locator::Wait.execute(@label)
|
14
|
+
|
15
|
+
options = { selected: @value }
|
16
|
+
options[:wait] = wait if wait
|
17
|
+
|
18
|
+
expect(@within).to have_select(locator, options)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CheckIn::Video
|
2
|
+
|
3
|
+
include RSpec::Expectations
|
4
|
+
include RSpec::Matchers
|
5
|
+
|
6
|
+
def initialize(label = nil, value, within)
|
7
|
+
@label = label
|
8
|
+
@value = value
|
9
|
+
@within = within || Capybara.current_session
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(is_not)
|
13
|
+
if is_not
|
14
|
+
expect(@within).not_to have_selector("iframe[src*=#@value]")
|
15
|
+
else
|
16
|
+
expect(@within).to have_selector("iframe[src*=#@value]")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -11,7 +11,8 @@ class FillIN::Select
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def call
|
14
|
-
locator, wait
|
14
|
+
locator, wait = Locator::Wait.execute(@label)
|
15
|
+
locator, index = Locator::Index.execute(locator)
|
15
16
|
|
16
17
|
options = { from: locator }
|
17
18
|
options[:wait] = wait if wait
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pickles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vs
|
@@ -107,8 +107,11 @@ files:
|
|
107
107
|
- lib/cucumber/pickles/steps/check.rb
|
108
108
|
- lib/cucumber/pickles/steps/check_in/complex_input.rb
|
109
109
|
- lib/cucumber/pickles/steps/check_in/factory.rb
|
110
|
+
- lib/cucumber/pickles/steps/check_in/image.rb
|
110
111
|
- lib/cucumber/pickles/steps/check_in/input.rb
|
112
|
+
- lib/cucumber/pickles/steps/check_in/select.rb
|
111
113
|
- lib/cucumber/pickles/steps/check_in/text.rb
|
114
|
+
- lib/cucumber/pickles/steps/check_in/video.rb
|
112
115
|
- lib/cucumber/pickles/steps/click.rb
|
113
116
|
- lib/cucumber/pickles/steps/fill.rb
|
114
117
|
- lib/cucumber/pickles/steps/fill_in/complex_input.rb
|