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 +4 -4
- data/lib/magic_steps/page_object/verifications.rb +78 -75
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5392ba844319f8ebe596737f14671566f19a5778
|
4
|
+
data.tar.gz: 37a05faa102a645fb47f531cdb58563c0d50b5be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 062822268103039cc6eb50f48a7492bded9ad8c567fe34b6cfccf06dd106abe9939218ee22fd22ae2ac68afd3ff44f532537a7baafa21d528c56646db4cead27
|
7
|
+
data.tar.gz: f045b7c362bcedcab6bd86c8de226bfe32020f954bc8012ce5ebed3dfa384f238177bf6db3263711dcb70fc2a2e7691dc4e933992909c30bdf20e7effd60d11a
|
@@ -1,90 +1,93 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# Count References
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
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
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
30
|
-
|
31
|
-
|
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
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
38
|
-
|
39
|
-
|
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
|
-
|
42
|
-
|
43
|
-
|
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
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
# Page
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
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.
|
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-
|
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.
|
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
|