pyrite 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pyrite/pyrite_test.rb +23 -0
- metadata +17 -6
data/lib/pyrite/pyrite_test.rb
CHANGED
@@ -25,6 +25,29 @@ module Pyrite
|
|
25
25
|
browser.start_new_browser_session
|
26
26
|
browser.get_eval "window.moveTo(1,0)"
|
27
27
|
browser.window_maximize
|
28
|
+
browser.add_location_strategy("jquery",
|
29
|
+
"var loc = locator; " +
|
30
|
+
"var attr = null; " +
|
31
|
+
"var isattr = false; " +
|
32
|
+
"var inx = locator.lastIndexOf('@'); " +
|
33
|
+
|
34
|
+
"if (inx != -1){ " +
|
35
|
+
" loc = locator.substring(0, inx); " +
|
36
|
+
" attr = locator.substring(inx + 1); " +
|
37
|
+
" isattr = true; " +
|
38
|
+
"} " +
|
39
|
+
|
40
|
+
"var found = jQuery(inDocument).find(loc); " +
|
41
|
+
"if (found.length >= 1) { " +
|
42
|
+
" if (isattr) { " +
|
43
|
+
" return found[0].getAttribute(attr); " +
|
44
|
+
" } else { " +
|
45
|
+
" return found[0]; " +
|
46
|
+
" } " +
|
47
|
+
"} else { " +
|
48
|
+
" return null; " +
|
49
|
+
"}"
|
50
|
+
)
|
28
51
|
super
|
29
52
|
end
|
30
53
|
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pyrite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 3
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 6
|
8
|
-
-
|
9
|
-
version: 0.6.
|
9
|
+
- 2
|
10
|
+
version: 0.6.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Adam Rogers
|
@@ -15,16 +16,18 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2010-
|
19
|
+
date: 2010-07-15 00:00:00 +01:00
|
19
20
|
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
22
23
|
name: selenium-client
|
23
24
|
prerelease: false
|
24
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
25
27
|
requirements:
|
26
28
|
- - ~>
|
27
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 59
|
28
31
|
segments:
|
29
32
|
- 1
|
30
33
|
- 2
|
@@ -36,23 +39,27 @@ dependencies:
|
|
36
39
|
name: selenium_remote_control
|
37
40
|
prerelease: false
|
38
41
|
requirement: &id002 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
39
43
|
requirements:
|
40
44
|
- - ~>
|
41
45
|
- !ruby/object:Gem::Version
|
46
|
+
hash: 31
|
42
47
|
segments:
|
43
48
|
- 1
|
44
49
|
- 0
|
45
|
-
-
|
46
|
-
version: 1.0.
|
50
|
+
- 4
|
51
|
+
version: 1.0.4
|
47
52
|
type: :runtime
|
48
53
|
version_requirements: *id002
|
49
54
|
- !ruby/object:Gem::Dependency
|
50
55
|
name: database_cleaner
|
51
56
|
prerelease: false
|
52
57
|
requirement: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
53
59
|
requirements:
|
54
60
|
- - ~>
|
55
61
|
- !ruby/object:Gem::Version
|
62
|
+
hash: 15
|
56
63
|
segments:
|
57
64
|
- 0
|
58
65
|
- 5
|
@@ -90,23 +97,27 @@ rdoc_options: []
|
|
90
97
|
require_paths:
|
91
98
|
- lib
|
92
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
93
101
|
requirements:
|
94
102
|
- - ">="
|
95
103
|
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
96
105
|
segments:
|
97
106
|
- 0
|
98
107
|
version: "0"
|
99
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
100
110
|
requirements:
|
101
111
|
- - ">="
|
102
112
|
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
103
114
|
segments:
|
104
115
|
- 0
|
105
116
|
version: "0"
|
106
117
|
requirements: []
|
107
118
|
|
108
119
|
rubyforge_project:
|
109
|
-
rubygems_version: 1.3.
|
120
|
+
rubygems_version: 1.3.7
|
110
121
|
signing_key:
|
111
122
|
specification_version: 3
|
112
123
|
summary: Easy peasy browser testing
|