Robot Framework Integrated Development Environment (RIDE)
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 
68 
69 
70 
75 class SuiteVisitor():
76 
77 
83  def visit_suite(self, suite):
84  if self.start_suitestart_suite(suite) is not False:
85  suite.keywords.visit(self)
86  suite.suites.visit(self)
87  suite.tests.visit(self)
88  self.end_suiteend_suite(suite)
89 
90 
94  def start_suite(self, suite):
95  pass
96 
97 
98  def end_suite(self, suite):
99  pass
100 
101 
106  def visit_test(self, test):
107  if self.start_teststart_test(test) is not False:
108  test.keywords.visit(self)
109  self.end_testend_test(test)
110 
111 
115  def start_test(self, test):
116  pass
117 
118 
119  def end_test(self, test):
120  pass
121 
122 
128  def visit_keyword(self, kw):
129  if self.start_keywordstart_keyword(kw) is not False:
130  kw.keywords.visit(self)
131  kw.messages.visit(self)
132  self.end_keywordend_keyword(kw)
133 
134 
138  def start_keyword(self, keyword):
139  pass
140 
141 
142  def end_keyword(self, keyword):
143  pass
144 
145 
150  def visit_message(self, msg):
151  if self.start_messagestart_message(msg) is not False:
152  self.end_messageend_message(msg)
153 
154 
158  def start_message(self, msg):
159  pass
160 
161 
162  def end_message(self, msg):
163  pass
Interface to ease traversing through a test suite structure.
Definition: visitor.py:75
def end_message(self, msg)
Called when message ends.
Definition: visitor.py:162
def start_test(self, test)
Called when test starts.
Definition: visitor.py:115
def end_keyword(self, keyword)
Called when keyword ends.
Definition: visitor.py:142
def visit_message(self, msg)
Implements visiting the message.
Definition: visitor.py:150
def visit_test(self, test)
Implements traversing through the test and its keywords.
Definition: visitor.py:106
def start_suite(self, suite)
Called when suite starts.
Definition: visitor.py:94
def end_test(self, test)
Called when test ends.
Definition: visitor.py:119
def end_suite(self, suite)
Called when suite ends.
Definition: visitor.py:98
def visit_suite(self, suite)
Implements traversing through the suite and its direct children.
Definition: visitor.py:83
def start_keyword(self, keyword)
Called when keyword starts.
Definition: visitor.py:138
def visit_keyword(self, kw)
Implements traversing through the keyword and its child keywords.
Definition: visitor.py:128
def start_message(self, msg)
Called when message starts.
Definition: visitor.py:158