conformity 0.0.8 → 0.0.9
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/conformity/actions.rb +42 -16
- data/lib/conformity/form.rb +1 -5
- data/lib/conformity/version.rb +1 -1
- data/lib/conformity.rb +0 -1
- data/spec/form_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e405b329514c0569897e41ff7e62a3b7d67e552b
|
4
|
+
data.tar.gz: 2580059337a97a3d998c400dc0450d1b90544004
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb1593b4682f3d2a468cd73b66ca56b42772cc1048921cf333e1ceab75f52acdeeb935f06bf3683608b1c9d453cb0d070a18769bb14db2f1e14fac91ba20efc1
|
7
|
+
data.tar.gz: 7f522be5f5bbd0dcd1abbd2dbb95a673c923fe10fdd201dcf46005eb2327ae982a5af5b40fe75695147ce575c85c0b508db82de35ff1897e14bb06472e62808c
|
data/lib/conformity/actions.rb
CHANGED
@@ -15,45 +15,71 @@ module Conformity
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def click_on(locator, options={})
|
18
|
-
|
19
|
-
|
18
|
+
begin
|
19
|
+
session.click_on(locator, options)
|
20
|
+
rescue Capybara::ElementNotFound
|
21
|
+
session.find(locator, options).click
|
22
|
+
end
|
23
|
+
screenshot(:click_on) if Conformity.log_screenshots
|
20
24
|
end
|
21
|
-
alias_method :click_link_or_button, :click_on
|
22
|
-
alias_method :click_link, :click_on
|
23
|
-
alias_method :click_button, :click_on
|
24
25
|
|
25
26
|
def fill_in(locator, options={})
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
begin
|
28
|
+
dup = options.dup
|
29
|
+
session.fill_in(locator, dup)
|
30
|
+
rescue Capybara::ElementNotFound
|
31
|
+
raise "Must pass a hash containing 'with'" if not options.is_a?(Hash) or not options.has_key?(:with)
|
32
|
+
with = options.delete(:with)
|
33
|
+
fill_options = options.delete(:fill_options)
|
34
|
+
session.find(locator, options).set(with)
|
35
|
+
end
|
30
36
|
screenshot(:fill_in) if Conformity.log_screenshots
|
31
37
|
end
|
32
38
|
|
33
39
|
def choose(locator, options={})
|
34
|
-
|
40
|
+
begin
|
41
|
+
session.choose(locator, options)
|
42
|
+
rescue Capybara::ElementNotFound
|
43
|
+
session.find(locator, options).set(true)
|
44
|
+
end
|
35
45
|
screenshot(:choose) if Conformity.log_screenshots
|
36
46
|
end
|
37
47
|
|
38
48
|
def check(locator, options={})
|
39
|
-
|
49
|
+
begin
|
50
|
+
session.check(locator, options)
|
51
|
+
rescue Capybara::ElementNotFound
|
52
|
+
session.find(locator, options).set(true)
|
53
|
+
end
|
40
54
|
screenshot(:check) if Conformity.log_screenshots
|
41
55
|
end
|
42
56
|
|
43
57
|
def uncheck(locator, options={})
|
44
|
-
|
58
|
+
begin
|
59
|
+
session.uncheck(locator, options)
|
60
|
+
rescue Capybara::ElementNotFound
|
61
|
+
session.find(locator, options).set(false)
|
62
|
+
end
|
45
63
|
screenshot(:uncheck) if Conformity.log_screenshots
|
46
64
|
end
|
47
65
|
|
48
66
|
def select(value, options={})
|
49
|
-
|
50
|
-
|
67
|
+
begin
|
68
|
+
session.select(value, options)
|
69
|
+
rescue Capybara::ElementNotFound
|
70
|
+
options.delete(:from)
|
71
|
+
session.find(value, options).select_option
|
72
|
+
end
|
51
73
|
screenshot(:select) if Conformity.log_screenshots
|
52
74
|
end
|
53
75
|
|
54
76
|
def unselect(value, options={})
|
55
|
-
|
56
|
-
|
77
|
+
begin
|
78
|
+
session.unselect(value, options)
|
79
|
+
rescue Capybara::ElementNotFound
|
80
|
+
options.delete(:from)
|
81
|
+
session.find(value, options).unselect_option
|
82
|
+
end
|
57
83
|
screenshot(:unselect) if Conformity.log_screenshots
|
58
84
|
end
|
59
85
|
|
data/lib/conformity/form.rb
CHANGED
data/lib/conformity/version.rb
CHANGED
data/lib/conformity.rb
CHANGED
data/spec/form_spec.rb
CHANGED
@@ -42,13 +42,13 @@ describe Form do
|
|
42
42
|
skip "test not implemented"
|
43
43
|
end
|
44
44
|
|
45
|
-
it 'raises
|
45
|
+
it 'raises error on failure' do
|
46
46
|
form = Form.new do
|
47
47
|
fill_in 'name', with: field(:name)
|
48
48
|
click_on 'submit'
|
49
49
|
end
|
50
50
|
|
51
|
-
expect { form.fill_with(name: 'Jane Doe') }.to raise_error
|
51
|
+
expect { form.fill_with(name: 'Jane Doe') }.to raise_error
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conformity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikias Kalpaxis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|