Commit e1ab5cd3 authored by Benedetta Arena's avatar Benedetta Arena
Browse files

feat: implement new documentation script and update tests

parent ed39a9c1
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -22,26 +22,27 @@ ${b2_url}
${b3_url}

*** Test Cases ***
IOP_CNF_01_01 Retrieve Entities In Three Different Brokers
    [Documentation]    Check that the entity created in A only some attributes of the entity. The agent should also check that the entity in B is the full entity.
IOP_CNF_01 Retrieve OffStreetParking:1
    [Documentation]    Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking1 and OffStreetParking2. C contains OffStreetParking2.
    ...                Registrations established: Inclusive in A to B. Exclusive in A to C.
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    proxy-exclusive    4_3_6    5_7_1

    #Client retrieves OffStreetParking:1 in A and checks for a successful response. 
    ${response}=    Retrieve Entity    ${entity_id1}    broker_url=${b1_url}
    Check Response Status Code    200    ${response.status_code}
    Should Contain   ${response.json()}    availableSpotsNumber
    Should Contain   ${response.json()}    totalSpotsNumber

    #Client retrieves OffStreetParking:1 in B.
    ${expected_payload}=    Load Entity    ${first_entity_payload_filename}    ${entity_id1}
    ${response}=    Retrieve Entity    ${entity_id1}   broker_url=${b2_url}
    Check Response Status Code    200    ${response.status_code}

    #Client checks that the entity returned is the full entity.
    Should Be Equal    ${response.json()}    ${expected_payload}

*** Keywords ***
Setup Initial Context Source Registrations
    [Documentation]    Pre-conditions: no user context. Data only on leaves.
    ...                Broker B contains OffStreetParking1 and OffStreetParking2.
    ...                Broker C contains OffStreetParking2.
    ...                CSR in A to B and in A to C.
    ${entity_id1}=    Generate Random Parking Entity Id
    Set Suite Variable    ${entity_id1}
    ${response}=    Create Entity    ${first_entity_payload_filename}    ${entity_id1}    broker_url=${b2_url}
@@ -77,7 +78,6 @@ Setup Initial Context Source Registrations
    Check Response Status Code    201    ${response.status_code}

Delete Entities And Delete Registrations
    [Documentation]    Post-conditions: no user context. no data in any broker. no registrations in any broker.
    Delete Context Source Registration    ${registration_id1}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id2}    broker_url=${b1_url}
    Delete Entity    ${entity_id1}    broker_url=${b2_url}
+6 −8
Original line number Diff line number Diff line
@@ -24,32 +24,31 @@ ${b3_url}
${b4_url}

*** Test Cases ***
IOP_CNF_02_01 Retrieve Entities In Four Different Brokers
    [Documentation]    Check that entities returned from A has attributes from both entities in B and C.
IOP_CNF_02_01 Retrieve OffStreetParking:1
    [Documentation]    Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking1 without location. C contains OffStreetParking1. D contains OffStreetParking2.
    ...                Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D.
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    proxy-redirect    4_3_6    5_7_1

    #Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should be the whole entity.
    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b1_url}
    Check Response Status Code    207    ${response.status_code}
    ${payload}=    Set To Dictionary    ${response.json()}
    Should Be Equal    ${payload}    ${first_full_entity_payload_filename}

    #Client retrieves OffStreetParking:1 in B and C.
    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b2_url}
    ${first_expected_payload}=    Set To Dictionary    ${response.json()}

    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b3_url}
    ${second_expected_payload}=    Set To Dictionary    ${response.json()}

    #Client checks that the entity returned from A has attributes from the entities in B and C.
    Should Be Equal    ${payload}[availableSpotNumbers][value]    ${first_expected_payload}[availableSpotNumbers][value]
    Should Be Equal    ${payload}[totalSpotsNumber][value]    ${first_expected_payload}[totalSpotsNumber][value]
    Should Be Equal    ${payload}[location][value]    ${second_expected_payload}[location][value]

*** Keywords ***
Setup Initial Context Source Registrations
    [Documentation]    Pre-conditions: no user context. Data only on leaves.
    ...                Broker B contains OffStreetParking1 without location.
    ...                Broker C contains OffStreetParking1.
    ...                Broker D contains OffStreetParking2.
    ...                CSR in A to B, in A to C and in A to D.
    ${entity_id}=    Generate Random Parking Entity Id
    Set Suite Variable    ${entity_id}
    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}    broker_url=${b2_url}
@@ -93,7 +92,6 @@ Setup Initial Context Source Registrations
    Check Response Status Code    201    ${response.status_code}

Delete Entities And Delete Registrations
    [Documentation]    Post-conditions: no user context. no data in any broker. no registrations in any broker.
    Delete Context Source Registration    ${registration_id1}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id2}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id3}    broker_url=${b1_url}
+6 −8
Original line number Diff line number Diff line
@@ -24,27 +24,26 @@ ${b3_url}
${b4_url}

*** Test Cases ***
IOP_CNF_02_02 Retrieve Entities In Four Different Brokers
    [Documentation]    Check that the entity returned from C has the same location attribute found in A.
IOP_CNF_02_02 Retrieve OffStreetParking:1 Location Attribute
    [Documentation]    Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking1. C contains OffStreetParking1 with location and name only. D contains OffStreetParking2.
    ...                Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D.
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    proxy-redirect    4_3_6    5_7_1

    #Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should contain the location attribute.
    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b1_url}
    Check Response Status Code    207    ${response.status_code}
    ${payload}=    Set To Dictionary    ${response.json()}
    Should Contain    ${payload}    location

    #Client retrieves OffStreetParking:1 in C with local=true.
    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b3_url}    local=true
    ${expected_payload}=    Set To Dictionary    ${response.json()}

    #Client checks that the location attribute in C is the same as the one in A.
    Should Be Equal    ${payload}[location][value]    ${expected_payload}[location][value]

*** Keywords ***
Setup Initial Context Source Registrations
    [Documentation]    Pre-conditions: no user context. Data only on leaves.
    ...                Broker B contains OffStreetParking1.
    ...                Broker C contains OffStreetParking1 with location and name only.
    ...                Broker D contains OffStreetParking2.
    ...                CSR in A to B, in A to C and in A to D.
    ${entity_id}=    Generate Random Parking Entity Id
    Set Suite Variable    ${entity_id}
    ${response}=    Create Entity    ${first_full_entity_payload_filename}    ${entity_id}    broker_url=${b2_url}
@@ -88,7 +87,6 @@ Setup Initial Context Source Registrations
    Check Response Status Code    201    ${response.status_code}

Delete Entities And Delete Registrations
    [Documentation]    Post-conditions: no user context. no data in any broker. no registrations in any broker.
    Delete Context Source Registration    ${registration_id1}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id2}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id3}    broker_url=${b1_url}
+6 −9
Original line number Diff line number Diff line
@@ -25,15 +25,18 @@ ${b3_url}
${b4_url}

*** Test Cases ***
IOP_CNF_03_01 Retrieve Entities In Four Different Brokers
    [Documentation]    Check the retrieval of entities in different brokers. The entity returned from A should have some attributes that match the entity in B and should not contain the location attribute found in C.
IOP_CNF_03_01 Retrieve OffStreetParking:1
    [Documentation]    Pre-conditions: no user context. Data on every broker. A contains OffStreetParking1 without location. B contains OffStreetParking1. C contains OffStreetParking1 without location. D contains OffStreetParking2.
    ...                Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D.
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    additive-auxiliary    4_3_6    5_7_1

    #Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should not contain the location attribute.
    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b1_url}
    Check Response Status Code    207    ${response.status_code}
    ${payload}=    Set To Dictionary    ${response.json()}
    Should Not Contain    ${payload}    location

    #Client retrieves OffStreetParking:1 in B, C and D with the local=true flag.
    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b1_url}    local=true
    ${first_payload}=    Set To Dictionary    ${response.json()}
    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b2_url}    local=true
@@ -41,17 +44,12 @@ IOP_CNF_03_01 Retrieve Entities In Four Different Brokers
    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b3_url}    local=true
    ${third_payload}=    Set To Dictionary    ${response.json()}

    #Client checks that the entity returned from A should have the same attributes as the one in B and it should not contain the attribute location found in C.
    Should Be Equal    ${payload}    ${first_payload}
    Should Not Contain    ${payload}[location]    ${second_payload}[location]

*** Keywords ***
Setup Initial Context Source Registrations
    [Documentation]    Pre-conditions: no user context. Data on every broker.
    ...                Broker A contains OffStreetParking1 without location.
    ...                Broker B contains OffStreetParking1.
    ...                Broker C contains OffStreetParking1 without location.
    ...                Broker D contains OffStreetParking2.
    ...                CSR in A to B, in A to C and in A to D.
    ${entity_id}=    Generate Random Parking Entity Id
    Set Suite Variable    ${entity_id}
    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}    broker_url=${b1_url}
@@ -97,7 +95,6 @@ Setup Initial Context Source Registrations
    Check Response Status Code    201    ${response.status_code}

Delete Entities And Delete Registrations
    [Documentation]    Post-conditions: no user context. no data in any broker. no registrations in any broker.
    Delete Context Source Registration    ${registration_id1}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id2}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id3}    broker_url=${b1_url}
+7 −9
Original line number Diff line number Diff line
@@ -25,28 +25,26 @@ ${b3_url}
${b4_url}

*** Test Cases ***
IOP_CNF_03_02 Retrieve Entities In Four Different Brokers
    [Documentation]    Check that the entity returned from A contains the attribute location and it matches the one from the entity returned from C. 
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    proxy-exclusive    4_3_6    5_7_1
IOP_CNF_03_02 Retrieve OffStreetParking:1 Location Attribute
    [Documentation]    Pre-conditions: no user context. Data on every broker. A contains OffStreetParking1 without location. B contains OffStreetParking1. C contains OffStreetParking1 with location and name only. D contains OffStreetParking1 without location.
    ...                Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D.
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    additive-auxiliary    4_3_6    5_7_1

    #Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should only contain the location attribute.
    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b1_url}
    Check Response Status Code    207    ${response.status_code}
    ${payload}=    Set To Dictionary    ${response.json()}
    Should Contain    ${payload}    location

    #Client retrieves OffStreetParking:1 in C with local=true.
    ${response}=    Retrieve Entity    ${entity_id}    broker_url=${b3_url}    local=true
    ${expected_payload}=    Set To Dictionary    ${response.json()}

    #Client checks that the location attribute in A is the same as the one in C.
    Should Be Equal    ${payload}[location][value]    ${expected_payload}[location][value]

*** Keywords ***
Setup Initial Context Source Registrations
    [Documentation]    Pre-conditions: no user context. Data on every broker.
    ...                Broker A contains OffStreetParking1 without location.
    ...                Broker B contains OffStreetParking1.
    ...                Broker C contains OffStreetParking1 with location and name only.
    ...                Broker D contains OffStreetParking1 without location.
    ...                CSR in A to B, in A to C and in A to D.
    ${entity_id}=    Generate Random Parking Entity Id
    Set Suite Variable    ${entity_id}
    ${response}=    Create Entity    ${no_location_entity_payload_filename}    ${entity_id}    broker_url=${b1_url}
Loading