Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added data/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added data/__pycache__/urls.cpython-311.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions log_files/logs.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ERROR :: 2023-10-18 00:52:40 :: {'code': 1, 'type': 'error', 'message': 'Pet not found'} :: [file:tests/test_denis/test_example :: line:16]
16 changes: 16 additions & 0 deletions logs/log_2023-10-18_00-52-38.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

----------------------------------------------------------------------------------------------------
Test: tests/test_denis/test_example.py::test_example (call)
Time: 2023-10-18 00:52:40.187697
Request method: GET
Request url: https://petstore.swagger.io/v2/pet/100
Request data: None
Request headers: {'Content-Type': 'application/json'}
Request cookies: {}

Response code: 404
Response text: {"code":1,"type":"error","message":"Pet not found"}
Response headers: {'Date': 'Wed, 18 Oct 2023 07:52:40 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, DELETE, PUT', 'Access-Control-Allow-Headers': 'Content-Type, api_key, Authorization', 'Server': 'Jetty(9.2.9.v20150224)'}
Response cookies: {}

----------------------------------------------------------------------------------------------------
Binary file added pages/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added pages/__pycache__/base_page.cpython-311.pyc
Binary file not shown.
Binary file added src/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added src/utils/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added tests/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added tests/test_kate/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file added tests/test_naiba/__init__.py
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
54 changes: 54 additions & 0 deletions tests/test_naiba/test_pet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import allure_commons
import pytest
import requests

url = "https://petstore3.swagger.io/api/v3"
status_ok = 200

def test_can_call_endpoint():
response = requests.get(url)
assert response.status_code == status_ok
pass

@allure_commons.title("test_get_pets_by_status")
def test_get_pets_by_status():
response = requests.get("https://petstore3.swagger.io/api/v3/pet/findByStatus?status=sold")
print(response.json())
assert response.status_code == status_ok

def test_add_new_pet():
payload = {
"id": 9999,
"name": "lucky",
"category": {
"id": 9999,
"name": "Dogs"
},
"photoUrls": [
"string"
],
"tags": [
{
"id": 9999,
"name": "lucky"
}
],
"status": "available"
}
add_pet_response = requests.post(url + "/pet", json=payload)
assert add_pet_response.status_code == status_ok

#id = response.json()['id']
#get_response = requests.get(f'{url}/{id}')
#assert get_response.json()['name'] == 'lucky'

data = add_pet_response.json()
print(data)








20 changes: 20 additions & 0 deletions tests/test_naiba/test_store.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import pytest
import requests

url = "https://petstore3.swagger.io/api/v3"
status_ok = 200

def test_can_place_an_order():
payload = {
"id": 100,
"petId": 1987729,
"quantity": 9,
"shipDate": "2024-10-18T06:13:20.427Z",
"status": "approved",
"complete": True,
}
response = requests.post(url + '/store/order', json=payload)
assert response.status_code == status_ok

data = response.json()
print(data)
Binary file added tests/test_nata/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added tests/test_vera/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.