from behave import *
import requests
import json

@given('I have user authentication credentials')
def step_impl(context):
    context.url = 'https://api.withleaf.io/api/authenticate'
    context.headers = {'content-type': 'application/json'}
    context.data = {"username": "fernandosdba@gmail.com", "password": "94084452", "rememberMe":"true"}

@when('I make an http post call to https://api.withleaf.io/api/authenticate')
def step_impl(context):
    context.response = requests.request("POST" , context.url, json=context.data, headers=context.headers)

@then('I must get a response with status code 200 and a json object with token')
def step_impl(context):
    print("\n" , context.response.content)
    assert context.response.status_code == 200

e6fe262d292e7b7fdad96b190fbbfb6ce32972b2
<mask token>


@given('I have user authentication credentials')
def step_impl(context):
    context.url = 'https://api.withleaf.io/api/authenticate'
    context.headers = {'content-type': 'application/json'}
    context.data = {'username': 'fernandosdba@gmail.com', 'password':
        '94084452', 'rememberMe': 'true'}


<mask token>

<mask token>


@given('I have user authentication credentials')
def step_impl(context):
    context.url = 'https://api.withleaf.io/api/authenticate'
    context.headers = {'content-type': 'application/json'}
    context.data = {'username': 'fernandosdba@gmail.com', 'password':
        '94084452', 'rememberMe': 'true'}


@when('I make an http post call to https://api.withleaf.io/api/authenticate')
def step_impl(context):
    context.response = requests.request('POST', context.url, json=context.
        data, headers=context.headers)


<mask token>

<mask token>


@given('I have user authentication credentials')
def step_impl(context):
    context.url = 'https://api.withleaf.io/api/authenticate'
    context.headers = {'content-type': 'application/json'}
    context.data = {'username': 'fernandosdba@gmail.com', 'password':
        '94084452', 'rememberMe': 'true'}


@when('I make an http post call to https://api.withleaf.io/api/authenticate')
def step_impl(context):
    context.response = requests.request('POST', context.url, json=context.
        data, headers=context.headers)


@then('I must get a response with status code 200 and a json object with token'
    )
def step_impl(context):
    print('\n', context.response.content)
    assert context.response.status_code == 200

from behave import *
import requests
import json


@given('I have user authentication credentials')
def step_impl(context):
    context.url = 'https://api.withleaf.io/api/authenticate'
    context.headers = {'content-type': 'application/json'}
    context.data = {'username': 'fernandosdba@gmail.com', 'password':
        '94084452', 'rememberMe': 'true'}


@when('I make an http post call to https://api.withleaf.io/api/authenticate')
def step_impl(context):
    context.response = requests.request('POST', context.url, json=context.
        data, headers=context.headers)


@then('I must get a response with status code 200 and a json object with token'
    )
def step_impl(context):
    print('\n', context.response.content)
    assert context.response.status_code == 200

from behave import *
import requests
import json

@given('I have user authentication credentials')
def step_impl(context):
    context.url = 'https://api.withleaf.io/api/authenticate'
    context.headers = {'content-type': 'application/json'}
    context.data = {"username": "fernandosdba@gmail.com", "password": "94084452", "rememberMe":"true"}

@when('I make an http post call to https://api.withleaf.io/api/authenticate')
def step_impl(context):
    context.response = requests.request("POST" , context.url, json=context.data, headers=context.headers)

@then('I must get a response with status code 200 and a json object with token')
def step_impl(context):
    print("\n" , context.response.content)
    assert context.response.status_code == 200
