sapphire 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  module Sapphire
2
2
  module DSL
3
3
  module Scenarios
4
- def Problematic(text)
5
- Problematic.new text
4
+ def Broken(text)
5
+ Broken.new text
6
6
  end
7
7
 
8
- class Problematic
8
+ class Broken
9
9
 
10
10
  attr_reader :text
11
11
  attr_reader :and
@@ -26,8 +26,8 @@ class Background
26
26
  def add_and(pre, text, &block)
27
27
  if(self.value.is_a? Pending)
28
28
  self.and << And.new(self, Pending.new(pre + text), &block)
29
- elsif(self.value.is_a? Problematic)
30
- self.and << And.new(self, Problematic.new(pre + text), &block)
29
+ elsif(self.value.is_a? Broken)
30
+ self.and << And.new(self, Broken.new(pre + text), &block)
31
31
  else
32
32
  self.and << And.new(self, pre + text, &block)
33
33
  end
@@ -20,8 +20,8 @@ class Finally
20
20
  def add_and(pre, text, &block)
21
21
  if(self.value.is_a? Pending)
22
22
  self.and << And.new(self, Pending.new(pre + text), &block)
23
- elsif(self.value.is_a? Problematic)
24
- self.and << And.new(self, Problematic.new(pre + text), &block)
23
+ elsif(self.value.is_a? Broken)
24
+ self.and << And.new(self, Broken.new(pre + text), &block)
25
25
  else
26
26
  self.and << And.new(self, pre + text, &block)
27
27
  end
@@ -23,8 +23,8 @@ class Given
23
23
  def add_when(pre, text, &block)
24
24
  if(self.value.is_a? Pending)
25
25
  @when << When.new(self, pre, Pending.new(text.to_s), &block)
26
- elsif(self.value.is_a? Problematic)
27
- @when << When.new(self, pre, Problematic.new(text), &block)
26
+ elsif(self.value.is_a? Broken)
27
+ @when << When.new(self, pre, Broken.new(text), &block)
28
28
  else
29
29
  x = When.new(self, pre, text, &block)
30
30
  @when << x
@@ -42,8 +42,8 @@ class Given
42
42
  def add_and(pre, text, &block)
43
43
  if(self.value.is_a? Pending or text.is_a? Pending)
44
44
  self.and << And.new(self, Pending.new(pre + text.to_s), &block)
45
- elsif(self.value.is_a? Problematic)
46
- self.and << And.new(self, Problematic.new(pre + text.to_s), &block)
45
+ elsif(self.value.is_a? Broken)
46
+ self.and << And.new(self, Broken.new(pre + text.to_s), &block)
47
47
  else
48
48
  self.and << And.new(self, pre + text.to_s, &block)
49
49
  end
@@ -25,8 +25,8 @@ module Sapphire
25
25
  def add_given(given)
26
26
  if(self.value.is_a? Pending)
27
27
  @givens << Given.new(self, "", Pending.new(given.text), &block)
28
- elsif(self.value.is_a? Problematic)
29
- @givens << Given.new(self, "", Problematic.new(given.text), &block)
28
+ elsif(self.value.is_a? Broken)
29
+ @givens << Given.new(self, "", Broken.new(given.text), &block)
30
30
  else
31
31
  @givens << given
32
32
  end
@@ -39,8 +39,8 @@ module Sapphire
39
39
  def add_background(background)
40
40
  if(self.value.is_a? Pending)
41
41
  @backgrounds << Background.new(self, "", Pending.new(background.text), &block)
42
- elsif(self.value.is_a? Problematic)
43
- @backgrounds << Background.new(self, "", Problematic.new(background.text), &block)
42
+ elsif(self.value.is_a? Broken)
43
+ @backgrounds << Background.new(self, "", Broken.new(background.text), &block)
44
44
  else
45
45
  @backgrounds << background
46
46
  end
@@ -20,8 +20,8 @@ class Then
20
20
  def add_and(pre, text, &block)
21
21
  if(self.value.instance_of? Pending or text.is_a? Pending)
22
22
  self.and << And.new(self, Pending.new(pre + text.to_s), &block)
23
- elsif(self.value.instance_of? Problematic)
24
- self.and << And.new(self, Problematic.new(pre + text), &block)
23
+ elsif(self.value.instance_of? Broken)
24
+ self.and << And.new(self, Broken.new(pre + text), &block)
25
25
  else
26
26
  x = And.new(self, pre + text.to_s, &block)
27
27
  self.and << x
@@ -22,8 +22,8 @@ class When
22
22
  def add_then(pre, text, &block)
23
23
  if(self.value.is_a? Pending or text.is_a? Pending)
24
24
  @then << Then.new(self, pre, Pending.new(text.to_s), &block)
25
- elsif(self.value.is_a? Problematic)
26
- @then << Then.new(self, pre, Problematic.new(text), &block)
25
+ elsif(self.value.is_a? Broken)
26
+ @then << Then.new(self, pre, Broken.new(text), &block)
27
27
  else
28
28
  @then << Then.new(self, pre, text, &block)
29
29
  end
@@ -32,8 +32,8 @@ class When
32
32
  def add_and(pre, text, &block)
33
33
  if(self.value.is_a? Pending or text.is_a? Pending)
34
34
  self.and << And.new(self, Pending.new(pre + text.to_s), &block)
35
- elsif(self.value.is_a? Problematic)
36
- self.and << And.new(self, Problematic.new(pre + text), &block)
35
+ elsif(self.value.is_a? Broken)
36
+ self.and << And.new(self, Broken.new(pre + text), &block)
37
37
  else
38
38
  self.and << And.new(self, pre + text.to_s, &block)
39
39
  end
@@ -150,8 +150,8 @@ module Sapphire
150
150
  log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
151
151
  end
152
152
 
153
- def TestProblematic(test)
154
- log(@message_factory.create_test_ignored(test.text, "Problematic"))
153
+ def TestBroken(test)
154
+ log(@message_factory.create_test_ignored(test.text, "Broken"))
155
155
  log(@message_factory.create_suite_finished("Finally")) if test.item.is_a? Finally
156
156
  end
157
157
 
@@ -7,7 +7,7 @@ module Sapphire
7
7
  @passing_count = 0
8
8
  @failing_count = 0
9
9
  @pending_count = 0
10
- @problematic_count = 0
10
+ @broken_count = 0
11
11
  @test_count = 0
12
12
  @output = $stdout
13
13
  end
@@ -35,10 +35,10 @@ module Sapphire
35
35
  @output.puts result.text
36
36
  Indent(depth+1)
37
37
  @output.puts " ## Not Yet Implemented ##"
38
- elsif result.type == 'problematic'
38
+ elsif result.type == 'broken'
39
39
  @output.puts result.text
40
40
  Indent(depth+1)
41
- @output.puts " ## Problematic ##"
41
+ @output.puts " ## Broken ##"
42
42
  else
43
43
  @output.puts result.text
44
44
  if result.messages.is_a? Array
@@ -87,11 +87,10 @@ module Sapphire
87
87
  @output.print "*"
88
88
  end
89
89
 
90
- def TestProblematic(test)
91
- @problematic_count = @problematic_count + 1
90
+ def TestBroken(test)
91
+ @broken_count = @broken_count + 1
92
92
  Add test
93
- #look of disapproval
94
- @output.print "\u0CA0_\u0CA0"
93
+ @output.print "B"
95
94
  end
96
95
 
97
96
  def Add(r)
@@ -127,7 +126,7 @@ module Sapphire
127
126
  @output.puts "Passing: " + @passing_count.to_s
128
127
  @output.puts "Failing: " + @failing_count.to_s
129
128
  @output.puts "Pending: " + @pending_count.to_s
130
- @output.puts "Problematic: " + @problematic_count.to_s
129
+ @output.puts "Broken: " + @broken_count.to_s
131
130
  end
132
131
 
133
132
  def Output(result, depth)
@@ -29,10 +29,10 @@ module Sapphire
29
29
  stack = msg.backtrace
30
30
  message = msg.messages if (msg.is_a? ExpectationException)
31
31
  message ||= msg.message
32
- if(self.value.is_a? Problematic)
33
- result = ResultTree.new(self.text, TestResult.new("problematic", self, message, stack, Time.now - start))
32
+ if(self.value.is_a? Broken)
33
+ result = ResultTree.new(self.text, TestResult.new("broken", self, message, stack, Time.now - start))
34
34
  self.AddResult(result)
35
- Report do |x| x.TestProblematic(result) end
35
+ Report do |x| x.TestBroken(result) end
36
36
  else
37
37
  result = ResultTree.new(self.text, TestResult.new("fail", self, message, stack, Time.now - start))
38
38
  self.AddResult(result)
@@ -8,7 +8,7 @@ module Sapphire
8
8
  @passing_count = 0
9
9
  @failing_count = 0
10
10
  @pending_count = 0
11
- @problematic_count = 0
11
+ @broken_count = 0
12
12
  @test_count = 0
13
13
  @output = $stdout
14
14
  end
@@ -59,10 +59,10 @@ module Sapphire
59
59
  @output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{test.text} (PENDING: ### Not Yet Implemented ###)</span></dd>"
60
60
  end
61
61
 
62
- def TestProblematic(test)
62
+ def TestBroken(test)
63
63
  @output.puts " <script type=\"text/javascript\">makeOrange('rspec-header');</script>" unless @header_red
64
64
  @output.puts " <script type=\"text/javascript\">makeOrange('example_group_#{@example_group_number}');</script>" unless @example_group_red
65
- @output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{test.text} (PROBLEMATIC: ### Problematic ###)</span></dd>"
65
+ @output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{test.text} (BROKEN: ### Broken ###)</span></dd>"
66
66
  end
67
67
 
68
68
  def TestingComplete
@@ -70,7 +70,7 @@ module Sapphire
70
70
 
71
71
  totals = "#{@test_count} example#{'s' unless @test_count == 1}, #{@failure_count} failure#{'s' unless @failure_count == 1}"
72
72
  totals << ", #{@pending_count} pending" if @pending_count > 0
73
- totals << ", #{@problematic_count} problematic" if @problematic_count > 0
73
+ totals << ", #{@broken_count} broken" if @broken_count > 0
74
74
 
75
75
  @output.puts "<script type=\"text/javascript\">document.getElementById('duration').innerHTML = \"Finished in <strong>#{(@end - @start).round(2).to_s} seconds</strong>\";</script>"
76
76
  @output.puts "<script type=\"text/javascript\">document.getElementById('totals').innerHTML = \"#{totals}\";</script>"
@@ -6,7 +6,7 @@ module Sapphire
6
6
  attr_reader :passing_count
7
7
  attr_reader :failing_count
8
8
  attr_reader :pending_count
9
- attr_reader :problematic_count
9
+ attr_reader :broken_count
10
10
  attr_reader :time
11
11
 
12
12
  end
@@ -12,7 +12,10 @@ module Sapphire
12
12
  self.Clear
13
13
  else
14
14
  textarea = self.Find
15
- textarea.clear
15
+ readonly = textarea.attribute("readonly")
16
+ if readonly == "false"
17
+ textarea.clear
18
+ end
16
19
  textarea.send_keys value
17
20
  end
18
21
  end
@@ -17,7 +17,10 @@ module Sapphire
17
17
  self.Clear
18
18
  else
19
19
  textBox = self.Find
20
- textBox.clear
20
+ readonly = textBox.attribute("readonly")
21
+ if readonly == "false"
22
+ textBox.clear
23
+ end
21
24
  textBox.send_keys value
22
25
  end
23
26
  end
@@ -1,3 +1,3 @@
1
1
  module Sapphire
2
- VERSION = "0.7.5"
2
+ VERSION = "0.7.6"
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.5
4
+ version: 0.7.6
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-03-01 00:00:00.000000000Z
12
+ date: 2012-03-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
16
- requirement: &9784764 !ruby/object:Gem::Requirement
16
+ requirement: &9795012 !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: *9784764
24
+ version_requirements: *9795012
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: colorize
27
- requirement: &9784512 !ruby/object:Gem::Requirement
27
+ requirement: &9794760 !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: *9784512
35
+ version_requirements: *9794760
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: Platform
38
- requirement: &9784260 !ruby/object:Gem::Requirement
38
+ requirement: &9794508 !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: *9784260
46
+ version_requirements: *9794508
47
47
  description: An automated web acceptance test framework for non-technical resources
48
48
  using selenium-wedriver.
49
49
  email:
@@ -137,12 +137,12 @@ files:
137
137
  - lib/sapphire/DSL/Events/Expect.rb
138
138
  - lib/sapphire/DSL/Scenarios/and.rb
139
139
  - lib/sapphire/DSL/Scenarios/background.rb
140
+ - lib/sapphire/DSL/Scenarios/Broken.rb
140
141
  - lib/sapphire/DSL/Scenarios/dsl.rb
141
142
  - lib/sapphire/DSL/Scenarios/finally.rb
142
143
  - lib/sapphire/DSL/Scenarios/given.rb
143
144
  - lib/sapphire/DSL/Scenarios/Is.rb
144
145
  - lib/sapphire/DSL/Scenarios/Pending.rb
145
- - lib/sapphire/DSL/Scenarios/Problematic.rb
146
146
  - lib/sapphire/DSL/Scenarios/runner.rb
147
147
  - lib/sapphire/DSL/Scenarios/scenario.rb
148
148
  - lib/sapphire/DSL/Scenarios/then.rb