@@ -120,7 +120,6 @@ class Page(_BaseActions, _SelectorsManager, _ComponentsManager):
120
120
"""
121
121
__metaclass__ = _PageMeta
122
122
123
-
124
123
def __init__ (self ):
125
124
"""
126
125
Initializes the pageobject_name variable, which is used by the _Keywords class
@@ -144,7 +143,12 @@ def __init__(self):
144
143
@staticmethod
145
144
@not_keyword
146
145
def _titleize (str ):
147
- return re .sub (r"(\w)([A-Z])" , r"\1 \2" , str )
146
+ """
147
+ Converts camel case to title case
148
+ :param str: camel case string
149
+ :return: title case string
150
+ """
151
+ return re .sub ('([a-z0-9])([A-Z])' , r'\1 \2' , re .sub (r"(.)([A-Z][a-z]+)" , r'\1 \2' , str ))
148
152
149
153
@staticmethod
150
154
@not_keyword
@@ -271,16 +275,18 @@ def get_keyword_documentation(self, kwname):
271
275
:return: a documentation string for kwname
272
276
"""
273
277
if kwname == '__intro__' :
274
- doc = """\n
278
+ docstring = self .__doc__ if self .__doc__ else ''
279
+ s2l_link = """\n
275
280
All keywords listed in the Selenium2Library documentation are also available in this Page Object.
276
281
See http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html
277
282
"""
278
- return self . __doc__ + doc
283
+ return docstring + s2l_link
279
284
kw = getattr (self , kwname , None )
280
- doc = kw . __doc__ if kw . __doc__ else ''
285
+ alias = ''
281
286
if kwname in _Keywords ._aliases :
282
- doc = '*Alias: %s*\n \n ' % _Keywords .get_robot_aliases (kwname , self ._underscore (self .name ))[0 ].replace ('_' , ' ' ).title () + doc
283
- return doc
287
+ alias = '*Alias: %s*\n \n ' % _Keywords .get_robot_aliases (kwname , self ._underscore (self .name ))[0 ].replace ('_' , ' ' ).title ()
288
+ docstring = kw .__doc__ if kw .__doc__ else ''
289
+ return alias + docstring
284
290
285
291
@not_keyword
286
292
def get_keyword_arguments (self , kwname ):
0 commit comments