Robot Framework SeleniumLibrary
scope_event.py
Go to the documentation of this file.
1
# Copyright 2008-2011 Nokia Networks
2
# Copyright 2011-2016 Ryan Tomac, Ed Manlove and contributors
3
# Copyright 2016- Robot Framework Foundation
4
#
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
# you may not use this file except in compliance with the License.
7
# You may obtain a copy of the License at
8
#
9
# http://www.apache.org/licenses/LICENSE-2.0
10
#
11
# Unless required by applicable law or agreed to in writing, software
12
# distributed under the License is distributed on an "AS IS" BASIS,
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
# See the License for the specific language governing permissions and
15
# limitations under the License.
16
17
from
robot.libraries.BuiltIn
import
BuiltIn
18
19
from
.event
import
Event
20
21
22
class
ScopeEvent
(
Event
):
23
24
def
__init__
(self, scope, action, *args, **kwargs):
25
self.
scope
scope = scope
26
self.
action
action = action
27
self.
action_args
action_args = args
28
self.
action_kwargs
action_kwargs = kwargs
29
30
if
scope ==
'current'
:
31
suite = BuiltIn().get_variable_value(
'${SUITE NAME}'
)
32
test = BuiltIn().get_variable_value(
'${TEST NAME}'
,
''
)
33
self.
scope
scope = suite +
'.'
+ test
if
test !=
''
else
suite
34
35
def
trigger
(self, *args, **kwargs):
36
if
args[0] == self.
scope
scope:
37
self.
action
action(*self.
action_args
action_args, **self.
action_kwargs
action_kwargs)
38
39
40
class
ScopeStart
(
ScopeEvent
):
41
name =
'scope_start'
42
43
44
class
ScopeEnd
(
ScopeEvent
):
45
name =
'scope_end'
SeleniumLibrary.utils.events.event.Event
Definition:
event.py:20
SeleniumLibrary.utils.events.scope_event.ScopeEnd
Definition:
scope_event.py:44
SeleniumLibrary.utils.events.scope_event.ScopeEvent
Definition:
scope_event.py:22
SeleniumLibrary.utils.events.scope_event.ScopeEvent.trigger
def trigger(self, *args, **kwargs)
Definition:
scope_event.py:35
SeleniumLibrary.utils.events.scope_event.ScopeEvent.action_kwargs
action_kwargs
Definition:
scope_event.py:28
SeleniumLibrary.utils.events.scope_event.ScopeEvent.__init__
def __init__(self, scope, action, *args, **kwargs)
Definition:
scope_event.py:24
SeleniumLibrary.utils.events.scope_event.ScopeEvent.action
action
Definition:
scope_event.py:26
SeleniumLibrary.utils.events.scope_event.ScopeEvent.action_args
action_args
Definition:
scope_event.py:27
SeleniumLibrary.utils.events.scope_event.ScopeEvent.scope
scope
Definition:
scope_event.py:25
SeleniumLibrary.utils.events.scope_event.ScopeStart
Definition:
scope_event.py:40
src
SeleniumLibrary
utils
events
scope_event.py
Generated by
1.9.1