Commit 431fe84e9deafa9151a959e03ba2324202b4e613
1 parent
8441602f
added switch if keyword should fail
Showing
1 changed file
with
32 additions
and
3 deletions
... | ... | @@ -9,9 +9,7 @@ Library Selenium2Screenshots |
9 | 9 | Library DebugLibrary |
10 | 10 | Library op_robot_tests.tests_files.brokers.openprocurement_client_helper |
11 | 11 | *** Variables *** |
12 | -${tender_dump_id} 0 | |
13 | -${LOAD_BROKERS} ['Quinta', 'E-tender'] | |
14 | -${LOAD_USERS} ['E-tender Viewer', 'Tender Viewer', 'Tender User', 'Tender Owner'] | |
12 | + | |
15 | 13 | |
16 | 14 | *** Keywords *** |
17 | 15 | TestCaseSetup |
... | ... | @@ -102,6 +100,12 @@ TestCaseSetup |
102 | 100 | ${field_value}= Get_From_Object ${TENDER_DATA.data} ${field} |
103 | 101 | Should Be Equal ${field_value} ${field_response} Майданчик ${USERS.users['${username}'].broker} |
104 | 102 | |
103 | +Звірити поле створеного тендера | |
104 | + [Arguments] ${initial} ${tender_data} ${field} | |
105 | + ${field_value}= Get_From_Object ${initial} ${field} | |
106 | + ${field_response}= Get_From_Object ${tender_data} ${field} | |
107 | + Should Be Equal ${field_value} ${field_response} | |
108 | + | |
105 | 109 | Звірити дату |
106 | 110 | [Arguments] ${username} ${field} |
107 | 111 | ${field_date}= Викликати для учасника ${username} отримати інформацію із тендера ${field} |
... | ... | @@ -119,11 +123,36 @@ TestCaseSetup |
119 | 123 | |
120 | 124 | |
121 | 125 | Викликати для учасника |
126 | + [Documentation] | |
127 | + ... cause sometimes keyword SHOULD fail to pass the testcase, this keyword takes "shouldfail" argument as first one in @{arguments} and switches the behaviour of keyword and "shouldfail" | |
122 | 128 | [Arguments] ${username} ${command} @{arguments} |
129 | + log ${username} | |
130 | + log ${command} | |
131 | + log ${arguments} | |
132 | + ${state}= change_state ${arguments} | |
133 | + ${value}= Run keyword if '${state}' == 'shouldfail' switchsate ${username} ${command} @{arguments} | |
134 | + ${value}= Run keyword if '${state}' == 'pass' normal ${username} ${command} @{arguments} | |
135 | + [return] ${value} | |
136 | + | |
137 | +normal | |
138 | + [Arguments] ${username} ${command} @{arguments} | |
139 | + log ${username} | |
140 | + log ${command} | |
141 | + log ${arguments} | |
123 | 142 | ${status} ${value}= run_keyword_and_ignore_keyword_definations ${BROKERS['${USERS.users['${username}'].broker}'].keywords_file}.${command} ${username} @{arguments} |
124 | 143 | Run keyword if '${status}' == 'FAIL' Log Учасник ${username} не зміг виконати "${command}" WARN |
125 | 144 | [return] ${value} |
126 | 145 | |
146 | +switchsate | |
147 | + [Arguments] ${username} ${command} @{arguments} | |
148 | + log ${username} | |
149 | + log ${command} | |
150 | + log ${arguments} | |
151 | + Remove From List ${arguments} 0 | |
152 | + log ${arguments} | |
153 | + ${status} ${value}= run_keyword_and_ignore_keyword_definations ${BROKERS['${USERS.users['${username}'].broker}'].keywords_file}.${command} ${username} @{arguments} | |
154 | + Run keyword if '${status}' == 'PASS' Log Учасник ${username} зміг виконати "${command}" WARN | |
155 | + [return] ${value} | |
127 | 156 | |
128 | 157 | Дочекатись дати |
129 | 158 | [Arguments] ${date} | ... | ... |
Please
register
or
login
to post a comment