sapphire 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/lib/sapphire/DSL/Browser/Browser.rb +13 -13
  2. data/lib/sapphire/DSL/Browser/Check.rb +12 -12
  3. data/lib/sapphire/DSL/Browser/Clear.rb +15 -15
  4. data/lib/sapphire/DSL/Browser/Click.rb +12 -12
  5. data/lib/sapphire/DSL/Browser/Close.rb +12 -12
  6. data/lib/sapphire/DSL/Browser/Complete.rb +15 -15
  7. data/lib/sapphire/DSL/Browser/CurrentUrl.rb +11 -11
  8. data/lib/sapphire/DSL/Browser/Error.rb +12 -12
  9. data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +45 -45
  10. data/lib/sapphire/DSL/Browser/Exists.rb +22 -22
  11. data/lib/sapphire/DSL/Browser/For.rb +10 -10
  12. data/lib/sapphire/DSL/Browser/Hide.rb +10 -10
  13. data/lib/sapphire/DSL/Browser/IsHidden.rb +28 -28
  14. data/lib/sapphire/DSL/Browser/IsVisible.rb +25 -25
  15. data/lib/sapphire/DSL/Browser/MouseOver.rb +12 -12
  16. data/lib/sapphire/DSL/Browser/Navigate.rb +11 -11
  17. data/lib/sapphire/DSL/Browser/Not.rb +9 -0
  18. data/lib/sapphire/DSL/Browser/Reload.rb +11 -11
  19. data/lib/sapphire/DSL/Browser/Set.rb +12 -12
  20. data/lib/sapphire/DSL/Browser/Should.rb +10 -10
  21. data/lib/sapphire/DSL/Browser/Show.rb +27 -26
  22. data/lib/sapphire/DSL/Browser/Start.rb +16 -16
  23. data/lib/sapphire/DSL/Browser/To.rb +10 -10
  24. data/lib/sapphire/DSL/Browser/Tracker.rb +15 -15
  25. data/lib/sapphire/DSL/Browser/Transition.rb +10 -10
  26. data/lib/sapphire/DSL/Browser/Uncheck.rb +12 -12
  27. data/lib/sapphire/DSL/Browser/With.rb +10 -10
  28. data/lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb +12 -12
  29. data/lib/sapphire/DSL/Configuration/ConfiguredUser.rb +10 -10
  30. data/lib/sapphire/DSL/Configuration/Use.rb +15 -15
  31. data/lib/sapphire/DSL/Data/Exist.rb +11 -11
  32. data/lib/sapphire/DSL/Data/Find.rb +10 -10
  33. data/lib/sapphire/DSL/Data/GetPageField.rb +17 -17
  34. data/lib/sapphire/DSL/Data/Underscore.rb +8 -8
  35. data/lib/sapphire/DSL/Data/Validate.rb +16 -16
  36. data/lib/sapphire/DSL/Data/Verify.rb +10 -10
  37. data/lib/sapphire/DSL/Scenarios/Is.rb +9 -9
  38. data/lib/sapphire/DSL/Scenarios/Pending.rb +28 -28
  39. data/lib/sapphire/DSL/Scenarios/and.rb +24 -24
  40. data/lib/sapphire/DSL/Scenarios/background.rb +22 -22
  41. data/lib/sapphire/DSL/Scenarios/dsl.rb +60 -60
  42. data/lib/sapphire/DSL/Scenarios/finally.rb +31 -31
  43. data/lib/sapphire/DSL/Scenarios/given.rb +56 -56
  44. data/lib/sapphire/DSL/Scenarios/runner.rb +30 -30
  45. data/lib/sapphire/DSL/Scenarios/scenario.rb +51 -51
  46. data/lib/sapphire/DSL/Scenarios/then.rb +33 -33
  47. data/lib/sapphire/DSL/Scenarios/when.rb +46 -46
  48. data/lib/sapphire/DataAbstractions/Database.rb +57 -57
  49. data/lib/sapphire/DataAbstractions/Query.rb +19 -19
  50. data/lib/sapphire/Testing/ResultList.rb +18 -18
  51. data/lib/sapphire/Testing/ResultTree.rb +37 -37
  52. data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +74 -74
  53. data/lib/sapphire/WebAbstractions/Controls/Base/Page.rb +47 -47
  54. data/lib/sapphire/WebAbstractions/Controls/Base/WebBrowser.rb +74 -74
  55. data/lib/sapphire/WebAbstractions/Controls/Button.rb +9 -9
  56. data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +28 -28
  57. data/lib/sapphire/WebAbstractions/Controls/Chrome.rb +21 -21
  58. data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +25 -25
  59. data/lib/sapphire/WebAbstractions/Controls/FireFox.rb +22 -22
  60. data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -8
  61. data/lib/sapphire/WebAbstractions/Controls/Image.rb +9 -9
  62. data/lib/sapphire/WebAbstractions/Controls/InternetExplorer.rb +21 -21
  63. data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -8
  64. data/lib/sapphire/WebAbstractions/Controls/RadioButton.rb +18 -18
  65. data/lib/sapphire/WebAbstractions/Controls/TableCell.rb +10 -0
  66. data/lib/sapphire/WebAbstractions/Controls/TextBox.rb +31 -31
  67. data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -12
  68. data/lib/sapphire/version.rb +1 -1
  69. metadata +13 -9
@@ -1,74 +1,74 @@
1
- module Sapphire
2
- module WebAbstractions
3
- module WebBrowser
4
-
5
- attr_reader :rootUrl
6
-
7
- def Init(url)
8
- @rootUrl = url
9
- end
10
-
11
- def SetRootUrl(url)
12
- if(url.instance_of?(String))
13
- self.Init(url)
14
- else
15
- x = url.new().Url
16
- self.Init(x)
17
- end
18
- end
19
-
20
- def NavigateTo(page)
21
- if(page.is_a? Class)
22
- nav = page.new self
23
- else
24
- nav = page
25
- end
26
-
27
- self.browser.get "https://" + nav.Url
28
- nav
29
- end
30
-
31
- def CurrentUrl
32
- self.current_url
33
- end
34
-
35
- def Reload
36
- self.browser.get self.current_url
37
- end
38
-
39
- def ShouldNavigateTo(page)
40
- if(page.is_a? Class)
41
- nav = page.new self
42
- else
43
- nav = page
44
- end
45
-
46
- self.current_url.upcase.start_with?("HTTPS://" + nav.Url.upcase).should == true
47
-
48
- nav
49
- end
50
-
51
- def Run(background)
52
- scenario = background.new self
53
- scenario.Run
54
- end
55
-
56
- def ShouldShow(page)
57
- self.ShouldNavigateTo page
58
- end
59
-
60
- def ShouldTransitionTo(url)
61
- if(url.instance_of?(String))
62
- self.current_url.upcase.start_with?("HTTPS://" + url.upcase).should == true
63
- @rootUrl = url
64
- else
65
- x = url.new().Url
66
- self.current_url.upcase.start_with?("HTTPS://" + x.upcase).should == true
67
- @rootUrl = x
68
- end
69
- end
70
- end
71
- end
72
- end
73
-
74
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ module WebBrowser
4
+
5
+ attr_reader :rootUrl
6
+
7
+ def Init(url)
8
+ @rootUrl = url
9
+ end
10
+
11
+ def SetRootUrl(url)
12
+ if(url.instance_of?(String))
13
+ self.Init(url)
14
+ else
15
+ x = url.new().Url
16
+ self.Init(x)
17
+ end
18
+ end
19
+
20
+ def NavigateTo(page)
21
+ if(page.is_a? Class)
22
+ nav = page.new self
23
+ else
24
+ nav = page
25
+ end
26
+
27
+ self.browser.get "https://" + nav.Url
28
+ nav
29
+ end
30
+
31
+ def CurrentUrl
32
+ self.current_url
33
+ end
34
+
35
+ def Reload
36
+ self.browser.get self.current_url
37
+ end
38
+
39
+ def ShouldNavigateTo(page)
40
+ if(page.is_a? Class)
41
+ nav = page.new self
42
+ else
43
+ nav = page
44
+ end
45
+
46
+ self.current_url.upcase.start_with?("HTTPS://" + nav.Url.upcase) == true
47
+
48
+ nav
49
+ end
50
+
51
+ def Run(background)
52
+ scenario = background.new self
53
+ scenario.Run
54
+ end
55
+
56
+ def ShouldShow(page)
57
+ self.ShouldNavigateTo page
58
+ end
59
+
60
+ def ShouldTransitionTo(url)
61
+ if(url.instance_of?(String))
62
+ self.current_url.upcase.start_with?("HTTPS://" + url.upcase) == true
63
+ @rootUrl = url
64
+ else
65
+ x = url.new().Url
66
+ self.current_url.upcase.start_with?("HTTPS://" + x.upcase) == true
67
+ @rootUrl = x
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+
74
+
@@ -1,9 +1,9 @@
1
- require File.expand_path('../../WebAbstractions/Controls/Base/Control', File.dirname(__FILE__))
2
-
3
- module Sapphire
4
- module WebAbstractions
5
- class Button < Control
6
- end
7
- end
8
- end
9
-
1
+ require File.expand_path('../../WebAbstractions/Controls/Base/Control', File.dirname(__FILE__))
2
+
3
+ module Sapphire
4
+ module WebAbstractions
5
+ class Button < Control
6
+ end
7
+ end
8
+ end
9
+
@@ -1,28 +1,28 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class CheckBox < Control
4
- def Check (value)
5
-
6
- if value && self.IsChecked
7
- return;
8
- end
9
-
10
- if !value && !self.IsChecked
11
- return;
12
- end
13
-
14
- radio = self.Find
15
- radio.click
16
-
17
- end
18
-
19
- def IsChecked
20
-
21
- radio = self.Find
22
- radio.attribute("checked");
23
-
24
- end
25
- end
26
- end
27
- end
28
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class CheckBox < Control
4
+ def Check (value)
5
+
6
+ if value && self.IsChecked
7
+ return;
8
+ end
9
+
10
+ if !value && !self.IsChecked
11
+ return;
12
+ end
13
+
14
+ radio = self.Find
15
+ radio.click
16
+
17
+ end
18
+
19
+ def IsChecked
20
+
21
+ radio = self.Find
22
+ radio.attribute("checked");
23
+
24
+ end
25
+ end
26
+ end
27
+ end
28
+
@@ -1,21 +1,21 @@
1
- module Sapphire
2
- module WebAbstractions
3
- def Chrome(url)
4
- ChromeBrowser.new
5
- end
6
-
7
- class ChromeBrowser < DelegateClass(Selenium::WebDriver::Chrome::Bridge)
8
- include WebBrowser
9
-
10
- attr_reader :browser
11
-
12
- def initialize()
13
- @browser = Selenium::WebDriver.for :chrome
14
- super @browser
15
- $browser = @browser
16
- end
17
- end
18
- end
19
- end
20
-
21
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ def Chrome(url)
4
+ ChromeBrowser.new
5
+ end
6
+
7
+ class ChromeBrowser < DelegateClass(Selenium::WebDriver::Chrome::Bridge)
8
+ include WebBrowser
9
+
10
+ attr_reader :browser
11
+
12
+ def initialize()
13
+ @browser = Selenium::WebDriver.for :chrome
14
+ super @browser
15
+ $browser = @browser
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+
@@ -1,25 +1,25 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class DropDown < Control
4
- def Selected= (value)
5
- text = self.Find
6
- text.send_keys value
7
- end
8
-
9
- def Selected
10
- text = self.Find
11
- text.value
12
- end
13
-
14
- def Set(value)
15
- text = self.Find
16
- text.send_keys value
17
- end
18
- end
19
- end
20
- end
21
-
22
-
23
-
24
-
25
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class DropDown < Control
4
+ def Selected= (value)
5
+ text = self.Find
6
+ text.send_keys value
7
+ end
8
+
9
+ def Selected
10
+ text = self.Find
11
+ text.value
12
+ end
13
+
14
+ def Set(value)
15
+ text = self.Find
16
+ text.send_keys value
17
+ end
18
+ end
19
+ end
20
+ end
21
+
22
+
23
+
24
+
25
+
@@ -1,22 +1,22 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class FireFoxBrowser < DelegateClass(Selenium::WebDriver::Firefox::Bridge)
4
- include WebBrowser
5
-
6
- attr_reader :browser
7
-
8
- def initialize()
9
- @browser = Selenium::WebDriver.for :firefox
10
- super(@browser)
11
- $browser = @browser
12
- end
13
-
14
- end
15
-
16
- def FireFox(url)
17
- FireFoxBrowser.new
18
- end
19
- end
20
- end
21
-
22
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class FireFoxBrowser < DelegateClass(Selenium::WebDriver::Firefox::Bridge)
4
+ include WebBrowser
5
+
6
+ attr_reader :browser
7
+
8
+ def initialize()
9
+ @browser = Selenium::WebDriver.for :firefox
10
+ super(@browser)
11
+ $browser = @browser
12
+ end
13
+
14
+ end
15
+
16
+ def FireFox(url)
17
+ FireFoxBrowser.new
18
+ end
19
+ end
20
+ end
21
+
22
+
@@ -1,8 +1,8 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Hyperlink < Control
4
-
5
- end
6
- end
7
- end
8
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Hyperlink < Control
4
+
5
+ end
6
+ end
7
+ end
8
+
@@ -1,9 +1,9 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Image < Control
4
-
5
- end
6
- end
7
- end
8
-
9
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Image < Control
4
+
5
+ end
6
+ end
7
+ end
8
+
9
+
@@ -1,21 +1,21 @@
1
- module Sapphire
2
- module WebAbstractions
3
- def InternetExplorer(url)
4
- driver = InternetExplorerBrowser.new
5
- driver
6
- end
7
-
8
- class InternetExplorerBrowser < DelegateClass(Selenium::WebDriver::IE::Bridge)
9
- include WebBrowser
10
-
11
- attr_reader :browser
12
-
13
- def initialize
14
- #@browser = Selenium::WebDriver.for :ie
15
- super(@browser)
16
- $browser = @browser
17
- end
18
- end
19
- end
20
- end
21
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ def InternetExplorer(url)
4
+ driver = InternetExplorerBrowser.new
5
+ driver
6
+ end
7
+
8
+ class InternetExplorerBrowser < DelegateClass(Selenium::WebDriver::IE::Bridge)
9
+ include WebBrowser
10
+
11
+ attr_reader :browser
12
+
13
+ def initialize
14
+ #@browser = Selenium::WebDriver.for :ie
15
+ super(@browser)
16
+ $browser = @browser
17
+ end
18
+ end
19
+ end
20
+ end
21
+
@@ -1,8 +1,8 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Label < Control
4
-
5
- end
6
- end
7
- end
8
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Label < Control
4
+
5
+ end
6
+ end
7
+ end
8
+