Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *** Setting ***
- Library Selenium2Screenshots
- Library String
- Library DateTime
- *** Variables ***
- ${locator.tenderId} jquery=h3
- ${locator.title} jquery=tender-subject-info>div.row:contains("Назва закупівлі:")>:eq(1)>
- ${locator.description} jquery=tender-subject-info>div.row:contains("Детальний опис закупівлі:")>:eq(1)>
- ${locator.minimalStep.amount} jquery=tender-subject-info>div.row:contains("Мінімальний крок аукціону, грн.:")>:eq(1)>
- ${locator.procuringEntity.name} jquery=customer-info>div.row:contains("Найменування:")>:eq(1)>
- ${locator.value.amount} jquery=tender-subject-info>div.row:contains("Повний доступний бюджет закупівлі, грн.:")>:eq(1)>
- ${locator.tenderPeriod.startDate} jquery=tender-procedure-info>div.row:contains("Початок прийому пропозицій:")>:eq(1)>
- ${locator.tenderPeriod.endDate} jquery=tender-procedure-info>div.row:contains("Завершення прийому пропозицій:")>:eq(1)>
- ${locator.enquiryPeriod.startDate} jquery=tender-procedure-info>div.row:contains("Початок періоду уточнень:")>:eq(1)>
- ${locator.enquiryPeriod.endDate} jquery=tender-procedure-info>div.row:contains("Завершення періоду уточнень:")>:eq(1)>
- *** Keywords ***
- Підготувати дані для оголошення тендера
- ${INITIAL_TENDER_DATA}= prepare_test_tender_data
- [return] ${INITIAL_TENDER_DATA}
- Підготувати клієнт для користувача
- [Arguments] @{ARGUMENTS}
- [Documentation] Відкрити брaвзер, створити обєкт api wrapper, тощо
- ... ${ARGUMENTS[0]} == username
- Open Browser ${BROKERS['${USERS.users['${ARGUMENTS[0]}'].broker}'].url} ${USERS.users['${ARGUMENTS[0]}'].browser} alias=${ARGUMENTS[0]}
- Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size}
- Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position}
- # login
- Wait Until Page Contains Element name=siteLogin 100
- Input text name=siteLogin ${BROKERS['${USERS.users['${username}'].broker}'].login}
- Input text name=sitePass ${BROKERS['${USERS.users['${username}'].broker}'].password}
- Click Button xpath=.//*[@id='table1']/tbody/tr/td/form/p[3]/input
- Wait Until Page Contains Element jquery=a[href="/cabinet"]
- Click Element jquery=a[href="/cabinet"]
- Wait Until Page Contains Element name=email 100
- Input text name=email ${USERS.users['${username}'].login}
- #Sleep 10
- Wait Until Element Is Visible name=psw 100
- #Wait Until Page Contains Element name=psw 100
- Input text name=psw ${USERS.users['${username}'].password}
- Wait Until Page Contains Element xpath=//button[contains(@class, 'btn')][./text()='Вхід в кабінет'] 100
- Click Element xpath=//button[contains(@class, 'btn')][./text()='Вхід в кабінет']
- Створити тендер
- [Arguments] @{ARGUMENTS}
- [Documentation]
- ... ${ARGUMENTS[0]} == username
- ... ${ARGUMENTS[1]} == tender_data
- ${items}= Get From Dictionary ${ARGUMENTS[1].data} items
- ${title}= Get From Dictionary ${ARGUMENTS[1].data} title
- ${description}= Get From Dictionary ${ARGUMENTS[1].data} description
- ${budget}= Get From Dictionary ${ARGUMENTS[1].data.value} amount
- ${step_rate}= Get From Dictionary ${ARGUMENTS[1].data.minimalStep} amount
- ${items_description}= Get From Dictionary ${ARGUMENTS[1].data} description
- ${quantity}= Get From Dictionary ${items[0]} quantity
- Selenium2Library.Switch Browser ${ARGUMENTS[0]}
- Wait Until Page Contains Element jquery=a[href="/tenders/new"] 100
- Click Element jquery=a[href="/tenders/new"]
- Wait Until Page Contains Element name=tender_title 100
- Input text name=tender_title ${title}
- Wait Until Page Contains Element name=tender_description 100
- Input text name=tender_description ${description}
- Wait Until Page Contains Element name=tender_value_amount 100
- Input text name=tender_value_amount ${budget}
- Wait Until Page Contains Element name=tender_minimalStep_amount 100
- Input text name=tender_minimalStep_amount ${step_rate}
- Wait Until Page Contains Element name=items[0][item_description] 100
- Input text name=items[0][item_description] ${items_description}
- Wait Until Page Contains Element name=items[0][item_quantity] 100
- Input text name=items[0][item_quantity] ${quantity}
- Пошук тендера по ідентифікатору
- [Arguments] @{ARGUMENTS}
- [Documentation]
- ... ${ARGUMENTS[0]} == username
- ... ${ARGUMENTS[1]} == tenderId
- ... ${ARGUMENTS[2]} == id
- Switch browser ${ARGUMENTS[0]}
- ${current_location}= Get Location
- Run keyword if '${BROKERS['${USERS.users['${username}'].broker}'].url}/#/tenderDetailes/${ARGUMENTS[2]}'=='${current_location}' Reload Page
- Go to ${BROKERS['${USERS.users['${username}'].broker}'].url}
- Wait Until Page Contains E-TENDER - центр електронної торгівлі 10
- sleep 1
- Input Text jquery=input[ng-change='search()'] ${ARGUMENTS[1]}
- Click Link jquery=a[ng-click='search()']
- sleep 2
- ${last_note_id}= Add pointy note jquery=a[href^="#/tenderDetailes"] Found tender with tenderID "${ARGUMENTS[1]}" width=200 position=bottom
- sleep 1
- Remove element ${last_note_id}
- Click Link jquery=a[href^="#/tenderDetailes"]
- Wait Until Page Contains ${ARGUMENTS[1]} 10
- sleep 1
- Capture Page Screenshot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement