sapphire 0.7.25 → 0.7.26

Sign up to get free protection for your applications and to get access to all the features.
@@ -255,12 +255,38 @@ module Sapphire
255
255
  raise "Could not find control for array: " + array.to_s
256
256
  end
257
257
 
258
- def FindElement(discriminator, selector)
259
- self.Browser().find_element discriminator, selector
258
+ def Spectate(discriminator, selector)
259
+ if ENV["spectator"] == "true"
260
+ begin
261
+ if(discriminator == :id)
262
+ self.ExecuteScript("document.getElementById('#{selector}').style.backgroundColor = '#FFF467'; ")
263
+ elsif (discriminator == :name )
264
+ self.ExecuteScript("document.getElementByName('#{selector}').style.backgroundColor = '#FFF467'; ")
265
+ elsif (discriminator == :xpath)
266
+ self.ExecuteScript("document.evaluate( '#{selector}', document, null, XPathResult.ANY_TYPE, null ).iterateNext().style.backgroundColor = '#FFF467'; ")
267
+ end
268
+
269
+ sleep 1
270
+
271
+ if(discriminator == :id)
272
+ self.ExecuteScript("document.getElementById('#{selector}').style.backgroundColor = '#ACD372'; ")
273
+ elsif (discriminator == :name )
274
+ self.ExecuteScript("document.getElementByName('#{selector}').style.backgroundColor = '#ACD372'; ")
275
+ elsif (discriminator == :xpath)
276
+ self.ExecuteScript("document.evaluate( '#{selector}', document, null, XPathResult.ANY_TYPE, null ).iterateNext().style.backgroundColor = '#ACD372'; ")
277
+ end
278
+ rescue
279
+ end
280
+ end
260
281
  end
261
282
 
283
+ def FindElement(discriminator, selector)
284
+ self.Spectate(discriminator, selector)
285
+ self.Browser().find_element discriminator, selector
286
+ end
262
287
 
263
288
  def FindElements(discriminator, selector)
289
+ self.Spectate(discriminator, selector)
264
290
  self.Browser().find_elements discriminator, selector
265
291
  end
266
292
 
@@ -1,3 +1,3 @@
1
1
  module Sapphire
2
- VERSION = "0.7.25"
2
+ VERSION = "0.7.26"
3
3
  end
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.7.25
4
+ version: 0.7.26
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: 2012-04-17 00:00:00.000000000Z
12
+ date: 2012-05-07 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
16
- requirement: &9792000 !ruby/object:Gem::Requirement
16
+ requirement: &24466884 !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: *9792000
24
+ version_requirements: *24466884
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: colorize
27
- requirement: &9791748 !ruby/object:Gem::Requirement
27
+ requirement: &24466632 !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: *9791748
35
+ version_requirements: *24466632
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: Platform
38
- requirement: &9791496 !ruby/object:Gem::Requirement
38
+ requirement: &24466380 !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: *9791496
46
+ version_requirements: *24466380
47
47
  description: An automated web acceptance test framework for non-technical resources
48
48
  using selenium-wedriver.
49
49
  email: