Commit 8a97cfdaf966cf2ebdc80e97ed15b52dacfe56ff

Authored by selurvedu
1 parent 7e18eb4e

Update and rename `Викликати для учасника`

Also:
 * Added new documentation.
 * Removed the function which is not used anymore.

Backward compatibility was partly saved:
 * The former name is now deprecated.
   You still can use it, but that is discouraged.
 * `Run As` always expects success,
   `shouldfail` no longer works.
@@ -12,6 +12,7 @@ Documentation @@ -12,6 +12,7 @@ Documentation
12 12
13 *** Keywords *** 13 *** Keywords ***
14 Test Suite Setup 14 Test Suite Setup
  15 + Set Suite Variable ${WARN_RUN_AS} ${False}
15 Set Selenium Implicit Wait 5 s 16 Set Selenium Implicit Wait 5 s
16 Set Selenium Timeout 10 s 17 Set Selenium Timeout 10 s
17 Завантажуємо дані про користувачів і майданчики 18 Завантажуємо дані про користувачів і майданчики
@@ -289,21 +290,24 @@ Get Broker Property By Username @@ -289,21 +290,24 @@ Get Broker Property By Username
289 290
290 291
291 Викликати для учасника 292 Викликати для учасника
292 - [Documentation]  
293 - ... Cause sometimes keyword SHOULD fail to pass the testcase,  
294 - ... this keyword takes "shouldfail" argument as first one in @{arguments}  
295 - ... and switches the behaviour of keyword and "shouldfail"  
296 [Arguments] ${username} ${command} @{arguments} 293 [Arguments] ${username} ${command} @{arguments}
297 - Log ${username}  
298 - Log ${command}  
299 - Log Many @{arguments}  
300 - ${state}= change_state ${arguments}  
301 - Run Keyword And Return If '${state}' == 'shouldfail' SwitchState ${username} ${command} @{arguments}  
302 - Run Keyword And Return If '${state}' == 'pass' Normal ${username} ${command} @{arguments} 294 + Run keyword unless '${WARN_RUN_AS}' == '${True}'
  295 + ... Run keywords
  296 + ...
  297 + ... Set Suite Variable ${WARN_RUN_AS} ${True}
  298 + ...
  299 + ... AND
  300 + ...
  301 + ... Log Keyword 'Викликати для учасника' is deprecated. Please use 'Run As' and 'Require Failure' instead.
  302 + ... WARN
  303 + Run Keyword And Return Run As ${username} ${command} @{arguments}
303 304
304 305
305 -Normal 306 +Run As
306 [Arguments] ${username} ${command} @{arguments} 307 [Arguments] ${username} ${command} @{arguments}
  308 + [Documentation]
  309 + ... Run the given keyword (``command``) with given ``arguments``
  310 + ... using driver (keyword library) of user ``username``.
307 Log ${username} 311 Log ${username}
308 Log ${command} 312 Log ${command}
309 Log Many @{arguments} 313 Log Many @{arguments}
@@ -70,15 +70,6 @@ def get_file_contents(path): @@ -70,15 +70,6 @@ def get_file_contents(path):
70 return unicode(f.read()) or u'' 70 return unicode(f.read()) or u''
71 71
72 72
73 -def change_state(arguments):  
74 - try:  
75 - if arguments[0] == "shouldfail":  
76 - return "shouldfail"  
77 - return "pass"  
78 - except IndexError:  
79 - return "pass"  
80 -  
81 -  
82 def compare_date(date1, date2, accuracy): 73 def compare_date(date1, date2, accuracy):
83 date1 = parse(date1) 74 date1 = parse(date1)
84 date2 = parse(date2) 75 date2 = parse(date2)
Please register or login to post a comment