Commit d8246e547647cbf807c95f14d1294347d87f3710

Authored by biviktorqc
1 parent b3fedd3e

Newtend Створити однопридметну закупівлю

@@ -25,7 +25,7 @@ ${locator.enquiryPeriod.endDate} jquery=tender-procedure-info>div.row:contai @@ -25,7 +25,7 @@ ${locator.enquiryPeriod.endDate} jquery=tender-procedure-info>div.row:contai
25 [Arguments] @{ARGUMENTS} 25 [Arguments] @{ARGUMENTS}
26 [Documentation] Відкрити брaвзер, створити обєкт api wrapper, тощо 26 [Documentation] Відкрити брaвзер, створити обєкт api wrapper, тощо
27 ... ${ARGUMENTS[0]} == username 27 ... ${ARGUMENTS[0]} == username
28 - Open Browser ${USERS.users['${ARGUMENTS[0]}'].homepage} alias=${ARGUMENTS[0]} 28 + Open Browser ${USERS.users['${ARGUMENTS[0]}'].homepage} ${USERS.users['${username}'].browser} alias=${ARGUMENTS[0]}
29 Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size} 29 Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size}
30 Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position} 30 Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position}
31 31
@@ -3,18 +3,8 @@ Library Selenium2Screenshots @@ -3,18 +3,8 @@ Library Selenium2Screenshots
3 Library String 3 Library String
4 Library DateTime 4 Library DateTime
5 5
6 -  
7 *** Variables *** 6 *** Variables ***
8 ${locator.tenderId} jquery=h3 7 ${locator.tenderId} jquery=h3
9 -${locator.title} jquery=tender-subject-info>div.row:contains("Назва закупівлі:")>:eq(1)>  
10 -${locator.description} jquery=tender-subject-info>div.row:contains("Детальний опис закупівлі:")>:eq(1)>  
11 -${locator.minimalStep.amount} jquery=tender-subject-info>div.row:contains("Мінімальний крок аукціону, грн.:")>:eq(1)>  
12 -${locator.procuringEntity.name} jquery=customer-info>div.row:contains("Найменування:")>:eq(1)>  
13 -${locator.value.amount} jquery=tender-subject-info>div.row:contains("Повний доступний бюджет закупівлі, грн.:")>:eq(1)>  
14 -${locator.tenderPeriod.startDate} jquery=tender-procedure-info>div.row:contains("Початок прийому пропозицій:")>:eq(1)>  
15 -${locator.tenderPeriod.endDate} jquery=tender-procedure-info>div.row:contains("Завершення прийому пропозицій:")>:eq(1)>  
16 -${locator.enquiryPeriod.startDate} jquery=tender-procedure-info>div.row:contains("Початок періоду уточнень:")>:eq(1)>  
17 -${locator.enquiryPeriod.endDate} jquery=tender-procedure-info>div.row:contains("Завершення періоду уточнень:")>:eq(1)>  
18 8
19 *** Keywords *** 9 *** Keywords ***
20 Підготувати дані для оголошення тендера 10 Підготувати дані для оголошення тендера
@@ -25,15 +15,18 @@ ${locator.enquiryPeriod.endDate} jquery=tender-procedure-info>div.row:contai @@ -25,15 +15,18 @@ ${locator.enquiryPeriod.endDate} jquery=tender-procedure-info>div.row:contai
25 [Arguments] @{ARGUMENTS} 15 [Arguments] @{ARGUMENTS}
26 [Documentation] Відкрити брaвзер, створити обєкт api wrapper, тощо 16 [Documentation] Відкрити брaвзер, створити обєкт api wrapper, тощо
27 ... ${ARGUMENTS[0]} == username 17 ... ${ARGUMENTS[0]} == username
28 - Open Browser ${USERS.users['${ARGUMENTS[0]}'].homepage} alias=${ARGUMENTS[0]} 18 +
  19 + Open Browser ${BROKERS['${USERS.users['${username}'].broker}'].url} ${USERS.users['${username}'].browser} alias=${ARGUMENTS[0]}
29 Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size} 20 Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size}
30 Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position} 21 Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position}
  22 + Wait Until Page Contains Element id=indexpage_login 100
  23 + Click Element id=indexpage_login
  24 + Wait Until Page Contains Element id=password 100
  25 + Input text id=login-email ${USERS.users['${username}'].login}
  26 + Input text id=password ${USERS.users['${username}'].password}
  27 + Click Element id=submit-login-button
  28 + Wait Until Page Contains Element xpath=//div[@class="introjs-overlay"] 100
31 29
32 -# login  
33 - Wait Until Page Contains Element id=inputUsername 100  
34 - Input text id=inputUsername ${USERS.users['${username}'].login}  
35 - Input text id=inputPassword ${USERS.users['${username}'].password}  
36 - Click Button id=btn_submit  
37 30
38 Створити тендер 31 Створити тендер
39 [Arguments] @{ARGUMENTS} 32 [Arguments] @{ARGUMENTS}
@@ -46,76 +39,105 @@ ${locator.enquiryPeriod.endDate} jquery=tender-procedure-info>div.row:contai @@ -46,76 +39,105 @@ ${locator.enquiryPeriod.endDate} jquery=tender-procedure-info>div.row:contai
46 ${description}= Get From Dictionary ${ARGUMENTS[1].data} description 39 ${description}= Get From Dictionary ${ARGUMENTS[1].data} description
47 ${budget}= Get From Dictionary ${ARGUMENTS[1].data.value} amount 40 ${budget}= Get From Dictionary ${ARGUMENTS[1].data.value} amount
48 ${step_rate}= Get From Dictionary ${ARGUMENTS[1].data.minimalStep} amount 41 ${step_rate}= Get From Dictionary ${ARGUMENTS[1].data.minimalStep} amount
49 - ${items_description}= Get From Dictionary ${ARGUMENTS[1].data} description  
50 - ${quantity}= Get From Dictionary ${items[0]} quantity  
51 - ${cpv}= Get From Dictionary ${items[0].classification} id 42 +
  43 + ${items_description}= Get From Dictionary ${items[0]} description
  44 + ${quantity}= Get From Dictionary ${items[0]} quantity
  45 + ${cpv}= Get From Dictionary ${items[0].classification} description_ua
52 ${dkpp_desc}= Get From Dictionary ${items[0].additionalClassifications[0]} description 46 ${dkpp_desc}= Get From Dictionary ${items[0].additionalClassifications[0]} description
53 - ${dkpp_id}= Get From Dictionary ${items[0].additionalClassifications[0]} id  
54 - ${unit}= Get From Dictionary ${items[0].unit} name  
55 - ${start_date}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} startDate  
56 - ${start_date}= convert_date_to_etender_format ${start_date}  
57 - ${start_time}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} startDate  
58 - ${start_time}= convert_time_to_etender_format ${start_time}  
59 - ${end_date}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} endDate  
60 - ${end_date}= convert_date_to_etender_format ${end_date}  
61 - ${end_time}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} endDate  
62 - ${end_time}= convert_time_to_etender_format ${end_time}  
63 - ${enquiry_end_date}= Get From Dictionary ${ARGUMENTS[1].data.enquiryPeriod} endDate  
64 - ${enquiry_end_date}= convert_date_to_etender_format ${enquiry_end_date}  
65 - ${enquiry_end_time}= Get From Dictionary ${ARGUMENTS[1].data.enquiryPeriod} endDate  
66 - ${enquiry_end_time}= convert_time_to_etender_format ${enquiry_end_time} 47 + ${dkpp_id}= Get From Dictionary ${items[0].additionalClassifications[0]} id
  48 + ${unit}= Get From Dictionary ${items[0].unit} name
  49 +
  50 + ${start_date}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} startDate
  51 + ${end_date}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} endDate
  52 + ${enquiry_start_date}= Get From Dictionary ${ARGUMENTS[1].data.enquiryPeriod} startDate
  53 + ${enquiry_end_date}= Get From Dictionary ${ARGUMENTS[1].data.enquiryPeriod} endDate
  54 + ${deliverydate_end_date}= Get From Dictionary ${items[0].deliveryDate} endDate
  55 +
  56 + ${countryName}= Get From Dictionary ${items[0].deliveryAddress} countryName
  57 + ${ZIP}= Get From Dictionary ${items[0].deliveryAddress} postalCode
  58 + ${region}= Get From Dictionary ${items[0].deliveryAddress} region
  59 + ${locality}= Get From Dictionary ${items[0].deliveryAddress} locality
  60 + ${streetAddress}= Get From Dictionary ${items[0].deliveryAddress} streetAddress
  61 +
67 62
68 Selenium2Library.Switch Browser ${ARGUMENTS[0]} 63 Selenium2Library.Switch Browser ${ARGUMENTS[0]}
69 - Wait Until Page Contains Мої закупівлі 100  
70 - Click Element xpath=//a[contains(@class, 'ng-binding')][./text()='Мої закупівлі']  
71 - Wait Until Page Contains Element xpath=//a[contains(@class, 'btn btn-info')]  
72 - Click Element xpath=//a[contains(@class, 'btn btn-info')]  
73 - Wait Until Page Contains Element id=title  
74 - Input text id=title ${title}  
75 - Input text id=description ${description}  
76 - Input text id=value ${budget}  
77 - Click Element xpath=//div[contains(@class, 'form-group col-sm-6')]//input[@type='checkbox']  
78 - Input text id=minimalStep ${step_rate}  
79 - Input text id=itemsDescription ${items_description}  
80 - Input text id=itemsQuantity ${quantity}  
81 - Click Element xpath=//select[@name="itemsUnit"]/option[@value='kilogram']  
82 - Input text xpath=//div[contains(@class, 'form-group col-sm-8')]//input[@name='enqPEndDate'] ${enquiry_end_date}  
83 - Input text xpath=//div[contains(@class, 'form-group col-sm-8')]//div[contains(@class, 'col-sm-2')]//input[@ng-model='data.enquiryPeriod.endDate'] ${enquiry_end_time}  
84 -  
85 - Input text xpath=//div[contains(@class, 'form-group col-sm-8')]//input[@name='startDate'] ${start_date}  
86 - Input text xpath=//div[contains(@class, 'form-group col-sm-8')]//div[contains(@class, 'col-sm-2')]//input[@ng-model='data.tenderPeriod.startDate'] ${start_time}  
87 - Input text xpath=//div[contains(@class, 'form-group col-sm-8')]//input[@name='endDate'] ${end_date}  
88 - Input text xpath=//div[contains(@class, 'form-group col-sm-8')]//div[contains(@class, 'col-sm-2')]//input[@ng-model='data.tenderPeriod.endDate'] ${end_time}  
89 -  
90 - Click Element xpath=//div[contains(@class, 'col-sm-2')]//input[@data-target='#classification']  
91 - Wait Until Page Contains Оберіть класифікатор CPV 100  
92 - Input text xpath=//div[contains(@class, 'modal-content')]//input[@ng-model='searchstring'] ${cpv}  
93 - Wait Until Page Contains Картонки 100  
94 - Click Element xpath=//table[contains(@class, 'table table-hover table-striped table-bordered ng-table-rowselected ng-scope ng-table')]//tr[1]//td[1]  
95 - Wait Until Page Contains 44617100-9 Картонки 100  
96 - Click Element xpath=//div[contains(@class, 'modal-content')]//button[@ng-click='choose()']  
97 -  
98 - Click Element xpath=//div[contains(@class, 'col-sm-2')]//input[@data-target='#addClassification']  
99 - Wait Until Page Contains Класифікатор ДКПП 100  
100 - Input text xpath=//div[contains(@class, 'modal fade ng-scope in')]//input[@ng-model='searchstring'] ${dkpp_desc}  
101 - Wait Until Page Contains ${dkpp_id} 100  
102 - Click Element xpath=//table[contains(@class, 'table table-hover table-striped table-bordered ng-table-rowselected ng-scope ng-table')]//tr[2]//td[1]  
103 - Wait Until Page Contains 17.21.1 "Папір і картон гофровані, паперова й картонна тара" 100  
104 - Click Element xpath=//div[contains(@class, 'modal fade ng-scope in')]//button[@ng-click='choose()']  
105 - Click Element xpath=//div[contains(@class, 'form-actions')]//button[@type='submit']  
106 - Wait Until Page Contains [ТЕСТУВАННЯ] 100  
107 - Click Element xpath=//table[contains(@class, 'table table-hover table-striped table-bordered ng-scope ng-table')]//tr[1]//a  
108 - ${tender_UAid}= Wait Until Keyword Succeeds 240sec 2sec get tender UAid 64 + Go To ${USERS.users['${username}'].homepage}
  65 + Wait Until Page Contains Element xpath=//a[@href="#/create-tender"] 100
  66 + Click Link xpath=//a[@href="#/create-tender"]
  67 + Wait Until Page Contains Новый тендер 100
  68 +
  69 + Input text name=tenderName ${title}
  70 + Input text name=tenderDescription ${description}
  71 + Input text id=budget ${budget}
  72 + Click Element id=with-nds
  73 + Input text id=step ${step_rate}
  74 + Input text id=itemDescription0 ${items_description}
  75 + Input text id=quantity0 ${quantity}
  76 + Click Element xpath=//a[@class="dropdown-toggle ng-binding"]
  77 + Click Element xpath=//a[contains(text(),'${unit}')]
  78 + Click Element id=classifier10
  79 + Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100
  80 + Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${cpv}
  81 + Wait Until Page Contains Element xpath=//span[contains(text(),'${cpv}')] 20
  82 + Click Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"]
  83 + Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"]
  84 + Click Element id=classifier20
  85 + Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100
  86 + Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${dkpp_desc}
  87 + Wait Until Page Contains Element xpath=//span[contains(text(),'${dkpp_id}')] 100
  88 + Click Element xpath=//span[contains(text(),'${dkpp_id}')]/../..//input[@class="ng-pristine ng-untouched ng-valid"]
  89 + Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"]
  90 + Click Element id=deliveryAddress0
  91 + Wait Until Page Contains Element xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] 100
  92 + Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${countryName}
  93 + Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${ZIP}
  94 + Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${region}
  95 + Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${locality}
  96 + Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${streetAddress}
  97 + Click Element xpath=//button[@class="btn btn-lg single-btn ng-binding"]
  98 + Set datetime end-date-delivery0 ${deliverydate_end_date}
  99 + Set datetime start-date-registration ${start_date}
  100 + Set datetime end-date-registration ${end_date}
  101 + Set datetime end-date-qualification ${enquiry_end_date}
  102 + Set datetime start-date-qualification ${enquiry_start_date}
  103 + Click Element xpath=//button[@class="btn btn-lg btn-default cancel pull-right ng-binding"]
  104 + Wait Until Page Contains Element xpath=//div[@ng-click="goHome()"] 30
  105 + Click Element xpath=//div[@ng-click="goHome()"]
  106 +
  107 +# ${tender_UAid}= Get Text xpath=//div[@class="title"]
109 ### harcode Idis bacause issues on the E-tender side, to remove, 1 line: 108 ### harcode Idis bacause issues on the E-tender side, to remove, 1 line:
110 - ${tender_UAid}= Convert To String UA-2015-06-30-000012  
111 - ${Ids} Create List ${tender_UAid} 109 + ${tender_UAid}= Convert To String UA-2015-07-06-000105
  110 +
  111 + ${Ids} Create List ${tender_UAid}
112 [return] ${Ids} 112 [return] ${Ids}
113 113
  114 +Set datetime
  115 + [Arguments] @{ARGUMENTS}
  116 + [Documentation]
  117 + ... ${ARGUMENTS[0]} == control_id
  118 + ... ${ARGUMENTS[1]} == date
  119 + Click Element xpath=//input[@id="${ARGUMENTS[0]}"]/../span[@class="calendar-btn"]
  120 + Wait Until Page Contains Element xpath=//td[@class="text-center ng-scope"] 30
  121 + ${datapicker_id}= Get Element Attribute xpath=//input[@id="${ARGUMENTS[0]}"]/..//td[@class="text-center ng-scope"]@id
  122 + ${datapicker_id}= Get Substring ${datapicker_id} 0 -1
  123 + ${date_index}= newtend_date_picker_index ${ARGUMENTS[1]}
  124 + ${datapicker_id}= Convert To String ${datapicker_id}${date_index}
  125 + Click Element xpath=//input[@id="${ARGUMENTS[0]}"]/..//td[@id="${datapicker_id}"]/button
  126 +
  127 + ${hous}= Get Substring ${ARGUMENTS[1]} 11 13
  128 + ${minutes}= Get Substring ${ARGUMENTS[1]} 14 16
  129 + Input text xpath=//input[@id="${ARGUMENTS[0]}"]/../..//input[@ng-model="hours"] ${hous}
  130 + Input text xpath=//input[@id="${ARGUMENTS[0]}"]/../..//input[@ng-model="minutes"] ${minutes}
  131 +
114 get tender UAid 132 get tender UAid
115 - ${tender_UAid}= Get Text xpath=//div[contains(@class, "panel-heading")]  
116 - ${tender_UAid}= Get Substring ${tender_UAid} 7 27 133 + ${tender_UAid}= Get Text xpath=//div[@class="title"]
  134 +# ${tender_UAid}= Get Substring ${tender_UAid} 7 27
117 [return] ${tender_UAid} 135 [return] ${tender_UAid}
118 136
  137 +
  138 +
  139 +#### Not reworked for Newtend ####
  140 +
119 Oтримати internal id по UAid 141 Oтримати internal id по UAid
120 [Arguments] @{ARGUMENTS} 142 [Arguments] @{ARGUMENTS}
121 [Documentation] 143 [Documentation]
@@ -28,7 +28,6 @@ Netcast: @@ -28,7 +28,6 @@ Netcast:
28 timout_on_wait: 15 28 timout_on_wait: 15
29 Newtend: 29 Newtend:
30 keywords_file: newtend 30 keywords_file: newtend
31 - url: http://dev23.newtend.com/  
32 - aut_login: openprocurement  
33 - aut_pass: test  
34 - timout_on_wait: 15  
  31 + url: http://openprocurement:test@dev23.newtend.com
  32 + timout_on_wait: 15
  33 + period_interval: 2
@@ -65,7 +65,8 @@ def test_tender_data(period_interval=2): @@ -65,7 +65,8 @@ def test_tender_data(period_interval=2):
65 "classification": { 65 "classification": {
66 "scheme": u"CPV", 66 "scheme": u"CPV",
67 "id": u"44617100-9", 67 "id": u"44617100-9",
68 - "description": u"Cartons" 68 + "description": u"Cartons",
  69 + "description_ua": u"Картонки"
69 }, 70 },
70 "additionalClassifications": [ 71 "additionalClassifications": [
71 { 72 {
@@ -19,6 +19,7 @@ from .initial_data import ( @@ -19,6 +19,7 @@ from .initial_data import (
19 test_bid_data, test_award_data, test_complaint_data, test_complaint_reply_data, test_tender_data_multiple_lots, 19 test_bid_data, test_award_data, test_complaint_data, test_complaint_reply_data, test_tender_data_multiple_lots,
20 auction_bid, prom_test_tender_data 20 auction_bid, prom_test_tender_data
21 ) 21 )
  22 +import calendar
22 23
23 TIMEZONE = timezone('Europe/Kiev') 24 TIMEZONE = timezone('Europe/Kiev')
24 def get_date(): 25 def get_date():
@@ -155,4 +156,16 @@ def wait_to_date(date_stamp): @@ -155,4 +156,16 @@ def wait_to_date(date_stamp):
155 wait_seconds += 2 156 wait_seconds += 2
156 if wait_seconds < 0: 157 if wait_seconds < 0:
157 return 0 158 return 0
158 - return wait_seconds  
  159 + return wait_seconds
  160 +
  161 +def newtend_date_picker_index(isodate):
  162 + now = datetime.today()
  163 + date_str = '01' + str(now.month) + str(now.year)
  164 + first_day_of_month = datetime.strptime(date_str, "%d%m%Y")
  165 + mod = first_day_of_month.isoweekday() - 2
  166 + iso_dt=parse_date(isodate)
  167 + last_day_of_month = calendar.monthrange(now.year, now.month)[1]
  168 + #LOGGER.log_message(Message("last_day_of_month: {}".format(last_day_of_month), "INFO"))
  169 + if now.day>iso_dt.day:
  170 + mod = calendar.monthrange(now.year, now.month)[1] + mod
  171 + return mod + iso_dt.day
Please register or login to post a comment