Commit 4fab4b01760d5aef65ebc87045522477cb1b5436

Authored by biviktorqc
1 parent 2c46fae0

NewTend single+malty+add items keyword

@@ -27,206 +27,113 @@ ${locator.tenderId} jquery=h3 @@ -27,206 +27,113 @@ ${locator.tenderId} jquery=h3
27 Click Element id=submit-login-button 27 Click Element id=submit-login-button
28 Wait Until Page Contains Element xpath=//div[@class="introjs-overlay"] 100 28 Wait Until Page Contains Element xpath=//div[@class="introjs-overlay"] 100
29 29
30 -  
31 Створити тендер 30 Створити тендер
32 [Arguments] @{ARGUMENTS} 31 [Arguments] @{ARGUMENTS}
33 [Documentation] 32 [Documentation]
34 ... ${ARGUMENTS[0]} == username 33 ... ${ARGUMENTS[0]} == username
35 ... ${ARGUMENTS[1]} == tender_data 34 ... ${ARGUMENTS[1]} == tender_data
  35 +
36 ## Inicialisation 36 ## Inicialisation
37 ${items}= Get From Dictionary ${ARGUMENTS[1].data} items 37 ${items}= Get From Dictionary ${ARGUMENTS[1].data} items
38 ${title}= Get From Dictionary ${ARGUMENTS[1].data} title 38 ${title}= Get From Dictionary ${ARGUMENTS[1].data} title
39 ${description}= Get From Dictionary ${ARGUMENTS[1].data} description 39 ${description}= Get From Dictionary ${ARGUMENTS[1].data} description
40 ${budget}= Get From Dictionary ${ARGUMENTS[1].data.value} amount 40 ${budget}= Get From Dictionary ${ARGUMENTS[1].data.value} amount
41 ${step_rate}= Get From Dictionary ${ARGUMENTS[1].data.minimalStep} amount 41 ${step_rate}= Get From Dictionary ${ARGUMENTS[1].data.minimalStep} amount
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  
46 - ${dkpp_desc}= Get From Dictionary ${items[0].additionalClassifications[0]} description  
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 42 ${start_date}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} startDate
51 ${end_date}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} endDate 43 ${end_date}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} endDate
52 ${enquiry_start_date}= Get From Dictionary ${ARGUMENTS[1].data.enquiryPeriod} startDate 44 ${enquiry_start_date}= Get From Dictionary ${ARGUMENTS[1].data.enquiryPeriod} startDate
53 ${enquiry_end_date}= Get From Dictionary ${ARGUMENTS[1].data.enquiryPeriod} endDate 45 ${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 -## 46 +
62 Selenium2Library.Switch Browser ${ARGUMENTS[0]} 47 Selenium2Library.Switch Browser ${ARGUMENTS[0]}
63 Go To ${USERS.users['${username}'].homepage} 48 Go To ${USERS.users['${username}'].homepage}
64 Wait Until Page Contains Element xpath=//a[@href="#/create-tender"] 100 49 Wait Until Page Contains Element xpath=//a[@href="#/create-tender"] 100
65 Click Link xpath=//a[@href="#/create-tender"] 50 Click Link xpath=//a[@href="#/create-tender"]
66 - Wait Until Page Contains Новый тендер 100 51 + Wait Until Page Contains Новый тендер 100
67 # Input fields tender 52 # Input fields tender
68 Input text name=tenderName ${title} 53 Input text name=tenderName ${title}
69 - Input text name=tenderDescription ${description} 54 + Input text name=tenderDescription ${description}
70 Input text id=budget ${budget} 55 Input text id=budget ${budget}
71 Click Element id=with-nds 56 Click Element id=with-nds
72 Input text id=step ${step_rate} 57 Input text id=step ${step_rate}
73 -## 1-st Item ifo  
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 -# Set CPV  
79 - Click Element id=classifier10  
80 - Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100  
81 - Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${cpv}  
82 - Wait Until Page Contains Element xpath=//span[contains(text(),'${cpv}')] 20  
83 - Click Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"]  
84 - Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"]  
85 -# Set ДКПП  
86 - Click Element id=classifier20  
87 - Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100  
88 - Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${dkpp_desc}  
89 - Wait Until Page Contains Element xpath=//span[contains(text(),'${dkpp_id}')] 100  
90 - Click Element xpath=//span[contains(text(),'${dkpp_id}')]/../..//input[@class="ng-pristine ng-untouched ng-valid"]  
91 - Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"]  
92 -# Set Delivery Address  
93 - Click Element id=deliveryAddress0  
94 - Wait Until Page Contains Element xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] 100  
95 - Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${countryName}  
96 - Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${ZIP}  
97 - Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${region}  
98 - Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${locality}  
99 - Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${streetAddress}  
100 - Click Element xpath=//button[@class="btn btn-lg single-btn ng-binding"]  
101 -# Set Item Datetime  
102 - Set datetime end-date-delivery0 ${deliverydate_end_date}  
103 -## 58 +# Add Item(s)
  59 + Додати придмет ${items[0]} 0
  60 + Run Keyword If '${mode}' == 'multi' Додати багато придметів items
104 # Set tender datatimes 61 # Set tender datatimes
105 Set datetime start-date-registration ${start_date} 62 Set datetime start-date-registration ${start_date}
106 Set datetime end-date-registration ${end_date} 63 Set datetime end-date-registration ${end_date}
107 Set datetime end-date-qualification ${enquiry_end_date} 64 Set datetime end-date-qualification ${enquiry_end_date}
108 Set datetime start-date-qualification ${enquiry_start_date} 65 Set datetime start-date-qualification ${enquiry_start_date}
109 -  
110 - Run Keyword If '${mode}' == 'multi' Додати придмет items  
111 - 66 +# Save
112 Click Element xpath=//button[@class="btn btn-lg btn-default cancel pull-right ng-binding"] 67 Click Element xpath=//button[@class="btn btn-lg btn-default cancel pull-right ng-binding"]
113 Wait Until Page Contains Element xpath=//div[@ng-click="goHome()"] 30 68 Wait Until Page Contains Element xpath=//div[@ng-click="goHome()"] 30
114 Click Element xpath=//div[@ng-click="goHome()"] 69 Click Element xpath=//div[@ng-click="goHome()"]
115 -### harcode Idis bacause issues on the Newtend side, to remove after fix:  
116 - ${tender_UAid}= Convert To String UA-2015-07-06-000105  
117 - ${tender_id}= Convert To String 192c86c7d8b74c1081d1a9b2db0faba2  
118 -  
119 -### ${tender_UAid}= Get Text xpath=//div[@class="title"]  
120 -  
121 - ${Ids} Create List ${tender_UAid} ${tender_id} 70 +# Get Ids
  71 + Wait Until Page Contains Element xpath=//div[@class="title"] 30
  72 + ${tender_UAid}= Get Text xpath=//div[@class="title"]
  73 + ${current_location}= Get Location
  74 + ${tender_id}= Get Substring ${current_location} -41 -9
  75 + ${Ids} Create List ${tender_UAid} ${tender_id}
122 [return] ${Ids} 76 [return] ${Ids}
123 77
  78 +
124 Set datetime 79 Set datetime
125 [Arguments] @{ARGUMENTS} 80 [Arguments] @{ARGUMENTS}
126 [Documentation] 81 [Documentation]
127 ... ${ARGUMENTS[0]} == control_id 82 ... ${ARGUMENTS[0]} == control_id
128 ... ${ARGUMENTS[1]} == date 83 ... ${ARGUMENTS[1]} == date
129 #Pick Date 84 #Pick Date
130 - Click Element xpath=//input[@id="${ARGUMENTS[0]}"]/../span[@class="calendar-btn"]  
131 - Wait Until Page Contains Element xpath=//td[@class="text-center ng-scope"] 30 85 + Click Element xpath=//input[@id="${ARGUMENTS[0]}"]/../span[@class="calendar-btn"]
  86 + Wait Until Page Contains Element xpath=//td[@class="text-center ng-scope"] 30
132 ${datapicker_id}= Get Element Attribute xpath=//input[@id="${ARGUMENTS[0]}"]/..//td[@class="text-center ng-scope"]@id 87 ${datapicker_id}= Get Element Attribute xpath=//input[@id="${ARGUMENTS[0]}"]/..//td[@class="text-center ng-scope"]@id
133 - ${datapicker_id}= Get Substring ${datapicker_id} 0 -1  
134 - ${date_index}= newtend_date_picker_index ${ARGUMENTS[1]}  
135 - ${datapicker_id}= Convert To String ${datapicker_id}${date_index}  
136 - Click Element xpath=//input[@id="${ARGUMENTS[0]}"]/..//td[@id="${datapicker_id}"]/button 88 + ${datapicker_id}= Get Substring ${datapicker_id} 0 -1
  89 + ${date_index}= newtend_date_picker_index ${ARGUMENTS[1]}
  90 + ${datapicker_id}= Convert To String ${datapicker_id}${date_index}
  91 + Click Element xpath=//input[@id="${ARGUMENTS[0]}"]/..//td[@id="${datapicker_id}"]/button
137 #Set time 92 #Set time
138 ${hous}= Get Substring ${ARGUMENTS[1]} 11 13 93 ${hous}= Get Substring ${ARGUMENTS[1]} 11 13
139 ${minutes}= Get Substring ${ARGUMENTS[1]} 14 16 94 ${minutes}= Get Substring ${ARGUMENTS[1]} 14 16
140 Input text xpath=//input[@id="${ARGUMENTS[0]}"]/../..//input[@ng-model="hours"] ${hous} 95 Input text xpath=//input[@id="${ARGUMENTS[0]}"]/../..//input[@ng-model="hours"] ${hous}
141 Input text xpath=//input[@id="${ARGUMENTS[0]}"]/../..//input[@ng-model="minutes"] ${minutes} 96 Input text xpath=//input[@id="${ARGUMENTS[0]}"]/../..//input[@ng-model="minutes"] ${minutes}
142 97
143 -  
144 Додати придмет 98 Додати придмет
145 [Arguments] @{ARGUMENTS} 99 [Arguments] @{ARGUMENTS}
146 [Documentation] 100 [Documentation]
147 - ... ${ARGUMENTS[0]} == items  
148 -  
149 -## Get values for 2-nd item  
150 - ${items_description1}= Get From Dictionary ${items[1]} description  
151 - ${quantity1}= Get From Dictionary ${items[1]} quantity  
152 - ${cpv1}= Get From Dictionary ${items[1].classification} description_ua  
153 - ${dkpp_desc1}= Get From Dictionary ${items[1].additionalClassifications[0]} description  
154 - ${dkpp_id1}= Get From Dictionary ${items[1].additionalClassifications[0]} id  
155 - ${unit1}= Get From Dictionary ${items[1].unit} name  
156 -  
157 - ${deliverydate_end_date1}= Get From Dictionary ${items[1].deliveryDate} endDate  
158 -  
159 - ${countryName1}= Get From Dictionary ${items[1].deliveryAddress} countryName  
160 - ${ZIP1}= Get From Dictionary ${items[1].deliveryAddress} postalCode  
161 - ${region1}= Get From Dictionary ${items[1].deliveryAddress} region  
162 - ${locality1}= Get From Dictionary ${items[1].deliveryAddress} locality  
163 - ${streetAddress1}= Get From Dictionary ${items[1].deliveryAddress} streetAddress  
164 -  
165 -## Get values for 3-rd item  
166 - ${items_description2}= Get From Dictionary ${items[2]} description  
167 - ${quantity2}= Get From Dictionary ${items[2]} quantity  
168 - ${cpv2}= Get From Dictionary ${items[2].classification} description_ua  
169 - ${dkpp_desc2}= Get From Dictionary ${items[2].additionalClassifications[0]} description  
170 - ${dkpp_id2}= Get From Dictionary ${items[2].additionalClassifications[0]} id  
171 - ${unit2}= Get From Dictionary ${items[2].unit} name  
172 -  
173 - ${deliverydate_end_date2}= Get From Dictionary ${items[2].deliveryDate} endDate  
174 -  
175 - ${countryName2}= Get From Dictionary ${items[2].deliveryAddress} countryName  
176 - ${ZIP2}= Get From Dictionary ${items[2].deliveryAddress} postalCode  
177 - ${region2}= Get From Dictionary ${items[2].deliveryAddress} region  
178 - ${locality2}= Get From Dictionary ${items[2].deliveryAddress} locality  
179 - ${streetAddress2}= Get From Dictionary ${items[2].deliveryAddress} streetAddress  
180 -  
181 -## Get values for 4-th item  
182 - ${items_description3}= Get From Dictionary ${items[3]} description  
183 - ${quantity3}= Get From Dictionary ${items[3]} quantity  
184 - ${cpv3}= Get From Dictionary ${items[3].classification} description_ua  
185 - ${dkpp_desc3}= Get From Dictionary ${items[3].additionalClassifications[0]} description  
186 - ${dkpp_id3}= Get From Dictionary ${items[3].additionalClassifications[0]} id  
187 - ${unit3}= Get From Dictionary ${items[3].unit} name  
188 -  
189 - ${deliverydate_end_date3}= Get From Dictionary ${items[3].deliveryDate} endDate  
190 -  
191 - ${countryName3}= Get From Dictionary ${items[3].deliveryAddress} countryName  
192 - ${ZIP3}= Get From Dictionary ${items[3].deliveryAddress} postalCode  
193 - ${region3}= Get From Dictionary ${items[3].deliveryAddress} region  
194 - ${locality3}= Get From Dictionary ${items[3].deliveryAddress} locality  
195 - ${streetAddress3}= Get From Dictionary ${items[3].deliveryAddress} streetAddress  
196 -  
197 -  
198 - Click Element xpath=//a[@class="icon-black plus-black remove-field ng-scope"]  
199 -###переробити на наступний ітем  
200 -  
201 -# Input text id=itemDescription0 ${items_description}  
202 - Input text id=itemDescription1 ${items_description1}  
203 -# Input text id=quantity0 ${quantity}  
204 - Input text id=quantity1 ${quantity1}  
205 -### to fix  
206 - Click Element xpath=//a[@class="dropdown-toggle ng-binding"]  
207 - Click Element xpath=(//span[contains(@class, 'caret')][./text()='единицы измерения'])  
208 -  
209 -<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle ng-binding" dropdown-toggle="">  
210 - единицы измерения <span class="caret"></span>  
211 - </a>  
212 - Click Element xpath=//a[contains(text(),'${unit1}')]  
213 - 101 + ... ${ARGUMENTS[0]} == items_n
  102 + ... ${ARGUMENTS[1]} == index
  103 +## Get values for item
  104 + ${items_description}= Get From Dictionary ${ARGUMENTS[0]} description
  105 + ${quantity}= Get From Dictionary ${ARGUMENTS[0]} quantity
  106 + ${cpv}= Get From Dictionary ${ARGUMENTS[0].classification} description_ua
  107 + ${dkpp_desc}= Get From Dictionary ${ARGUMENTS[0].additionalClassifications[0]} description
  108 + ${dkpp_id}= Get From Dictionary ${ARGUMENTS[0].additionalClassifications[0]} id
  109 + ${unit}= Get From Dictionary ${ARGUMENTS[0].unit} name
  110 + ${deliverydate_end_date}= Get From Dictionary ${ARGUMENTS[0].deliveryDate} endDate
  111 + ${countryName}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} countryName
  112 + ${ZIP}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} postalCode
  113 + ${region}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} region
  114 + ${locality}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} locality
  115 + ${streetAddress}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} streetAddress
  116 +# Add item
  117 + Input text id=itemDescription${ARGUMENTS[1]} ${items_description}
  118 + Input text id=quantity${ARGUMENTS[1]} ${quantity}
  119 + Click Element xpath=//a[contains(text(), "единицы измерения")]
  120 + Click Element xpath=//a[contains(text(), "единицы измерения")]/..//a[contains(text(), '${unit}')]
214 # Set CPV 121 # Set CPV
215 - Click Element id=classifier11 122 + Click Element id=classifier1${ARGUMENTS[1]}
216 Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100 123 Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100
217 - Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${cpv1}  
218 - Wait Until Page Contains Element xpath=//span[contains(text(),'${cpv1}')] 20 124 + Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${cpv}
  125 + Wait Until Page Contains Element xpath=//span[contains(text(),'${cpv}')] 20
219 Click Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 126 Click Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"]
220 Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"] 127 Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"]
221 # Set ДКПП 128 # Set ДКПП
222 - Click Element id=classifier21 129 + Click Element id=classifier2${ARGUMENTS[1]}
223 Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100 130 Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100
224 - Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${dkpp_desc1}  
225 - Wait Until Page Contains Element xpath=//span[contains(text(),'${dkpp_id1}')] 100  
226 - Click Element xpath=//span[contains(text(),'${dkpp_id1}')]/../..//input[@class="ng-pristine ng-untouched ng-valid"] 131 + Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${dkpp_desc}
  132 + Wait Until Page Contains Element xpath=//span[contains(text(),'${dkpp_id}')] 100
  133 + Click Element xpath=//span[contains(text(),'${dkpp_id}')]/../..//input[@class="ng-pristine ng-untouched ng-valid"]
227 Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"] 134 Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"]
228 # Set Delivery Address 135 # Set Delivery Address
229 - Click Element id=deliveryAddress1 136 + Click Element id=deliveryAddress${ARGUMENTS[1]}
230 Wait Until Page Contains Element xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] 100 137 Wait Until Page Contains Element xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] 100
231 Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${countryName} 138 Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${countryName}
232 Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${ZIP} 139 Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${ZIP}
@@ -235,9 +142,16 @@ Set datetime @@ -235,9 +142,16 @@ Set datetime
235 Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${streetAddress} 142 Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${streetAddress}
236 Click Element xpath=//button[@class="btn btn-lg single-btn ng-binding"] 143 Click Element xpath=//button[@class="btn btn-lg single-btn ng-binding"]
237 # Set Item Datetime 144 # Set Item Datetime
238 - Set datetime end-date-delivery1 ${deliverydate_end_date1}  
239 -###  
240 - Debug 145 + Set datetime end-date-delivery${ARGUMENTS[1]} ${deliverydate_end_date}
  146 +
  147 +Додати багато придметів
  148 + [Arguments] @{ARGUMENTS}
  149 + [Documentation]
  150 + ... ${ARGUMENTS[0]} == items
  151 + ${Items_length}= Get Length ${items}
  152 + : FOR ${INDEX} IN RANGE 1 ${Items_length}
  153 + \ Click Element xpath=//a[@class="icon-black plus-black remove-field ng-scope"]
  154 + \ Додати придмет ${items[${INDEX}]} ${INDEX}
241 155
242 156
243 157
Please register or login to post a comment