Robot Framework Integrated Development Environment (RIDE)
testexecutionresults.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 from ..publish.messages import (RideTestExecutionStarted, RideTestPaused, RideTestPassed, RideTestFailed,
17  RideTestRunning, RideTestSkipped, RideTestStopped)
18 
19 
21  RUNNING = 'Running'
22  STOPPED = 'Stopped'
23  PASSED = 'Passed'
24  FAILED = 'Failed'
25  PAUSED = 'Paused'
26  SKIPPED = 'Skipped'
27 
28  def __init__(self):
29  self.clearclear()
30 
32  self.clearclear()
33  RideTestExecutionStarted(results=self).publish()
34 
35  def clear(self):
36  self._results_results = {}
37 
38  def set_running(self, test):
39  self._results_results[test] = self.RUNNINGRUNNING
40  RideTestRunning(item=test).publish()
41 
42  def set_stopped(self, test):
43  if test:
44  self._results_results[test] = self.STOPPEDSTOPPED
45  RideTestStopped(item=test).publish()
46 
47  def set_passed(self, test):
48  self._results_results[test] = self.PASSEDPASSED
49  RideTestPassed(item=test).publish()
50 
51  def set_failed(self, test):
52  self._results_results[test] = self.FAILEDFAILED
53  RideTestFailed(item=test).publish()
54 
55  def set_paused(self, test):
56  self._results_results[test] = self.PAUSEDPAUSED
57  RideTestPaused(item=test).publish()
58 
59  def set_skipped(self, test):
60  self._results_results[test] = self.SKIPPEDSKIPPED
61  RideTestSkipped(item=test).publish()
62 
63  def is_running(self, test):
64  return test in self._results_results and self._results_results[test] == self.RUNNINGRUNNING
65 
66  def is_paused(self, test):
67  return test in self._results_results and self._results_results[test] == self.PAUSEDPAUSED
68 
69  def has_passed(self, test):
70  return test in self._results_results and self._results_results[test] == self.PASSEDPASSED
71 
72  def has_failed(self, test):
73  return test in self._results_results and self._results_results[test] == self.FAILEDFAILED
74 
75  def has_skipped(self, test):
76  return test in self._results_results and self._results_results[test] == self.SKIPPEDSKIPPED
77 
Sent whenever new test execution is started.
Definition: messages.py:192
Sent whenever RIDE has executed a test case, and it failed.
Definition: messages.py:217
Sent whenever RIDE has executed a test case, and it passed.
Definition: messages.py:212
Sent whenever RIDE is running a test case and paused.
Definition: messages.py:207
Sent whenever RIDE is starting to run a test case.
Definition: messages.py:202
Sent whenever RIDE has executed a test case, and it was skipped.
Definition: messages.py:222
Sent whenever RIDE was executing a test case, and it was stopped or aborted.
Definition: messages.py:227