sapphire 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sapphire/DSL/Browser/Error.rb +1 -1
- data/lib/sapphire/DSL/Browser/Hide.rb +1 -1
- data/lib/sapphire/DSL/Browser/List.rb +14 -0
- data/lib/sapphire/DSL/Browser/Show.rb +3 -3
- data/lib/sapphire/DSL/Data/Validate.rb +1 -1
- data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +21 -0
- data/lib/sapphire/WebAbstractions/Controls/Base/Page.rb +4 -0
- data/lib/sapphire/version.rb +1 -1
- metadata +9 -8
@@ -5,11 +5,11 @@ module Sapphire
|
|
5
5
|
if(item.is_a? Hash)
|
6
6
|
ExecuteHashAgainstControl(item) do |control, arg|
|
7
7
|
wait = Selenium::WebDriver::Wait.new(:timeout => 10)
|
8
|
-
text = wait.until { x = control
|
9
|
-
x unless x
|
8
|
+
text = wait.until { x = control
|
9
|
+
x unless (!x.Equals(arg) && x.Equals(""))
|
10
10
|
}
|
11
11
|
|
12
|
-
return text
|
12
|
+
return text.Equals(arg)
|
13
13
|
end
|
14
14
|
elsif(item.is_a? Symbol)
|
15
15
|
return IsVisible(item) == true
|
@@ -16,6 +16,16 @@ module Sapphire
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
def FindAll
|
20
|
+
if(@hash.has_key?(:id))
|
21
|
+
FindAllBy :id
|
22
|
+
elsif (@hash.has_key?(:name))
|
23
|
+
FindAllBy :name
|
24
|
+
elsif (@hash.has_key?(:xpath))
|
25
|
+
FindAllBy :xpath
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
19
29
|
def FindWithoutWait
|
20
30
|
if(@hash.has_key?(:id))
|
21
31
|
FindWithoutWaitBy :id
|
@@ -37,6 +47,13 @@ module Sapphire
|
|
37
47
|
}
|
38
48
|
end
|
39
49
|
|
50
|
+
def FindAllBy(symbol)
|
51
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => 10)
|
52
|
+
element = wait.until { x = @browser.find_elements symbol, @hash.fetch(symbol)
|
53
|
+
x
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
40
57
|
def FindParent(hash)
|
41
58
|
if(hash.has_key?(:id))
|
42
59
|
@browser.find_element :id, hash.fetch(:id)
|
@@ -67,6 +84,10 @@ module Sapphire
|
|
67
84
|
end
|
68
85
|
sleep(1)
|
69
86
|
end
|
87
|
+
|
88
|
+
def Equals(value)
|
89
|
+
self.Text == value
|
90
|
+
end
|
70
91
|
end
|
71
92
|
end
|
72
93
|
end
|
data/lib/sapphire/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sapphire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-08-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: albacore
|
16
|
-
requirement: &
|
16
|
+
requirement: &9555948 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *9555948
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: selenium-webdriver
|
27
|
-
requirement: &
|
27
|
+
requirement: &9555528 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *9555528
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: activesupport
|
38
|
-
requirement: &
|
38
|
+
requirement: &9555084 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *9555084
|
47
47
|
description: An automated web acceptance test framework for non-technical resources
|
48
48
|
using selenium-wedriver.
|
49
49
|
email:
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/sapphire/DSL/Browser/Hide.rb
|
71
71
|
- lib/sapphire/DSL/Browser/IsHidden.rb
|
72
72
|
- lib/sapphire/DSL/Browser/IsVisible.rb
|
73
|
+
- lib/sapphire/DSL/Browser/List.rb
|
73
74
|
- lib/sapphire/DSL/Browser/MouseOver.rb
|
74
75
|
- lib/sapphire/DSL/Browser/Navigate.rb
|
75
76
|
- lib/sapphire/DSL/Browser/Not.rb
|