safariwatir 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/safariwatir.rb +17 -1
  2. data/safariwatir/scripter.rb +14 -1
  3. metadata +2 -2
@@ -54,7 +54,19 @@ module Watir
54
54
  def_init :scripter
55
55
 
56
56
  def click
57
- @scripter.click_alert_ok
57
+ @scripter.click_alert
58
+ end
59
+ end
60
+
61
+ class SecurityWarningWindow
62
+ def_init :scripter
63
+
64
+ def continue
65
+ @scripter.click_security_warning("Continue")
66
+ end
67
+
68
+ def cancel
69
+ @scripter.click_security_warning("Cancel")
58
70
  end
59
71
  end
60
72
 
@@ -485,6 +497,10 @@ module Watir
485
497
  def alert
486
498
  AlertWindow.new(scripter)
487
499
  end
500
+
501
+ def security_warning
502
+ SecurityWarningWindow.new(scripter)
503
+ end
488
504
 
489
505
  def goto(url)
490
506
  scripter.navigate_to(url)
@@ -409,7 +409,7 @@ for (var i = 0; i < elements.length; i++) {
409
409
  end
410
410
  end
411
411
 
412
- def click_alert_ok
412
+ def click_alert
413
413
  execute_system_events(%|
414
414
  tell window 1
415
415
  if button named "OK" exists then
@@ -417,6 +417,19 @@ tell window 1
417
417
  end if
418
418
  end tell|)
419
419
  end
420
+
421
+ def click_security_warning(label)
422
+ execute_system_events(%|
423
+ tell window 1
424
+ tell sheet 1
425
+ tell group 2
426
+ if button named "#{label}" exists then
427
+ click button named "#{label}"
428
+ end if
429
+ end tell
430
+ end tell
431
+ end tell|)
432
+ end
420
433
 
421
434
  def for_table(element)
422
435
  AppleScripter.new(TableJavaScripter.new(element))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safariwatir
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Hoover
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-17 00:00:00 -05:00
12
+ date: 2008-10-22 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency