Advertisement
yboi

Untitled

Jul 21st, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.98 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 ${USERS.users['${username}'].login}
  41. #Sleep 10
  42. Wait Until Element Is Visible name=psw 100
  43. #Wait Until Page Contains Element name=psw 100
  44. Input text name=psw ${USERS.users['${username}'].password}
  45. Wait Until Page Contains Element xpath=//button[contains(@class, 'btn')][./text()='Вхід в кабінет'] 100
  46. Click Element xpath=//button[contains(@class, 'btn')][./text()='Вхід в кабінет']
  47.  
  48. Створити тендер
  49. [Arguments] @{ARGUMENTS}
  50. [Documentation]
  51. ... ${ARGUMENTS[0]} == username
  52. ... ${ARGUMENTS[1]} == tender_data
  53.  
  54. ${items}= Get From Dictionary ${ARGUMENTS[1].data} items
  55. ${title}= Get From Dictionary ${ARGUMENTS[1].data} title
  56. ${description}= Get From Dictionary ${ARGUMENTS[1].data} description
  57. ${budget}= Get From Dictionary ${ARGUMENTS[1].data.value} amount
  58. ${step_rate}= Get From Dictionary ${ARGUMENTS[1].data.minimalStep} amount
  59. ${items_description}= Get From Dictionary ${ARGUMENTS[1].data} description
  60. ${quantity}= Get From Dictionary ${items[0]} quantity
  61.  
  62. Selenium2Library.Switch Browser ${ARGUMENTS[0]}
  63. Wait Until Page Contains Element jquery=a[href="/tenders/new"] 100
  64. Click Element jquery=a[href="/tenders/new"]
  65. Wait Until Page Contains Element name=tender_title 100
  66. Input text name=tender_title ${title}
  67. Wait Until Page Contains Element name=tender_description 100
  68. Input text name=tender_description ${description}
  69. Wait Until Page Contains Element name=tender_value_amount 100
  70. Input text name=tender_value_amount ${budget}
  71. Wait Until Page Contains Element name=tender_minimalStep_amount 100
  72. Input text name=tender_minimalStep_amount ${step_rate}
  73. Wait Until Page Contains Element name=items[0][item_description] 100
  74. Input text name=items[0][item_description] ${items_description}
  75. Wait Until Page Contains Element name=items[0][item_quantity] 100
  76. Input text name=items[0][item_quantity] ${quantity}
  77.  
  78. Пошук тендера по ідентифікатору
  79. [Arguments] @{ARGUMENTS}
  80. [Documentation]
  81. ... ${ARGUMENTS[0]} == username
  82. ... ${ARGUMENTS[1]} == tenderId
  83. ... ${ARGUMENTS[2]} == id
  84. Switch browser ${ARGUMENTS[0]}
  85. ${current_location}= Get Location
  86. Run keyword if '${BROKERS['${USERS.users['${username}'].broker}'].url}/#/tenderDetailes/${ARGUMENTS[2]}'=='${current_location}' Reload Page
  87. Go to ${BROKERS['${USERS.users['${username}'].broker}'].url}
  88. Wait Until Page Contains E-TENDER - центр електронної торгівлі 10
  89. sleep 1
  90. Input Text jquery=input[ng-change='search()'] ${ARGUMENTS[1]}
  91. Click Link jquery=a[ng-click='search()']
  92. sleep 2
  93. ${last_note_id}= Add pointy note jquery=a[href^="#/tenderDetailes"] Found tender with tenderID "${ARGUMENTS[1]}" width=200 position=bottom
  94. sleep 1
  95. Remove element ${last_note_id}
  96. Click Link jquery=a[href^="#/tenderDetailes"]
  97. Wait Until Page Contains ${ARGUMENTS[1]} 10
  98. sleep 1
  99. Capture Page Screenshot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement