Advertisement
yboi

Untitled

Jul 22nd, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.09 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} id
  66.  
  67. Selenium2Library.Switch Browser ${ARGUMENTS[0]}
  68. Wait Until Page Contains Element jquery=a[href="/tenders/new"] 100
  69. Click Element jquery=a[href="/tenders/new"]
  70. Wait Until Page Contains Element name=tender_title 100
  71. Input text name=tender_title ${title}
  72. Wait Until Page Contains Element name=tender_description 100
  73. Input text name=tender_description ${description}
  74. Wait Until Page Contains Element name=tender_value_amount 100
  75. Input text name=tender_value_amount ${budget}
  76. Wait Until Page Contains Element name=tender_minimalStep_amount 100
  77. Input text name=tender_minimalStep_amount ${step_rate}
  78. Wait Until Page Contains Element name=items[0][item_description] 100
  79. Input text name=items[0][item_description] ${items_description}
  80. Wait Until Page Contains Element name=items[0][item_quantity] 100
  81. Input text name=items[0][item_quantity] ${quantity}
  82. Wait Until Page Contains Element name=items[0][item_deliveryAddress_countryName] 100
  83. Input text name=items[0][item_deliveryAddress_countryName] ${countryName}
  84. Wait Until Page Contains Element name=items[0][item_deliveryDate_endDate] 100
  85. Input text name=items[0][item_deliveryDate_endDate] ${end_date}
  86. Wait Until Page Contains Element xpath=//a[contains(@data-class, 'cpv')][./text()='Визначити за довідником']
  87. Click Element xpath=//a[contains(@data-class, 'cpv')][./text()='Визначити за довідником']
  88. DEBUG
  89. Wait Until Page Contains Оберіть класифікатор CPV 100
  90. Input text id=search ${cpv}
  91.  
  92. Пошук тендера по ідентифікатору
  93. [Arguments] @{ARGUMENTS}
  94. [Documentation]
  95. ... ${ARGUMENTS[0]} == username
  96. ... ${ARGUMENTS[1]} == tenderId
  97. ... ${ARGUMENTS[2]} == id
  98. Switch browser ${ARGUMENTS[0]}
  99. ${current_location}= Get Location
  100. Run keyword if '${BROKERS['${USERS.users['${username}'].broker}'].url}/#/tenderDetailes/${ARGUMENTS[2]}'=='${current_location}' Reload Page
  101. Go to ${BROKERS['${USERS.users['${username}'].broker}'].url}
  102. Wait Until Page Contains E-TENDER - центр електронної торгівлі 10
  103. sleep 1
  104. Input Text jquery=input[ng-change='search()'] ${ARGUMENTS[1]}
  105. Click Link jquery=a[ng-click='search()']
  106. sleep 2
  107. ${last_note_id}= Add pointy note jquery=a[href^="#/tenderDetailes"] Found tender with tenderID "${ARGUMENTS[1]}" width=200 position=bottom
  108. sleep 1
  109. Remove element ${last_note_id}
  110. Click Link jquery=a[href^="#/tenderDetailes"]
  111. Wait Until Page Contains ${ARGUMENTS[1]} 10
  112. sleep 1
  113. Capture Page Screenshot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement