magic_steps 0.0.1 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7078a6cf421234993970312d443729f05e4f7fd2
4
- data.tar.gz: ee16fbf71f1b220507bc98f17a1213dbf03eba6e
3
+ metadata.gz: 5392ba844319f8ebe596737f14671566f19a5778
4
+ data.tar.gz: 37a05faa102a645fb47f531cdb58563c0d50b5be
5
5
  SHA512:
6
- metadata.gz: a19245e355dfb79bf08798cbab6137aa0f447218d994e90228496949ba2bdbfa61e3fd75b48896a12fdaaed05ddb920a99f37c9e1a5a6e9e583883bf4f53cb37
7
- data.tar.gz: 41e0241cc8b0568a926bbc0610eb1645cc99126ad5a8634bf8fa5c450798c70d8b83ee79f41e8c8637592dbc6e497c0fd5df5361e6d22cacb0f63906a02f4c31
6
+ metadata.gz: 062822268103039cc6eb50f48a7492bded9ad8c567fe34b6cfccf06dd106abe9939218ee22fd22ae2ac68afd3ff44f532537a7baafa21d528c56646db4cead27
7
+ data.tar.gz: f045b7c362bcedcab6bd86c8de226bfe32020f954bc8012ce5ebed3dfa384f238177bf6db3263711dcb70fc2a2e7691dc4e933992909c30bdf20e7effd60d11a
@@ -1,90 +1,93 @@
1
1
  # encoding: utf-8
2
2
  # Count References
3
- Then(/^all \[(\w+)\] should be visible$/) do |ref|
4
- expect { @current_page.ref_to_arr(ref).select(&:visible?).size }.to eventually eql(@current_page.ref_to_arr(ref).size), "#{ref} visibility"
5
- end
3
+ Then(/^all \[(\w+)\] should be visible$/) do |ref|
4
+ expect { @current_page.ref_to_arr(ref).select(&:visible?).size }.to eventually eql(@current_page.ref_to_arr(ref).size), "#{ref} visibility"
5
+ end
6
6
 
7
- Then(/^\((\d+)\) \[(\w+)\] should be visible$/) do |expected, ref|
8
- expect { @current_page.ref_to_arr(ref).select(&:visible?).size }.to eventually eql(expected.to_i), "#{ref} visibility"
9
- end
7
+ Then(/^\((\d+)\) \[(\w+)\] should be visible$/) do |expected, ref|
8
+ expect { @current_page.ref_to_arr(ref).select(&:visible?).size }.to eventually eql(expected.to_i), "#{ref} visibility"
9
+ end
10
10
 
11
- Then(/^\((\d+)\) or more \[(\w+)\] should be visible$/) do |expected, ref|
12
- expect { @current_page.ref_to_arr(ref).select(&:visible?).size }.to eventually be >= (expected.to_i), "#{ref} visibility"
13
- end
11
+ Then(/^\((\d+)\) or more \[(\w+)\] should be visible$/) do |expected, ref|
12
+ expect { @current_page.ref_to_arr(ref).select(&:visible?).size }.to eventually be >= (expected.to_i), "#{ref} visibility"
13
+ end
14
14
 
15
15
 
16
16
  # Count Criteria of References
17
- Then(/^\((\d+)\) \[(\w+)\] should have \((\d+)\) \[(\w+)\] visible$/) do |exp_ref, ref, exp_sub_ref, sub_ref|
18
- expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size == exp_sub_ref.to_i }.size }.to eventually eql(exp_ref.to_i), "#{ref} #{sub_ref} visibility"
19
- end
17
+ Then(/^\((\d+)\) \[(\w+)\] should have \((\d+)\) \[(\w+)\] visible$/) do |exp_ref, ref, exp_sub_ref, sub_ref|
18
+ expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size == exp_sub_ref.to_i }.size }.to eventually eql(exp_ref.to_i), "#{ref} #{sub_ref} visibility"
19
+ end
20
20
 
21
- Then(/^\((\d+)\) or more \[(\w+)\] should have \((\d+)\) \[(\w+)\] visible$/) do |exp_ref, ref, exp_sub_ref, sub_ref|
22
- expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size == exp_sub_ref.to_i }.size }.to eventually be >=(exp_ref.to_i), "#{ref} #{sub_ref} visibility"
23
- end
21
+ Then(/^\((\d+)\) or more \[(\w+)\] should have \((\d+)\) \[(\w+)\] visible$/) do |exp_ref, ref, exp_sub_ref, sub_ref|
22
+ expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size == exp_sub_ref.to_i }.size }.to eventually be >=(exp_ref.to_i), "#{ref} #{sub_ref} visibility"
23
+ end
24
24
 
25
- Then(/^\((\d+)\) \[(\w+)\] should have \((\d+)\) or more \[(\w+)\] visible$/) do |exp_ref, ref, exp_sub_ref, sub_ref|
26
- expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size >= exp_sub_ref.to_i }.size }.to eventually eql(exp_ref.to_i), "#{ref} #{sub_ref} visibility"
27
- end
25
+ Then(/^\((\d+)\) \[(\w+)\] should have \((\d+)\) or more \[(\w+)\] visible$/) do |exp_ref, ref, exp_sub_ref, sub_ref|
26
+ expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size >= exp_sub_ref.to_i }.size }.to eventually eql(exp_ref.to_i), "#{ref} #{sub_ref} visibility"
27
+ end
28
28
 
29
- Then(/^\((\d+)\) or more \[(\w+)\] should have \((\d+)\) or more \[(\w+)\] visible$/) do |exp_ref, ref, exp_sub_ref, sub_ref|
30
- expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size >= exp_sub_ref.to_i }.size }.to eventually be >=(exp_ref.to_i), "#{ref} #{sub_ref} visibility"
31
- end
29
+ Then(/^\((\d+)\) or more \[(\w+)\] should have \((\d+)\) or more \[(\w+)\] visible$/) do |exp_ref, ref, exp_sub_ref, sub_ref|
30
+ expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size >= exp_sub_ref.to_i }.size }.to eventually be >=(exp_ref.to_i), "#{ref} #{sub_ref} visibility"
31
+ end
32
32
 
33
- Then(/^all \[(\w+)\] should have \((\d+)\) or more \[(\w+)\] visible$/) do |ref, exp_sub_ref, sub_ref|
34
- expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size >= exp_sub_ref.to_i }.size }.to eventually eql(@current_page.ref_to_arr(ref).size), "#{ref} #{sub_ref} visibility"
35
- end
33
+ Then(/^all \[(\w+)\] should have \((\d+)\) or more \[(\w+)\] visible$/) do |ref, exp_sub_ref, sub_ref|
34
+ expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size >= exp_sub_ref.to_i }.size }.to eventually eql(@current_page.ref_to_arr(ref).size), "#{ref} #{sub_ref} visibility"
35
+ end
36
36
 
37
- Then(/^all \[(\w+)\] should have \((\d+)\) \[(\w+)\] visible$/) do |ref, exp_sub_ref, sub_ref|
38
- expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size == exp_sub_ref.to_i }.size }.to eventually eql(@current_page.ref_to_arr(ref).size), "#{ref} #{sub_ref} visibility"
39
- end
37
+ Then(/^all \[(\w+)\] should have \((\d+)\) \[(\w+)\] visible$/) do |ref, exp_sub_ref, sub_ref|
38
+ expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size == exp_sub_ref.to_i }.size }.to eventually eql(@current_page.ref_to_arr(ref).size), "#{ref} #{sub_ref} visibility"
39
+ end
40
40
 
41
- Then(/^all \[(\w+)\] should have all \[(\w+)\] visible$/) do |ref, sub_ref|
42
- expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size == sub_ref.to_i }.size }.to eventually eql(@current_page.ref_to_arr(ref).size), "#{ref} #{sub_ref} visibility"
43
- end
41
+ Then(/^all \[(\w+)\] should have all \[(\w+)\] visible$/) do |ref, sub_ref|
42
+ expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |element| element.visible? }.size == sub_ref.to_i }.size }.to eventually eql(@current_page.ref_to_arr(ref).size), "#{ref} #{sub_ref} visibility"
43
+ end
44
44
 
45
45
  # Count Criteria of of Sub-References
46
- Then(/^\((\d+)\) \[(\w+)\] should have \((\d+)\) \[(\w+)\] where \((\d+)\) \[(\w+)\] is visible$/) do |exp_ref, ref, exp_sub_ref, sub_ref, exp_sub_criteria, sub_criteria|
47
- expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |section| section.ref_to_arr(sub_criteria).select { |element| element.visible? }.size == exp_sub_criteria.to_i }.size == exp_sub_ref.to_i }.size }.to eventually eq(exp_ref.to_i), "#{ref} #{sub_ref} #{sub_criteria} visibility"
48
- end
49
-
50
- Then(/^all \[(\w+)\] should have \((\d+)\) \[(\w+)\] where \((\d+)\) \[(\w+)\] is visible$/) do |ref, exp_sub_ref, sub_ref, exp_sub_criteria, sub_criteria|
51
- expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |section| section.ref_to_arr(sub_criteria).select { |element| element.visible? }.size == exp_sub_criteria.to_i }.size == exp_sub_ref.to_i }.size }.to eventually eql(@current_page.ref_to_arr(ref).size), "#{ref} #{sub_ref} #{sub_criteria} visibility"
52
- end
53
-
54
- Then(/^\((\d+)\) \[(\w+)\] should have all \[(\w+)\] where \((\d+)\) \[(\w+)\] is visible$/) do |exp_ref, ref, sub_ref, exp_sub_criteria, sub_criteria|
55
- expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |section| section.ref_to_arr(sub_criteria).select { |element| element.visible? }.size == exp_sub_criteria.to_i }.size == section.ref_to_arr(sub_ref).size }.size }.to eventually eql(exp_ref.to_i), "#{ref} #{sub_ref} #{sub_criteria} visibility"
56
- end
57
-
58
-
59
- # Page Sections Child should equal int / text
60
- Then(/^\[(\w+)\] \((\d+)\)s \[(\w+)\] should be \((\d+)\)$/) do |ref, lookup, criteria, expected|
61
- expect { @current_page.get_int(@current_page.ref_to_arr(ref)[lookup.to_i-1].send("#{criteria}_element")) }.to eventually eql(expected.to_i), "#{ref} #{lookup}'s #{criteria} visibility"
62
- end
63
-
64
- Then(/^\[(\w+)\] \((\d+)\)s \[(\w+)\] should be {(.*)}$/) do |ref, lookup, criteria, expected|
65
- expect { @current_page.ref_to_arr(ref)[lookup.to_i-1].send("#{criteria}_element").attribute('textContent').downcase.include?(expected.downcase) }.to eventually be_truthy(), "#{ref} #{lookup}'s #{criteria} visibility"
66
- end
67
-
68
- # Page Section Criteria should equal int / text
69
- Then(/^the \[(\w+)\] \[(\w+)\] should be \((\d+)\)$/) do |ref, criteria, expected|
70
- expect { @current_page.get_int(@current_page.ref_to_arr(ref).flat_map { |s| s.ref_to_arr(criteria) }) }.to eventually eql(expected.to_i), "#{ref} #{criteria} visibility"
71
- end
72
-
73
-
74
- # Elements should be enabled / disabled
75
- Then(/^the \[(\w+)\] should be enabled$/) do |ref|
76
- expect { @current_page.ref_to_arr(ref) }.to eventually all be_enabled
77
- end
78
-
79
- Then(/^the \[(\w+)\] should be disabled$/) do |ref|
80
- expect { @current_page.ref_to_arr(ref).map { |e| e.exists? && e.enabled? } }.to eventually_not include be_truthy
81
- end
82
-
83
- # Sub Elements should be enabled / disabled
84
- Then(/^the \[(\w+)\] \[(\w+)\] should be enabled$/) do |ref, sub_ref|
85
- expect { @current_page.ref_to_arr(ref).flat_map { |section| section.ref_to_arr(sub_ref) }.select(&:enabled?) }.to eventually all be_truthy
86
- end
87
-
88
- Then(/^the \[(\w+)\] \[(\w+)\] should be disabled$/) do |ref, sub_ref|
89
- expect { @current_page.ref_to_arr(ref).flat_map { |section| section.ref_to_arr(sub_ref) }.select(&:enabled?) }.to eventually_not all be_truthy
90
- end
46
+ Then(/^\((\d+)\) \[(\w+)\] should have \((\d+)\) \[(\w+)\] where \((\d+)\) \[(\w+)\] is visible$/) do |exp_ref, ref, exp_sub_ref, sub_ref, exp_sub_criteria, sub_criteria|
47
+ expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |section| section.ref_to_arr(sub_criteria).select { |element| element.visible? }.size == exp_sub_criteria.to_i }.size == exp_sub_ref.to_i }.size }.to eventually eq(exp_ref.to_i), "#{ref} #{sub_ref} #{sub_criteria} visibility"
48
+ end
49
+
50
+ Then(/^all \[(\w+)\] should have \((\d+)\) \[(\w+)\] where \((\d+)\) \[(\w+)\] is visible$/) do |ref, exp_sub_ref, sub_ref, exp_sub_criteria, sub_criteria|
51
+ expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |section| section.ref_to_arr(sub_criteria).select { |element| element.visible? }.size == exp_sub_criteria.to_i }.size == exp_sub_ref.to_i }.size }.to eventually eql(@current_page.ref_to_arr(ref).size), "#{ref} #{sub_ref} #{sub_criteria} visibility"
52
+ end
53
+
54
+ Then(/^\((\d+)\) \[(\w+)\] should have all \[(\w+)\] where \((\d+)\) \[(\w+)\] is visible$/) do |exp_ref, ref, sub_ref, exp_sub_criteria, sub_criteria|
55
+ expect { @current_page.ref_to_arr(ref).select { |section| section.ref_to_arr(sub_ref).select { |section| section.ref_to_arr(sub_criteria).select { |element| element.visible? }.size == exp_sub_criteria.to_i }.size == section.ref_to_arr(sub_ref).size }.size }.to eventually eql(exp_ref.to_i), "#{ref} #{sub_ref} #{sub_criteria} visibility"
56
+ end
57
+
58
+
59
+ # Element within a Page Section within a Page Section should contain text
60
+ Then(/^the \[(\w+)\] \[(\w+)\] \[(\w+)\] should include the text "{(.*)}"$/) do |ref, sub_ref, sub_sub_ref, expected|
61
+ expect { @current_page.ref_to_arr(ref).map {|r| r.ref_to_arr(sub_ref)}.map {|sr| sr.ref_to_arr(sub_sub_ref)}.flatten.map {|e| e.attribute('textContent')} }.to eventually all include(expected)
62
+ end
63
+
64
+ # Element within a Page Section should contain text
65
+ Then(/^the \[(\w+)\] \[(\w+)\] should include the text "{(.*)}"$/) do |ref, sub_ref, expected|
66
+ expect { @current_page.ref_to_arr(ref).map {|r| r.ref_to_arr(sub_ref)}.flatten.map {|e| e.attribute('textContent')} }.to eventually all include(expected)
67
+ end
68
+
69
+ # Element should contain text
70
+ Then(/^the \[(\w+)\] should include the text "{(.*)}"$/) do |ref, expected|
71
+ expect { @current_page.ref_to_arr(ref).map {|e| e.attribute('textContent')} }.to eventually all include(expected)
72
+ end
73
+
74
+
75
+ # E/Es/PS/PSs should be enabled
76
+ Then(/^the \[(\w+)\] should be enabled$/) do |ref|
77
+ expect { @current_page.ref_to_arr(ref) }.to eventually all be_enabled
78
+ end
79
+
80
+ # E/Es/PS/PSs should be disabled
81
+ Then(/^the \[(\w+)\] should be disabled$/) do |ref|
82
+ expect { @current_page.ref_to_arr(ref).map { |e| e.exists? && e.enabled? } }.to eventually_not include be_truthy
83
+ end
84
+
85
+ # E/Es/PS/PSs within PS/PSs should be enabled
86
+ Then(/^the \[(\w+)\] \[(\w+)\] should be enabled$/) do |ref, sub_ref|
87
+ expect { @current_page.ref_to_arr(ref).flat_map { |section| section.ref_to_arr(sub_ref) }.select(&:enabled?) }.to eventually all be_truthy
88
+ end
89
+
90
+ # E/Es/PS/PSs within PS/PSs should be disabled
91
+ Then(/^the \[(\w+)\] \[(\w+)\] should be disabled$/) do |ref, sub_ref|
92
+ expect { @current_page.ref_to_arr(ref).flat_map { |section| section.ref_to_arr(sub_ref) }.select(&:enabled?) }.to eventually_not all be_truthy
93
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magic_steps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Commu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-12 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Use this library to add cucumber step helpers to your test frameworks
14
14
  email:
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 2.5.1
44
+ rubygems_version: 2.6.7
45
45
  signing_key:
46
46
  specification_version: 4
47
47
  summary: Helper Cucumber steps for web, api, and app