pyrite 0.6.2 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pyrite/dsl.rb +11 -11
- metadata +4 -4
data/lib/pyrite/dsl.rb
CHANGED
@@ -6,7 +6,7 @@ module Pyrite
|
|
6
6
|
if element.match /date/ # Try to guess at date selects
|
7
7
|
select_date(element, value)
|
8
8
|
else
|
9
|
-
browser.type("
|
9
|
+
browser.type("jquery=#{element}", value)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -20,9 +20,9 @@ module Pyrite
|
|
20
20
|
:minute => '5i'
|
21
21
|
}
|
22
22
|
date = value.respond_to?(:year) ? value : Date.parse(value)
|
23
|
-
browser.select "
|
24
|
-
browser.select "
|
25
|
-
browser.select "
|
23
|
+
browser.select "jquery=#{element}_#{suffixes[:year]}", date.year
|
24
|
+
browser.select "jquery=#{element}_#{suffixes[:month]}", date.strftime('%B')
|
25
|
+
browser.select "jquery=#{element}_#{suffixes[:day]}", date.day
|
26
26
|
end
|
27
27
|
|
28
28
|
# Open a URL
|
@@ -38,22 +38,22 @@ module Pyrite
|
|
38
38
|
|
39
39
|
# Press an submit (not button) input based on its text
|
40
40
|
def press(text)
|
41
|
-
browser.click("
|
41
|
+
browser.click("jquery=input[type=submit][value='#{text}']")
|
42
42
|
end
|
43
43
|
|
44
44
|
# Check a chek box or toggle a radio button
|
45
45
|
def check(locator)
|
46
|
-
browser.check("
|
46
|
+
browser.check("jquery=#{locator}")
|
47
47
|
end
|
48
48
|
|
49
49
|
# Click anything else
|
50
50
|
def click(locator)
|
51
|
-
browser.click("
|
51
|
+
browser.click("jquery=#{locator}")
|
52
52
|
end
|
53
53
|
|
54
54
|
# Pick an option from a select element
|
55
55
|
def select(element, option)
|
56
|
-
browser.select("
|
56
|
+
browser.select("jquery=#{element}", option)
|
57
57
|
end
|
58
58
|
|
59
59
|
# Wait for a specific element, the page to load
|
@@ -65,7 +65,7 @@ module Pyrite
|
|
65
65
|
when :ajax
|
66
66
|
browser.wait_for(:wait_for => :ajax, :javascript_framework => Pyrite.js_framework)
|
67
67
|
else
|
68
|
-
browser.wait_for(:element => "
|
68
|
+
browser.wait_for(:element => "jquery=#{element}")
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -97,11 +97,11 @@ module Pyrite
|
|
97
97
|
browser.get_confirmation
|
98
98
|
end
|
99
99
|
|
100
|
-
# drag an
|
100
|
+
# drag an jquery selector to the center pixel of another, e.g.
|
101
101
|
# `drag_and_drop(:from => "li#element_#{my_oject.id}", :to => "div#trash")
|
102
102
|
# ProTip: if you have a list of elements you wish to re-order, drag the top element down.
|
103
103
|
def drag_and_drop(opts={})
|
104
|
-
browser.drag_and_drop_to_object("
|
104
|
+
browser.drag_and_drop_to_object("jquery=#{opts[:from]}", "jquery=#{opts[:to]}")
|
105
105
|
end
|
106
106
|
|
107
107
|
# Capture the page and try to open it
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pyrite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 5
|
10
|
+
version: 0.6.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Adam Rogers
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-07-
|
19
|
+
date: 2010-07-20 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|