CBD3-TE-MA-UC-05-08.robot 4.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
*** Settings ***
Documentation  5.Функціональні особливості відображення блоків модулю аукціону 
    ...  Блок Bid Change
    ...  https://confluence-sale.prozorro.org/pages/viewpage.action?pageId=60950735#id-ТестуванняМАEnglish-CBD3-TE-MA-UC-05-08

Library  String
Library  DateTime

Resource  ../fixtures/Resources/auction_conditions.robot

Test Setup  Check For Pass Before
Suite Setup  Create Session  api_procedures  %{PROCEDURE_URL}  verify=True
Suite Teardown  Run Keywords  Delete All Sessions  Close All Browsers 

*** Variables ***
${AUCTION_NAME}  timber-english-initial-auction 

*** Test Cases ***

Init Auction

    ${ACTION_START_TIME} =  Get Time  format=timestamp  time_=UTC + 15s
    Import Variables    ../fixtures/${AUCTION_NAME}.py  init_auction
    
    Set To Dictionary  ${init_auction["auctionPeriod"]}  startDate  ${ACTION_START_TIME}
    ${RESP} =  POST On Session  api_procedures  /api/procedures  json=${init_auction}  headers=${DEFAULT_HEADERS}  expected_status=201
    ${ID} =  Get From Dictionary  ${resp.json()}  id
    Set Suite Variable  ${ID}  ${ID}

    Check Action Status  active_auction

Init Watcher

    ${RESP} =  Get Request and return resp By  ${ID}  ${WATCHER}
    Status Should Be  200  ${RESP}
    ${AUCTION_URL} =  Get From Dictionary  ${resp.json()}  auctionUrl
    Open Browser Maximized   ${AUCTION_URL}  ${WATCHER}
    Element Should Not Be Visible  //span[@class="bidder-info-text"]

Init Bidder

    Open Browser Maximized  about:blank  ${BIDDER_TOKEN[2]}
    ${BIDDER_URL_3} =  Get Request and return participationUrl By  ${ID}  ${BIDDER_TOKEN[2]}
    Allow Terms  ${BIDDER_URL_3}

    Open Browser Maximized  about:blank  ${BIDDER_TOKEN[1]}
    ${BIDDER_URL_2} =  Get Request and return participationUrl By  ${ID}  ${BIDDER_TOKEN[1]}
    Allow Terms  ${BIDDER_URL_2}

1. Відображення інформації в блоці Bid Change під час очікування аукціону

    
    Switch Browser  chrome_${BIDDER_TOKEN[2]}
    Page Should Not Contain Element  ${BTN_BET}
    Page Should Not Contain Element  ${NUMBER_INPUT}
    

2. Відображення інформації в блоці Bid Change під час перiоду аукціону

    Switch Browser  chrome_${BIDDER_TOKEN[1]}
    Wait Until Page Contains Element  //span[@class='bidder-info-text' and contains(.,'Ваш хід в ')]

    Switch Browser  chrome_${BIDDER_TOKEN[2]}
    Wait Until Page Contains Element  ${BTN_BET}  1m
    Element Should Be Disabled  ${BTN_BET}
    ${MINIMAL_BET} =  Evaluate  ${MINIMALSTEP} + ${AMOUNT}
    Wait Until Page Contains Element  //time[@class='spinner-time'] 
    Page Should Contain Element  ${NUMBER_INPUT}
    Page Should Contain Element  //div[contains(@class,'input-text bidder-input-text') and contains(span,'Ставка має бути від')]
    Page Should Contain Element  //b[@class='bidder-input-hint-currency' and contains(.,'${MINIMAL_BET}')]
    Page Should Contain Element  //div[@class='input-currency' and .='грн']
    Page Should Not Contain Element  ${BTN_BET_REJECT}
    Input Text  ${NUMBER_INPUT}  1
    Click Button  ${BTN_BET}
    Check Attention  MINIMAL_BET=${${AMOUNT} + ${MINIMALSTEP}}
    Page Should Contain Element  //input[@class='input-block' and @value="1.00"]
    Press Keys  ${NUMBER_INPUT}  CTRL+a+BACKSPACE
    Input Text  ${NUMBER_INPUT}  ${${MINIMALSTEP} + ${AMOUNT}}
    Element Should Be Enabled  ${BTN_BET}
    Press Keys  ${NUMBER_INPUT}  ENTER
    Accepted Bet  ${${MINIMALSTEP} + ${AMOUNT}}
    Page Should Contain Element  ${REFRESH_BET}
    Page Should Contain Element  ${BTN_BET_REJECT}
    Input Text  ${NUMBER_INPUT}  ${2 * ${MINIMALSTEP} + ${AMOUNT}}
    Click Button  ${REFRESH_BET}
    Accepted Bet  ${2 * ${MINIMALSTEP} + ${AMOUNT}}

    Switch Browser  chrome_${WATCHER}
    Wait Until Page Contains Element  //span[@class='bidder-info-text' and contains(.,'До закінчення раунду 1')]

3. Відображення інформації в блоці Bid Change під час перiоду оголошення результатів

    Wait Until Page Contains Element  ${ANNOUNCEMENT_RESULTS}  2m
    Switch Browser  chrome_${WATCHER}
    Element Should Not Be Visible  //span[@class="bidder-info-text"]

    Switch Browser  chrome_${BIDDER_TOKEN[2]}
    Page Should Not Contain Element  ${BTN_BET}
    Page Should Not Contain Element  ${NUMBER_INPUT}