Advertisement
yboi

Untitled

Jul 23rd, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.35 KB | None | 0 0
  1. *** Setting ***
  2. Library Selenium2Screenshots
  3. Library String
  4. Library DateTime
  5.  
  6. *** Variables ***
  7. ${locator.tenderId} jquery=h3
  8. ${locator.title} jquery=tender-subject-info>div.row:contains("Назва закупівлі:")>:eq(1)>
  9. ${locator.description} jquery=tender-subject-info>div.row:contains("Детальний опис закупівлі:")>:eq(1)>
  10. ${locator.minimalStep.amount} jquery=tender-subject-info>div.row:contains("Мінімальний крок аукціону, грн.:")>:eq(1)>
  11. ${locator.procuringEntity.name} jquery=customer-info>div.row:contains("Найменування:")>:eq(1)>
  12. ${locator.value.amount} jquery=tender-subject-info>div.row:contains("Повний доступний бюджет закупівлі, грн.:")>:eq(1)>
  13. ${locator.tenderPeriod.startDate} jquery=tender-procedure-info>div.row:contains("Початок прийому пропозицій:")>:eq(1)>
  14. ${locator.tenderPeriod.endDate} jquery=tender-procedure-info>div.row:contains("Завершення прийому пропозицій:")>:eq(1)>
  15. ${locator.enquiryPeriod.startDate} jquery=tender-procedure-info>div.row:contains("Початок періоду уточнень:")>:eq(1)>
  16. ${locator.enquiryPeriod.endDate} jquery=tender-procedure-info>div.row:contains("Завершення періоду уточнень:")>:eq(1)>
  17.  
  18. *** Keywords ***
  19. Підготувати дані для оголошення тендера
  20. ${INITIAL_TENDER_DATA}= prepare_test_tender_data
  21. [return] ${INITIAL_TENDER_DATA}
  22.  
  23. Підготувати клієнт для користувача
  24. [Arguments] @{ARGUMENTS}
  25. [Documentation] Відкрити брaвзер, створити обєкт api wrapper, тощо
  26. ... ${ARGUMENTS[0]} == username
  27. Open Browser ${BROKERS['${USERS.users['${ARGUMENTS[0]}'].broker}'].url} ${USERS.users['${ARGUMENTS[0]}'].browser} alias=${ARGUMENTS[0]}
  28. Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size}
  29. Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position}
  30.  
  31. # login
  32. Wait Until Page Contains Element name=siteLogin 100
  33. Input text name=siteLogin ${BROKERS['${USERS.users['${username}'].broker}'].login}
  34. Input text name=sitePass ${BROKERS['${USERS.users['${username}'].broker}'].password}
  35. Click Button xpath=.//*[@id='table1']/tbody/tr/td/form/p[3]/input
  36.  
  37. Wait Until Page Contains Element jquery=a[href="/cabinet"]
  38. Click Element jquery=a[href="/cabinet"]
  39. Wait Until Page Contains Element name=email 100
  40. Input text name=email 1
  41. Sleep 1
  42. Input text name=email ${USERS.users['${username}'].login}
  43. Sleep 2
  44. #Wait Until Page Contains Element name=psw 100
  45. Input text name=psw ${USERS.users['${username}'].password}
  46. Wait Until Page Contains Element xpath=//button[contains(@class, 'btn')][./text()='Вхід в кабінет'] 100
  47. Click Element xpath=//button[contains(@class, 'btn')][./text()='Вхід в кабінет']
  48.  
  49. Створити тендер
  50. [Arguments] @{ARGUMENTS}
  51. [Documentation]
  52. ... ${ARGUMENTS[0]} == username
  53. ... ${ARGUMENTS[1]} == tender_data
  54.  
  55. ${items}= Get From Dictionary ${ARGUMENTS[1].data} items
  56. ${title}= Get From Dictionary ${ARGUMENTS[1].data} title
  57. ${description}= Get From Dictionary ${ARGUMENTS[1].data} description
  58. ${budget}= Get From Dictionary ${ARGUMENTS[1].data.value} amount
  59. ${step_rate}= Get From Dictionary ${ARGUMENTS[1].data.minimalStep} amount
  60. ${items_description}= Get From Dictionary ${ARGUMENTS[1].data} description
  61. ${quantity}= Get From Dictionary ${items[0]} quantity
  62. ${countryName}= Get From Dictionary ${ARGUMENTS[1].data.procuringEntity.address} countryName
  63. ${end_date}= Get From Dictionary ${ARGUMENTS[1].data.tenderPeriod} endDate
  64. ${end_date}= convert_date_to_etender_format ${end_date}
  65. ${cpv}= Get From Dictionary ${items[0].classification} description_ua
  66. ${cpv_id}= Get From Dictionary ${items[0].classification} id
  67. ${dkpp_desc}= Get From Dictionary ${items[0].additionalClassifications[0]} description
  68. ${dkpp_id}= Get From Dictionary ${items[0].additionalClassifications[0]} id
  69.  
  70. Selenium2Library.Switch Browser ${ARGUMENTS[0]}
  71. Wait Until Page Contains Element jquery=a[href="/tenders/new"] 100
  72. Click Element jquery=a[href="/tenders/new"]
  73. Wait Until Page Contains Element name=tender_title 100
  74. Input text name=tender_title ${title}
  75. Wait Until Page Contains Element name=tender_description 100
  76. Input text name=tender_description ${description}
  77. Wait Until Page Contains Element name=tender_value_amount 100
  78. Input text name=tender_value_amount ${budget}
  79. Wait Until Page Contains Element name=tender_minimalStep_amount 100
  80. Input text name=tender_minimalStep_amount ${step_rate}
  81. Wait Until Page Contains Element name=items[0][item_description] 100
  82. Input text name=items[0][item_description] ${items_description}
  83. Wait Until Page Contains Element name=items[0][item_quantity] 100
  84. Input text name=items[0][item_quantity] ${quantity}
  85. Wait Until Page Contains Element name=items[0][item_deliveryAddress_countryName] 100
  86. Input text name=items[0][item_deliveryAddress_countryName] ${countryName}
  87. Wait Until Page Contains Element name=items[0][item_deliveryDate_endDate] 100
  88. Input text name=items[0][item_deliveryDate_endDate] ${end_date}
  89. Wait Until Page Contains Element xpath=//a[contains(@data-class, 'cpv')][./text()='Визначити за довідником'] 100
  90. Click Element xpath=//a[contains(@data-class, 'cpv')][./text()='Визначити за довідником']
  91. Select Frame xpath=//iframe[contains(@src,'/js/classifications/cpv/uk.htm?relation=true')]
  92. Input text id=search ${cpv}
  93. Wait Until Page Contains 44617100-9 Картонки 100
  94. Click Element xpath=//a[contains(@id,'${cpv_id}')]
  95. Click Element xpath=.//*[@id='select']
  96. Unselect Frame
  97. Wait Until Page Contains Element xpath=//a[contains(@data-class, 'dkpp')][./text()='Визначити за довідником'] 100
  98. Click Element xpath=//a[contains(@data-class, 'dkpp')][./text()='Визначити за довідником']
  99. Select Frame xpath=//iframe[contains(@src,'/js/classifications/dkpp/uk.htm?relation=true')]
  100. Input text id=search ${dkpp_desc}
  101. Wait Until Page Contains 17.21.1 "Папір і картон гофровані, паперова й картонна тара" 100
  102. Click Element xpath=//a[contains(@id,'${dkpp_id}')]
  103. Click Element xpath=.//*[@id='select']
  104. DEBUG
  105.  
  106. Пошук тендера по ідентифікатору
  107. [Arguments] @{ARGUMENTS}
  108. [Documentation]
  109. ... ${ARGUMENTS[0]} == username
  110. ... ${ARGUMENTS[1]} == tenderId
  111. ... ${ARGUMENTS[2]} == id
  112. Switch browser ${ARGUMENTS[0]}
  113. ${current_location}= Get Location
  114. Run keyword if '${BROKERS['${USERS.users['${username}'].broker}'].url}/#/tenderDetailes/${ARGUMENTS[2]}'=='${current_location}' Reload Page
  115. Go to ${BROKERS['${USERS.users['${username}'].broker}'].url}
  116. Wait Until Page Contains E-TENDER - центр електронної торгівлі 10
  117. sleep 1
  118. Input Text jquery=input[ng-change='search()'] ${ARGUMENTS[1]}
  119. Click Link jquery=a[ng-click='search()']
  120. sleep 2
  121. ${last_note_id}= Add pointy note jquery=a[href^="#/tenderDetailes"] Found tender with tenderID "${ARGUMENTS[1]}" width=200 position=bottom
  122. sleep 1
  123. Remove element ${last_note_id}
  124. Click Link jquery=a[href^="#/tenderDetailes"]
  125. Wait Until Page Contains ${ARGUMENTS[1]} 10
  126. sleep 1
  127. Capture Page Screenshot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement