Showing
8 changed files
with
100 additions
and
105 deletions
... | ... | @@ -25,30 +25,30 @@ ${locator.tenderId} jquery=h3 |
25 | 25 | [Arguments] @{ARGUMENTS} |
26 | 26 | [Documentation] |
27 | 27 | ... ${ARGUMENTS[0]} == username |
28 | - ... ${ARGUMENTS[1]} == tender_data | |
29 | - ${tender_data}= Add_time_for_GUI_FrontEnds ${ARGUMENTS[1]} | |
30 | - ${items}= Get From Dictionary ${tender_data.data} items | |
31 | - ${title}= Get From Dictionary ${tender_data.data} title | |
32 | - ${description}= Get From Dictionary ${tender_data.data} description | |
33 | - ${budget}= Get From Dictionary ${tender_data.data.value} amount | |
34 | - ${step_rate}= Get From Dictionary ${tender_data.data.minimalStep} amount | |
35 | - ${items_description}= Get From Dictionary ${tender_data.data} description | |
28 | + ... ${ARGUMENTS[1]} == initial_tender_data | |
29 | + ${prepared_tender_data}= Add_data_for_GUI_FrontEnds ${ARGUMENTS[1]} | |
30 | + ${items}= Get From Dictionary ${prepared_tender_data.data} items | |
31 | + ${title}= Get From Dictionary ${prepared_tender_data.data} title | |
32 | + ${description}= Get From Dictionary ${prepared_tender_data.data} description | |
33 | + ${budget}= Get From Dictionary ${prepared_tender_data.data.value} amount | |
34 | + ${step_rate}= Get From Dictionary ${prepared_tender_data.data.minimalStep} amount | |
35 | + ${items_description}= Get From Dictionary ${prepared_tender_data.data} description | |
36 | 36 | ${quantity}= Get From Dictionary ${items[0]} quantity |
37 | 37 | ${cpv}= Get From Dictionary ${items[0].classification} id |
38 | 38 | ${dkpp_desc}= Get From Dictionary ${items[0].additionalClassifications[0]} description |
39 | 39 | ${dkpp_id}= Get From Dictionary ${items[0].additionalClassifications[0]} id |
40 | 40 | ${unit}= Get From Dictionary ${items[0].unit} name |
41 | - ${start_date}= Get From Dictionary ${tender_data.data.tenderPeriod} startDate | |
41 | + ${start_date}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} startDate | |
42 | 42 | ${start_date}= convert_date_to_etender_format ${start_date} |
43 | - ${start_time}= Get From Dictionary ${tender_data.data.tenderPeriod} startDate | |
43 | + ${start_time}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} startDate | |
44 | 44 | ${start_time}= convert_time_to_etender_format ${start_time} |
45 | - ${end_date}= Get From Dictionary ${tender_data.data.tenderPeriod} endDate | |
45 | + ${end_date}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} endDate | |
46 | 46 | ${end_date}= convert_date_to_etender_format ${end_date} |
47 | - ${end_time}= Get From Dictionary ${tender_data.data.tenderPeriod} endDate | |
47 | + ${end_time}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} endDate | |
48 | 48 | ${end_time}= convert_time_to_etender_format ${end_time} |
49 | - ${enquiry_end_date}= Get From Dictionary ${tender_data.data.enquiryPeriod} endDate | |
49 | + ${enquiry_end_date}= Get From Dictionary ${prepared_tender_data.data.enquiryPeriod} endDate | |
50 | 50 | ${enquiry_end_date}= convert_date_to_etender_format ${enquiry_end_date} |
51 | - ${enquiry_end_time}= Get From Dictionary ${tender_data.data.enquiryPeriod} endDate | |
51 | + ${enquiry_end_time}= Get From Dictionary ${prepared_tender_data.data.enquiryPeriod} endDate | |
52 | 52 | ${enquiry_end_time}= convert_time_to_etender_format ${enquiry_end_time} |
53 | 53 | Selenium2Library.Switch Browser ${ARGUMENTS[0]} |
54 | 54 | Wait Until Page Contains Мої закупівлі 100 | ... | ... |
... | ... | @@ -41,26 +41,26 @@ Pre Login |
41 | 41 | [Documentation] |
42 | 42 | ... ${ARGUMENTS[0]} == username |
43 | 43 | ... ${ARGUMENTS[1]} == tender_data |
44 | - ${tender_data}= Add_time_for_GUI_FrontEnds ${ARGUMENTS[1]} | |
45 | - ${items}= Get From Dictionary ${tender_data.data} items | |
46 | - ${title}= Get From Dictionary ${tender_data.data} title | |
47 | - ${description}= Get From Dictionary ${tender_data.data} description | |
48 | - ${budget}= Get From Dictionary ${tender_data.data.value} amount | |
49 | - ${step_rate}= Get From Dictionary ${tender_data.data.minimalStep} amount | |
50 | - ${items_description}= Get From Dictionary ${tender_data.data} description | |
44 | + ${prepared_tender_data}= Add_data_for_GUI_FrontEnds ${ARGUMENTS[1]} | |
45 | + ${items}= Get From Dictionary ${prepared_tender_data.data} items | |
46 | + ${title}= Get From Dictionary ${prepared_tender_data.data} title | |
47 | + ${description}= Get From Dictionary ${prepared_tender_data.data} description | |
48 | + ${budget}= Get From Dictionary ${prepared_tender_data.data.value} amount | |
49 | + ${step_rate}= Get From Dictionary ${prepared_tender_data.data.minimalStep} amount | |
50 | + ${items_description}= Get From Dictionary ${prepared_tender_data.data} description | |
51 | 51 | ${quantity}= Get From Dictionary ${items[0]} quantity |
52 | - ${countryName}= Get From Dictionary ${tender_data.data.procuringEntity.address} countryName | |
52 | + ${countryName}= Get From Dictionary ${prepared_tender_data.data.procuringEntity.address} countryName | |
53 | 53 | ${delivery_end_date}= Get From Dictionary ${items[0].deliveryDate} endDate |
54 | 54 | ${delivery_end_date}= convert_date_to_slash_format ${delivery_end_date} |
55 | - ${cpv}= Get From Dictionary ${items[0].classification} description_ua | |
55 | + ${cpv}= Convert To String Картонки | |
56 | 56 | ${cpv_id}= Get From Dictionary ${items[0].classification} id |
57 | 57 | ${cpv_id1}= Replace String ${cpv_id} - _ |
58 | 58 | ${dkpp_desc}= Get From Dictionary ${items[0].additionalClassifications[0]} description |
59 | 59 | ${dkpp_id}= Get From Dictionary ${items[0].additionalClassifications[0]} id |
60 | 60 | ${dkpp_id1}= Replace String ${dkpp_id} - _ |
61 | - ${enquiry_end_date}= Get From Dictionary ${tender_data.data.enquiryPeriod} endDate | |
61 | + ${enquiry_end_date}= Get From Dictionary ${prepared_tender_data.data.enquiryPeriod} endDate | |
62 | 62 | ${enquiry_end_date}= convert_date_to_slash_format ${enquiry_end_date} |
63 | - ${end_date}= Get From Dictionary ${tender_data.data.tenderPeriod} endDate | |
63 | + ${end_date}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} endDate | |
64 | 64 | ${end_date}= convert_date_to_slash_format ${end_date} |
65 | 65 | |
66 | 66 | Selenium2Library.Switch Browser ${ARGUMENTS[0]} | ... | ... |
... | ... | @@ -15,7 +15,6 @@ ${locator.tenderId} jquery=h3 |
15 | 15 | [Arguments] @{ARGUMENTS} |
16 | 16 | [Documentation] Відкрити брaвзер, створити обєкт api wrapper, тощо |
17 | 17 | ... ${ARGUMENTS[0]} == username |
18 | - | |
19 | 18 | Open Browser ${BROKERS['${USERS.users['${username}'].broker}'].url} ${USERS.users['${username}'].browser} alias=${ARGUMENTS[0]} |
20 | 19 | Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size} |
21 | 20 | Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position} |
... | ... | @@ -31,18 +30,18 @@ ${locator.tenderId} jquery=h3 |
31 | 30 | [Arguments] @{ARGUMENTS} |
32 | 31 | [Documentation] |
33 | 32 | ... ${ARGUMENTS[0]} == username |
34 | - ... ${ARGUMENTS[1]} == tender_data | |
35 | - | |
33 | + ... ${ARGUMENTS[1]} == initial_tender_data | |
36 | 34 | ## Inicialisation |
37 | - ${items}= Get From Dictionary ${ARGUMENTS[1].data} items | |
38 | - ${title}= Get From Dictionary ${ARGUMENTS[1].data} title | |
39 | - ${description}= Get From Dictionary ${ARGUMENTS[1].data} description | |
40 | - ${budget}= Get From Dictionary ${ARGUMENTS[1].data.value} amount | |
41 | - ${step_rate}= Get From Dictionary ${ARGUMENTS[1].data.minimalStep} amount | |
42 | - ${start_date}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} startDate | |
43 | - ${end_date}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} endDate | |
44 | - ${enquiry_start_date}= Get From Dictionary ${ARGUMENTS[1].data.enquiryPeriod} startDate | |
45 | - ${enquiry_end_date}= Get From Dictionary ${ARGUMENTS[1].data.enquiryPeriod} endDate | |
35 | + ${prepared_tender_data}= Add_data_for_GUI_FrontEnds ${ARGUMENTS[1]} | |
36 | + ${items}= Get From Dictionary ${prepared_tender_data.data} items | |
37 | + ${title}= Get From Dictionary ${prepared_tender_data.data} title | |
38 | + ${description}= Get From Dictionary ${prepared_tender_data.data} description | |
39 | + ${budget}= Get From Dictionary ${prepared_tender_data.data.value} amount | |
40 | + ${step_rate}= Get From Dictionary ${prepared_tender_data.data.minimalStep} amount | |
41 | + ${start_date}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} startDate | |
42 | + ${end_date}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} endDate | |
43 | + ${enquiry_start_date}= Get From Dictionary ${prepared_tender_data.data.enquiryPeriod} startDate | |
44 | + ${enquiry_end_date}= Get From Dictionary ${prepared_tender_data.data.enquiryPeriod} endDate | |
46 | 45 | |
47 | 46 | Selenium2Library.Switch Browser ${ARGUMENTS[0]} |
48 | 47 | Go To ${USERS.users['${username}'].homepage} |
... | ... | @@ -109,7 +108,7 @@ Set datetime |
109 | 108 | ## Get values for item |
110 | 109 | ${items_description}= Get From Dictionary ${ARGUMENTS[0]} description |
111 | 110 | ${quantity}= Get From Dictionary ${ARGUMENTS[0]} quantity |
112 | - ${cpv}= Get From Dictionary ${ARGUMENTS[0].classification} description_ua | |
111 | + ${cpv}= Convert To String Картонки | |
113 | 112 | ${dkpp_desc}= Get From Dictionary ${ARGUMENTS[0].additionalClassifications[0]} description |
114 | 113 | ${dkpp_id}= Get From Dictionary ${ARGUMENTS[0].additionalClassifications[0]} id |
115 | 114 | ${unit}= Get From Dictionary ${ARGUMENTS[0].unit} name |
... | ... | @@ -161,10 +160,6 @@ Set datetime |
161 | 160 | |
162 | 161 | |
163 | 162 | |
164 | - | |
165 | - | |
166 | - | |
167 | - | |
168 | 163 | #### Not reworked for Newtend #### |
169 | 164 | |
170 | 165 | Oтримати internal id по UAid | ... | ... |
... | ... | @@ -9,11 +9,11 @@ ${question_id} 0 |
9 | 9 | *** Keywords *** |
10 | 10 | отримати internal id по UAid |
11 | 11 | [Arguments] @{ARGUMENTS} |
12 | - [Documentation] | |
12 | + [Documentation] | |
13 | 13 | ... ${ARGUMENTS[0]} == username |
14 | 14 | ... ${ARGUMENTS[1]} == tenderid |
15 | 15 | log many @{ARGUMENTS} |
16 | - ${tenders}= get_internal_id ${USERS.users['${ARGUMENTS[0]}'].client.get_tenders} ${USERS.users['${ARGUMENTS[0]}'].creation_date} | |
16 | + ${tenders}= get_internal_id ${USERS.users['${ARGUMENTS[0]}'].client.get_tenders} ${USERS.users['${ARGUMENTS[0]}'].creation_date} | |
17 | 17 | :FOR ${tender} IN @{tenders} |
18 | 18 | \ log ${tender} |
19 | 19 | \ ${internal_id}= Run Keyword And Return If '${tender.tenderID}' == '${ARGUMENTS[1]}' Get Variable Value ${tender.id} |
... | ... | @@ -26,16 +26,16 @@ ${question_id} 0 |
26 | 26 | Підготувати клієнт для користувача |
27 | 27 | [Arguments] @{ARGUMENTS} |
28 | 28 | [Documentation] Відкрити брaвзер, створити обєкт api wrapper, тощо |
29 | - ${api_wrapper}= prepare_api_wrapper ${USERS.users['${ARGUMENTS[0]}'].api_key} ${API_HOST_URL} ${api_version} | |
29 | + ${api_wrapper}= prepare_api_wrapper ${USERS.users['${ARGUMENTS[0]}'].api_key} ${API_HOST_URL} ${api_version} | |
30 | 30 | ${creation_date} = get_date |
31 | 31 | Set To Dictionary ${USERS.users['${ARGUMENTS[0]}']} creation_date ${creation_date} |
32 | 32 | Set To Dictionary ${USERS.users['${ARGUMENTS[0]}']} client ${api_wrapper} |
33 | 33 | Log Variables |
34 | - | |
35 | -Підготувати дані для оголошення тендера | |
34 | + | |
35 | +Підготувати дані для оголошення тендера | |
36 | 36 | ${INITIAL_TENDER_DATA}= prepare_test_tender_data |
37 | 37 | [return] ${INITIAL_TENDER_DATA} |
38 | - | |
38 | + | |
39 | 39 | Створити тендер |
40 | 40 | [Arguments] @{ARGUMENTS} |
41 | 41 | ${TENDER_DATA}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} create_tender ${ARGUMENTS[1]} |
... | ... | @@ -61,7 +61,7 @@ ${question_id} 0 |
61 | 61 | Log tender_id: ${TENDER_DATA.data.id} |
62 | 62 | Set Global Variable ${TENDER_DATA} |
63 | 63 | [return] ${TENDER_DATA} |
64 | - | |
64 | + | |
65 | 65 | Пошук тендера по ідентифікатору |
66 | 66 | [Arguments] @{ARGUMENTS} |
67 | 67 | [Documentation] |
... | ... | @@ -191,7 +191,7 @@ ${question_id} 0 |
191 | 191 | ${complaint}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} _create_tender_resource_item ${tender} ${ARGUMENTS[2]} complaints |
192 | 192 | Log object data ${complaint} complaint |
193 | 193 | |
194 | -порівняти скаргу | |
194 | +порівняти скаргу | |
195 | 195 | [Documentation] |
196 | 196 | ... ${ARGUMENTS[0]} == username |
197 | 197 | ... ${ARGUMENTS[1]} == tender_uid |
... | ... | @@ -199,10 +199,10 @@ ${question_id} 0 |
199 | 199 | [Arguments] @{ARGUMENTS} |
200 | 200 | ${internalid}= отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[1]} |
201 | 201 | ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${internalid} |
202 | - ${complaint}= Get Variable Value ${tender.data.complaints[0]} | |
202 | + ${complaint}= Get Variable Value ${tender.data.complaints[0]} | |
203 | 203 | log ${complaint} |
204 | 204 | log ${ARGUMENTS[2]} |
205 | - #TODO: COMPARE | |
205 | + #TODO: COMPARE | |
206 | 206 | #Dictionary Should Contain Sub Dictionary ${complaint} ${ARGUMENTS[2].data} |
207 | 207 | #:FOR ${element} IN ${ARGUMENTS[2].data} |
208 | 208 | #\ log ${element} |
... | ... | @@ -315,9 +315,9 @@ ${question_id} 0 |
315 | 315 | [return] ${uploaded_file} |
316 | 316 | |
317 | 317 | |
318 | - | |
319 | 318 | |
320 | -Завантажити документ | |
319 | + | |
320 | +Завантажити документ | |
321 | 321 | [Documentation] |
322 | 322 | ... ${ARGUMENTS[0]} == username |
323 | 323 | ... ${ARGUMENTS[1]} == filepath |
... | ... | @@ -332,7 +332,7 @@ ${question_id} 0 |
332 | 332 | ${reply}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} upload_document ${tender} ${ARGUMENTS[1]} |
333 | 333 | Log object data ${reply} reply |
334 | 334 | [return] ${reply} |
335 | - | |
335 | + | |
336 | 336 | Отримати пропозиції |
337 | 337 | [Documentation] |
338 | 338 | ... ${ARGUMENTS[0]} == username | ... | ... |
... | ... | @@ -32,23 +32,23 @@ ${telephone} +380976535447 |
32 | 32 | [Documentation] |
33 | 33 | ... ${ARGUMENTS[0]} == username |
34 | 34 | ... ${ARGUMENTS[1]} == tender_data |
35 | - ${tender_data}= Add_time_for_GUI_FrontEnds ${ARGUMENTS[1]} | |
36 | - ${items}= Get From Dictionary ${tender_data.data} items | |
37 | - ${title}= Get From Dictionary ${tender_data.data} title | |
38 | - ${description}= Get From Dictionary ${tender_data.data} description | |
39 | - ${budget}= Get From Dictionary ${tender_data.data.value} amount | |
40 | - ${step_rate}= Get From Dictionary ${tender_data.data.minimalStep} amount | |
41 | - ${countryName}= Get From Dictionary ${tender_data.data.procuringEntity.address} countryName | |
35 | + ${prepared_tender_data}= Add_data_for_GUI_FrontEnds ${ARGUMENTS[1]} | |
36 | + ${items}= Get From Dictionary ${prepared_tender_data.data} items | |
37 | + ${title}= Get From Dictionary ${prepared_tender_data.data} title | |
38 | + ${description}= Get From Dictionary ${prepared_tender_data.data} description | |
39 | + ${budget}= Get From Dictionary ${prepared_tender_data.data.value} amount | |
40 | + ${step_rate}= Get From Dictionary ${prepared_tender_data.data.minimalStep} amount | |
41 | + ${countryName}= Get From Dictionary ${prepared_tender_data.data.procuringEntity.address} countryName | |
42 | 42 | ${delivery_end_date}= Get From Dictionary ${items[0].deliveryDate} endDate |
43 | 43 | ${delivery_end_date}= convert_date_to_prom_format ${delivery_end_date} |
44 | - ${cpv}= Get From Dictionary ${items[0].classification} description_ua | |
44 | + ${cpv}= Convert To String "Картонки" | |
45 | 45 | ${cpv_id}= Get From Dictionary ${items[0].classification} id |
46 | 46 | ${cpv_id_1}= Get Substring ${cpv_id} 0 3 |
47 | 47 | ${dkpp_desc}= Get From Dictionary ${items[0].additionalClassifications[0]} description |
48 | 48 | ${dkpp_id}= Get From Dictionary ${items[0].additionalClassifications[0]} id |
49 | 49 | ${code}= Get From Dictionary ${items[0].unit} code |
50 | 50 | ${quantity}= Get From Dictionary ${items[0]} quantity |
51 | - ${name}= Get From Dictionary ${tender_data.data.procuringEntity.contactPoint} name | |
51 | + ${name}= Get From Dictionary ${prepared_tender_data.data.procuringEntity.contactPoint} name | |
52 | 52 | |
53 | 53 | Selenium2Library.Switch Browser ${ARGUMENTS[0]} |
54 | 54 | Wait Until Page Contains Element xpath=//*[contains(@class, 'ui-button-text ui-c')][./text()='Нова закупівля'] 10 | ... | ... |
... | ... | @@ -73,8 +73,7 @@ def test_tender_data(period_interval=2): |
73 | 73 | "classification": { |
74 | 74 | "scheme": u"CPV", |
75 | 75 | "id": u"44617100-9", |
76 | - "description": u"Cartons", | |
77 | - "description_ua": u"Картонки", | |
76 | + "description": u"Cartons" | |
78 | 77 | }, |
79 | 78 | "additionalClassifications": [ |
80 | 79 | { |
... | ... | @@ -243,8 +242,7 @@ def test_tender_data_multiple_lots(period_interval=2): |
243 | 242 | "classification": { |
244 | 243 | "scheme": u"CPV", |
245 | 244 | "id": u"44617100-9", |
246 | - "description": u"Cartons", | |
247 | - "description_ua": u"Картонки", | |
245 | + "description": u"Cartons" | |
248 | 246 | }, |
249 | 247 | "additionalClassifications": [ |
250 | 248 | { |
... | ... | @@ -278,8 +276,7 @@ def test_tender_data_multiple_lots(period_interval=2): |
278 | 276 | "classification": { |
279 | 277 | "scheme": u"CPV", |
280 | 278 | "id": u"44617100-9", |
281 | - "description": u"Cartons", | |
282 | - "description_ua": u"Картонки" | |
279 | + "description": u"Cartons" | |
283 | 280 | }, |
284 | 281 | "additionalClassifications": [ |
285 | 282 | { |
... | ... | @@ -313,8 +310,7 @@ def test_tender_data_multiple_lots(period_interval=2): |
313 | 310 | "classification": { |
314 | 311 | "scheme": u"CPV", |
315 | 312 | "id": u"44617100-9", |
316 | - "description": u"Cartons", | |
317 | - "description_ua": u"Картонки" | |
313 | + "description": u"Cartons" | |
318 | 314 | }, |
319 | 315 | "additionalClassifications": [ |
320 | 316 | { |
... | ... | @@ -348,8 +344,7 @@ def test_tender_data_multiple_lots(period_interval=2): |
348 | 344 | "classification": { |
349 | 345 | "scheme": u"CPV", |
350 | 346 | "id": u"44617100-9", |
351 | - "description": u"Cartons", | |
352 | - "description_ua": u"Картонки" | |
347 | + "description": u"Cartons" | |
353 | 348 | }, |
354 | 349 | "additionalClassifications": [ |
355 | 350 | { | ... | ... |
1 | -#!/usr/bin/env python | |
2 | 1 | # -*- coding: utf-8 - |
3 | 2 | import os |
4 | 3 | from munch import munchify, Munch, fromYAML |
... | ... | @@ -27,21 +26,6 @@ TIMEZONE = timezone('Europe/Kiev') |
27 | 26 | def get_date(): |
28 | 27 | return datetime.now().isoformat() |
29 | 28 | |
30 | -def convert_date_to_slash_format(isodate): | |
31 | - iso_dt=parse_date(isodate) | |
32 | - date_string = iso_dt.strftime("%d/%m/%Y") | |
33 | - return date_string | |
34 | - | |
35 | -def convert_date_to_etender_format(isodate): | |
36 | - iso_dt=parse_date(isodate) | |
37 | - date_string = iso_dt.strftime("%d-%m-%Y") | |
38 | - return date_string | |
39 | - | |
40 | -def convert_time_to_etender_format(isodate): | |
41 | - iso_dt=parse_date(isodate) | |
42 | - time_string = iso_dt.strftime("%H:%M") | |
43 | - return time_string | |
44 | - | |
45 | 29 | def change_state(arguments): |
46 | 30 | try: |
47 | 31 | if arguments[0] == "shouldfail": |
... | ... | @@ -94,7 +78,6 @@ def load_initial_data_from(file_name): |
94 | 78 | elif file_name.endswith(".yaml"): |
95 | 79 | return fromYAML(file_obj) |
96 | 80 | |
97 | - | |
98 | 81 | def prepare_test_tender_data(period_interval=2, mode='single'): |
99 | 82 | if mode == 'single': |
100 | 83 | return munchify({'data': test_tender_data(period_interval=period_interval)}) |
... | ... | @@ -102,21 +85,16 @@ def prepare_test_tender_data(period_interval=2, mode='single'): |
102 | 85 | return munchify({'data': test_tender_data_multiple_lots(period_interval=period_interval)}) |
103 | 86 | raise ValueError('A very specific bad thing happened') |
104 | 87 | |
105 | - | |
106 | 88 | def run_keyword_and_ignore_keyword_definations(name, *args): |
107 | 89 | """Runs the given keyword with given arguments and returns the status as a Boolean value. |
108 | - | |
109 | 90 | This keyword returns `True` if the keyword that is executed succeeds and |
110 | 91 | `False` if it fails. This is useful, for example, in combination with |
111 | 92 | `Run Keyword If`. If you are interested in the error message or return |
112 | 93 | value, use `Run Keyword And Ignore Error` instead. |
113 | - | |
114 | 94 | The keyword name and arguments work as in `Run Keyword`. |
115 | - | |
116 | 95 | Example: |
117 | 96 | | ${passed} = | `Run Keyword And Return Status` | Keyword | args | |
118 | 97 | | `Run Keyword If` | ${passed} | Another keyword | |
119 | - | |
120 | 98 | New in Robot Framework 2.7.6. |
121 | 99 | """ |
122 | 100 | try: |
... | ... | @@ -126,7 +104,6 @@ def run_keyword_and_ignore_keyword_definations(name, *args): |
126 | 104 | return "FAIL", "" |
127 | 105 | return status, _ |
128 | 106 | |
129 | - | |
130 | 107 | def set_tender_periods(tender): |
131 | 108 | now = datetime.now() |
132 | 109 | tender.data.enquiryPeriod.endDate = (now + timedelta(minutes=2)).isoformat() |
... | ... | @@ -134,17 +111,14 @@ def set_tender_periods(tender): |
134 | 111 | tender.data.tenderPeriod.endDate = (now + timedelta(minutes=4)).isoformat() |
135 | 112 | return tender |
136 | 113 | |
137 | - | |
138 | 114 | def set_access_key(tender, access_token): |
139 | 115 | tender.access = munchify({"token": access_token}) |
140 | 116 | return tender |
141 | 117 | |
142 | - | |
143 | 118 | def set_to_object(obj, attribute, value): |
144 | 119 | xpathset(obj, attribute.replace('.', '/'), value) |
145 | 120 | return obj |
146 | 121 | |
147 | - | |
148 | 122 | def get_from_object(obj, attribute): |
149 | 123 | """Gets data from a dictionary using a dotted accessor-string""" |
150 | 124 | jsonpath_expr = parse_path(attribute) |
... | ... | @@ -153,7 +127,6 @@ def get_from_object(obj, attribute): |
153 | 127 | return return_list[0] |
154 | 128 | return None |
155 | 129 | |
156 | - | |
157 | 130 | def wait_to_date(date_stamp): |
158 | 131 | date = parse(date_stamp) |
159 | 132 | LOGGER.log_message(Message("date: {}".format(date.isoformat()), "INFO")) |
... | ... | @@ -164,6 +137,22 @@ def wait_to_date(date_stamp): |
164 | 137 | if wait_seconds < 0: |
165 | 138 | return 0 |
166 | 139 | return wait_seconds |
140 | +#!/usr/bin/env python | |
141 | + | |
142 | +def convert_date_to_slash_format(isodate): | |
143 | + iso_dt=parse_date(isodate) | |
144 | + date_string = iso_dt.strftime("%d/%m/%Y") | |
145 | + return date_string | |
146 | + | |
147 | +def convert_date_to_etender_format(isodate): | |
148 | + iso_dt=parse_date(isodate) | |
149 | + date_string = iso_dt.strftime("%d-%m-%Y") | |
150 | + return date_string | |
151 | + | |
152 | +def convert_time_to_etender_format(isodate): | |
153 | + iso_dt=parse_date(isodate) | |
154 | + time_string = iso_dt.strftime("%H:%M") | |
155 | + return time_string | |
167 | 156 | |
168 | 157 | def newtend_date_picker_index(isodate): |
169 | 158 | now = datetime.today() |
... | ... | @@ -177,10 +166,28 @@ def newtend_date_picker_index(isodate): |
177 | 166 | mod = calendar.monthrange(now.year, now.month)[1] + mod |
178 | 167 | return mod + iso_dt.day |
179 | 168 | |
180 | -def Add_time_for_GUI_FrontEnds(INITIAL_TENDER_DATA): | |
169 | +def Add_data_for_GUI_FrontEnds(INITIAL_TENDER_DATA): | |
181 | 170 | now = datetime.now() |
182 | 171 | INITIAL_TENDER_DATA.data.enquiryPeriod['startDate'] = (now + timedelta(minutes=2)).isoformat() |
183 | 172 | INITIAL_TENDER_DATA.data.enquiryPeriod['endDate'] = (now + timedelta(minutes=3)).isoformat() |
184 | 173 | INITIAL_TENDER_DATA.data.tenderPeriod['startDate'] = (now + timedelta(minutes=4)).isoformat() |
185 | 174 | INITIAL_TENDER_DATA.data.tenderPeriod['endDate'] = (now + timedelta(minutes=5)).isoformat() |
175 | + | |
176 | +##len(dict.items()[0]) | |
177 | +##len(dict[key]) | |
178 | + | |
179 | + | |
180 | + #LOGGER.log_message(Message("itemsss: {}".format(INITIAL_TENDER_DATA.data.items[0]), "INFO")) | |
181 | + | |
182 | + #item_len = len(INITIAL_TENDER_DATA.data.items) | |
183 | + | |
184 | + #LOGGER.log_message(Message("item_len: {}".format(item_len), "INFO")) | |
185 | + | |
186 | + #for i in range(len(INITIAL_TENDER_DATA.data.items)): | |
187 | + #dict.update(INITIAL_TENDER_DATA.data.items.classification['description_ua'] = "Картонки" | |
188 | +# INITIAL_TENDER_DATA.data.items.classification.update({'description_ua': 'Картонки'}) | |
189 | + | |
190 | +# for itm in INITIAL_TENDER_DATA.data.items: | |
191 | +# itm.classification['description_ua'] = u"Картонки" | |
192 | + | |
186 | 193 | return INITIAL_TENDER_DATA |
\ No newline at end of file | ... | ... |
... | ... | @@ -387,7 +387,6 @@ ${question_id} 0 |
387 | 387 | ${bid_doc_upload_fail}= Викликати для учасника ${provider1} Завантажити документ в ставку shouldfail ${filepath} ${TENDER['TENDER_UAID']} |
388 | 388 | Set To Dictionary ${USERS.users['${provider1}'].bidresponces} bid_doc_upload_fail ${bid_doc_upload_fail} |
389 | 389 | |
390 | - | |
391 | 390 | Неможливість змінити існуючу документацію цінової пропозиції після закінчення прийому пропозицій |
392 | 391 | [Tags] ${USERS.users['${provider1}'].broker}: |
393 | 392 | ${filepath}= create_fake_doc |
... | ... | @@ -396,9 +395,8 @@ ${question_id} 0 |
396 | 395 | ${bid_doc_modified_failed}= Викликати для учасника ${provider1} Змінити документ в ставці shouldfail ${filepath} ${bidid} ${docid} |
397 | 396 | Set To Dictionary ${USERS.users['${provider}'].bidresponces} bid_doc_modified_failed ${bid_doc_modified_failed} |
398 | 397 | |
399 | - | |
400 | 398 | Вичитати цінову пропозицію |
401 | -# sleep 120 | |
399 | + #sleep 120 | |
402 | 400 | [Tags] ${USERS.users['${provider1}'].broker}: Можливість подати цінову пропозицію |
403 | 401 | ${bidid}= Get Variable Value ${USERS.users['${provider1}'].bidresponces['resp'].data.id} |
404 | 402 | ${token}= Get Variable Value ${USERS.users['${provider1}'].bidresponces['resp'].access.token} | ... | ... |
Please
register
or
login
to post a comment