[Python] Estou automatizando uma api no robor, preciso pegar um link, mas estou obtendo o...

Discussão em 'Python' iniciado por Stack, Novembro 27, 2024.

  1. Stack

    Stack Membro Participativo

    *** Settings *** Resource ../../../../_support/resources.resource

    Suite Setup ${env} Create User And Login Test Setup Validate Tags In Suite ${TEST_TAGS}

    *** Test Cases *** Validar PaymentLink [Documentation] Create orders [Tags] cadastro orders

    ${response}= Get On Session session ${g_ENV_DICT['endpoint_course']}
    ${courses}= Set Variable ${response.json()}
    Set Suite Variable ${s_COURSE_CODE} ${courses[0]['courseCode']}

    ${body} Body student
    ${response} POST On Session session ${g_ENV_DICT['endpoint_student']} json=${body}
    Should Be Equal As Strings ${response.status_code} 201

    ${login_student}= Body student login
    ${response}= POST On Session session ${g_ENV_DICT['endpoint_auth_student']} json=${login_student}
    ... expected_status=200

    ${body}= Body orders
    ${response}= POST On Session session ${g_ENV_DICT['endpoint_orders']} json=${body}
    ... expected_status=201

    ${response}= Get On Session session ${g_ENV_DICT['endpoint_orders']}
    ${courses}= Set Variable ${response.json()}
    Set Suite Variable ${paymentLink} ${courses[0]['paymentLink']}

    Continue reading...

Compartilhe esta Página