Commit 52dab7a1fc65ac7c762d76f9677eeea00886b882

Authored by selurvedu
1 parent e2f23a58

Fix broken awaiting for dates

... ... @@ -275,10 +275,15 @@ SwitchState
275 275 # HACK: tender_owner's initial_data.
276 276 # HACK: This should be cleaned up as soon as each broker implements reading
277 277 # HACK: of the needed dates from tender's page.
278   - Run Keyword And Ignore Error
279   - ... ${date}= ${USERS.users['${username}'].tender_data.data.tenderPeriod.startDate}
280   - Run Keyword Unless ${date}
281   - ... ${date}= ${USERS.users['${tender_owner}'].initial_data.data.tenderPeriod.startDate}
  278 + ${status} ${date}= Run Keyword And Ignore Error
  279 + ... Set Variable
  280 + ... ${USERS.users['${username}'].tender_data.data.tenderPeriod.startDate}
  281 + # By default if condition is not satisfied, variable is set to None.
  282 + # The third argument sets the variable to itself instead of None.
  283 + ${date}= Set Variable If
  284 + ... '${status}' == 'FAIL'
  285 + ... ${USERS.users['${tender_owner}'].initial_data.data.tenderPeriod.startDate}
  286 + ... ${date}
282 287 Дочекатись дати ${date}
283 288
284 289
... ... @@ -286,10 +291,13 @@ SwitchState
286 291 [Arguments] ${username}
287 292 Log ${username}
288 293 # XXX: HACK: Same as above
289   - Run Keyword And Ignore Error
290   - ... ${date}= ${USERS.users['${username}'].tender_data.data.tenderPeriod.endDate}
291   - Run Keyword Unless ${date}
292   - ... ${date}= ${USERS.users['${tender_owner}'].initial_data.data.tenderPeriod.endDate}
  294 + ${status} ${date}= Run Keyword And Ignore Error
  295 + ... Set Variable
  296 + ... ${USERS.users['${username}'].tender_data.data.tenderPeriod.endDate}
  297 + ${date}= Set Variable If
  298 + ... '${status}' == 'FAIL'
  299 + ... ${USERS.users['${tender_owner}'].initial_data.data.tenderPeriod.endDate}
  300 + ... ${date}
293 301 Дочекатись дати ${date}
294 302
295 303
... ...
Please register or login to post a comment