Robot Framework
visitor.py
Go to the documentation of this file.
1 # Copyright 2008-2015 Nokia Networks
2 # Copyright 2016- Robot Framework Foundation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 
16 
23 
24 from robot.model import SuiteVisitor
25 
26 
27 
42  def visit_result(self, result):
43  if self.start_resultstart_result(result) is not False:
44  result.suite.visit(self)
45  result.statistics.visit(self)
46  result.errors.visit(self)
47  self.end_resultend_result(result)
48 
49  def start_result(self, result):
50  pass
51 
52  def end_result(self, result):
53  pass
54 
55  def visit_statistics(self, stats):
56  if self.start_statistics(stats) is not False:
57  stats.total.visit(self)
58  stats.tags.visit(self)
59  stats.suite.visit(self)
60  self.end_statistics(stats)
61 
62  def start_statistics(self, stats):
63  pass
64 
65  def end_statistics(self, stats):
66  pass
67 
68  def visit_total_statistics(self, stats):
69  if self.start_total_statistics(stats) is not False:
70  stats.visit(self)
71  self.end_total_statistics(stats)
72 
73  def start_total_statistics(self, stats):
74  pass
75 
76  def end_total_statistics(self, stats):
77  pass
78 
79  def visit_tag_statistics(self, stats):
80  if self.start_tag_statistics(stats) is not False:
81  for stat in stats:
82  stat.visit(self)
83  self.end_tag_statistics(stats)
84 
85  def start_tag_statistics(self, stats):
86  pass
87 
88  def end_tag_statistics(self, stats):
89  pass
90 
91  def visit_suite_statistics(self, stats):
92  if self.start_suite_statistics(stats) is not False:
93  for stat in stats:
94  stat.visit(self)
95  self.end_suite_statistics(stats)
96 
97  def start_suite_statistics(self, stats):
98  pass
99 
100  def end_suite_statistics(self, suite_stats):
101  pass
102 
103  def visit_stat(self, stat):
104  if self.start_stat(stat) is not False:
105  self.end_stat(stat)
106 
107  def start_stat(self, stat):
108  pass
109 
110  def end_stat(self, stat):
111  pass
112 
113  def visit_errors(self, errors):
114  self.start_errors(errors)
115  for msg in errors:
116  msg.visit(self)
117  self.end_errors(errors)
118 
119  def start_errors(self, errors):
120  pass
121 
122  def end_errors(self, errors):
123  pass
Interface to ease traversing through a test suite structure.
Definition: visitor.py:85
Abstract class to conveniently travel :class:~robot.result.executionresult.Result objects.
Definition: visitor.py:41
def end_errors(self, errors)
Definition: visitor.py:122
def end_result(self, result)
Definition: visitor.py:52
def visit_total_statistics(self, stats)
Definition: visitor.py:68
def visit_errors(self, errors)
Definition: visitor.py:113
def visit_statistics(self, stats)
Definition: visitor.py:55
def visit_result(self, result)
Definition: visitor.py:42
def start_result(self, result)
Definition: visitor.py:49
def end_total_statistics(self, stats)
Definition: visitor.py:76
def visit_suite_statistics(self, stats)
Definition: visitor.py:91
def end_suite_statistics(self, suite_stats)
Definition: visitor.py:100
def start_errors(self, errors)
Definition: visitor.py:119
def start_tag_statistics(self, stats)
Definition: visitor.py:85
def start_suite_statistics(self, stats)
Definition: visitor.py:97
def start_statistics(self, stats)
Definition: visitor.py:62
def start_total_statistics(self, stats)
Definition: visitor.py:73
def end_statistics(self, stats)
Definition: visitor.py:65
def visit_tag_statistics(self, stats)
Definition: visitor.py:79
def end_tag_statistics(self, stats)
Definition: visitor.py:88