From 66932612aaff3b3d4d7ba42cba76202918c2e5e2 Mon Sep 17 00:00:00 2001 From: "kunal.sontakke" Date: Thu, 5 Sep 2024 17:16:44 +0530 Subject: [PATCH] added project into remote repository --- .idea/.gitignore | 3 + .idea/JazzX.iml | 10 + .../inspectionProfiles/profiles_settings.xml | 6 + .idea/misc.xml | 7 + .idea/modules.xml | 8 + API_Requests/Data/Request_Body/post_data.json | 4 + API_Requests/Data/Request_Body/put_data.json | 4 + API_Requests/Data/Response_Body/get_data.json | 13 + API_Requests/Lib/Auth_details.py | 26 + API_Requests/Lib/File_Operations.py | 74 ++ API_Requests/Lib/Rest_Client.py | 254 ++++++ API_Requests/Lib/__init__.py | 0 API_Requests/Tests/__init__.py | 0 API_Requests/Tests/assets/style.css | 319 ++++++++ API_Requests/Tests/test_delete_request.py | 24 + API_Requests/Tests/test_get_request.py | 34 + .../Tests/test_no_data_found_request.py | 31 + API_Requests/Tests/test_post_data_request.py | 26 + API_Requests/Tests/test_post_request.py | 32 + API_Requests/Tests/test_put_request.py | 23 + .../Tests/test_register_unsuccessful.py | 31 + API_Requests/__init__.py | 0 Certificates/reqres.pem.txt | 0 Logs/log_20240905_123259.log | 19 + Logs/log_20240905_141551.log | 19 + Logs/log_20240905_141835.log | 19 + Logs/log_20240905_141908.log | 19 + Logs/log_20240905_141937.log | 19 + Logs/log_20240905_141945.log | 19 + Logs/log_20240905_144405.log | 131 +++ Logs/log_20240905_144418.log | 131 +++ Logs/log_20240905_151553.log | 138 ++++ Logs/log_20240905_151754.log | 138 ++++ Logs/log_20240905_152213.log | 138 ++++ Logs/log_20240905_154322.log | 20 + Logs/log_20240905_154424.log | 20 + Logs/log_20240905_154651.log | 138 ++++ ...01-eb48-4ada-8ece-5db552612b96-result.json | 1 + ...38bf-44d3-9140-1c6d59b0864f-attachment.txt | 20 + ...2029-4844-be40-65134db21569-container.json | 1 + ...655a-4f3c-82d0-c9b8be96901a-attachment.txt | 20 + ...c8e5-4ebc-81cc-fe308b904a2a-attachment.txt | 20 + ...22-9e67-42bb-86a2-6edca016f6c1-result.json | 1 + ...53-0837-42e9-a604-49a24071ed8d-result.json | 1 + ...3fc7-47ae-971a-b9382e210bc2-attachment.txt | 20 + ...531b-4b40-b81a-966ed61337e8-attachment.txt | 20 + ...9939-408c-88d1-4ef3b5efd67a-container.json | 1 + ...31-c961-4912-a207-a46693e23256-result.json | 1 + ...84ea-47ee-92a8-2319708dc768-container.json | 1 + ...7d-ea84-4138-8e32-cee846e6b2bd-result.json | 1 + ...2d-8698-4e61-8cf8-58fb9ae49027-result.json | 1 + ...e152-4f37-aa95-bd41fcddb8e7-attachment.txt | 19 + ...54a8-40da-95fa-078d835ee1ff-container.json | 1 + ...64d5-475c-8f3f-ede4ba856a9d-attachment.txt | 19 + ...208e-4f4b-ba7d-050c82ef4231-container.json | 1 + ...c2-c3b5-41ad-91fc-b3945d45aed4-result.json | 1 + ...9a01-4d38-8812-e7af990fe508-container.json | 1 + ...6d84-4bf2-b676-2a8c1aaced9b-container.json | 1 + Reports/HTML_Reports/assets/style.css | 319 ++++++++ Reports/HTML_Reports/requests_report.html | 770 ++++++++++++++++++ Requirements/Architecture.txt | 46 ++ Requirements/README.txt | 37 + Requirements/Requirements.txt | 19 + assets/style.css | 319 ++++++++ conf/__init__.py | 0 conf/config.ini | 14 + conf/config.py | 16 + conf/conftest.py | 38 + conf/logger.py | 22 + conf/pytest.ini | 11 + 70 files changed, 3660 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/JazzX.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 API_Requests/Data/Request_Body/post_data.json create mode 100644 API_Requests/Data/Request_Body/put_data.json create mode 100644 API_Requests/Data/Response_Body/get_data.json create mode 100644 API_Requests/Lib/Auth_details.py create mode 100644 API_Requests/Lib/File_Operations.py create mode 100644 API_Requests/Lib/Rest_Client.py create mode 100644 API_Requests/Lib/__init__.py create mode 100644 API_Requests/Tests/__init__.py create mode 100644 API_Requests/Tests/assets/style.css create mode 100644 API_Requests/Tests/test_delete_request.py create mode 100644 API_Requests/Tests/test_get_request.py create mode 100644 API_Requests/Tests/test_no_data_found_request.py create mode 100644 API_Requests/Tests/test_post_data_request.py create mode 100644 API_Requests/Tests/test_post_request.py create mode 100644 API_Requests/Tests/test_put_request.py create mode 100644 API_Requests/Tests/test_register_unsuccessful.py create mode 100644 API_Requests/__init__.py create mode 100644 Certificates/reqres.pem.txt create mode 100644 Logs/log_20240905_123259.log create mode 100644 Logs/log_20240905_141551.log create mode 100644 Logs/log_20240905_141835.log create mode 100644 Logs/log_20240905_141908.log create mode 100644 Logs/log_20240905_141937.log create mode 100644 Logs/log_20240905_141945.log create mode 100644 Logs/log_20240905_144405.log create mode 100644 Logs/log_20240905_144418.log create mode 100644 Logs/log_20240905_151553.log create mode 100644 Logs/log_20240905_151754.log create mode 100644 Logs/log_20240905_152213.log create mode 100644 Logs/log_20240905_154322.log create mode 100644 Logs/log_20240905_154424.log create mode 100644 Logs/log_20240905_154651.log create mode 100644 Reports/Allure_Reports/17aeb801-eb48-4ada-8ece-5db552612b96-result.json create mode 100644 Reports/Allure_Reports/23d9e55b-38bf-44d3-9140-1c6d59b0864f-attachment.txt create mode 100644 Reports/Allure_Reports/29a305ae-2029-4844-be40-65134db21569-container.json create mode 100644 Reports/Allure_Reports/32aedb8a-655a-4f3c-82d0-c9b8be96901a-attachment.txt create mode 100644 Reports/Allure_Reports/36edb3d7-c8e5-4ebc-81cc-fe308b904a2a-attachment.txt create mode 100644 Reports/Allure_Reports/52681722-9e67-42bb-86a2-6edca016f6c1-result.json create mode 100644 Reports/Allure_Reports/5853ce53-0837-42e9-a604-49a24071ed8d-result.json create mode 100644 Reports/Allure_Reports/7aec0816-3fc7-47ae-971a-b9382e210bc2-attachment.txt create mode 100644 Reports/Allure_Reports/7f364411-531b-4b40-b81a-966ed61337e8-attachment.txt create mode 100644 Reports/Allure_Reports/825afacb-9939-408c-88d1-4ef3b5efd67a-container.json create mode 100644 Reports/Allure_Reports/96f69c31-c961-4912-a207-a46693e23256-result.json create mode 100644 Reports/Allure_Reports/99933b7a-84ea-47ee-92a8-2319708dc768-container.json create mode 100644 Reports/Allure_Reports/a4b3837d-ea84-4138-8e32-cee846e6b2bd-result.json create mode 100644 Reports/Allure_Reports/aff6372d-8698-4e61-8cf8-58fb9ae49027-result.json create mode 100644 Reports/Allure_Reports/b165887c-e152-4f37-aa95-bd41fcddb8e7-attachment.txt create mode 100644 Reports/Allure_Reports/c1496cde-54a8-40da-95fa-078d835ee1ff-container.json create mode 100644 Reports/Allure_Reports/c6fb5d42-64d5-475c-8f3f-ede4ba856a9d-attachment.txt create mode 100644 Reports/Allure_Reports/e50cb7b3-208e-4f4b-ba7d-050c82ef4231-container.json create mode 100644 Reports/Allure_Reports/e61c76c2-c3b5-41ad-91fc-b3945d45aed4-result.json create mode 100644 Reports/Allure_Reports/eb86f39f-9a01-4d38-8812-e7af990fe508-container.json create mode 100644 Reports/Allure_Reports/fe8d3973-6d84-4bf2-b676-2a8c1aaced9b-container.json create mode 100644 Reports/HTML_Reports/assets/style.css create mode 100644 Reports/HTML_Reports/requests_report.html create mode 100644 Requirements/Architecture.txt create mode 100644 Requirements/README.txt create mode 100644 Requirements/Requirements.txt create mode 100644 assets/style.css create mode 100644 conf/__init__.py create mode 100644 conf/config.ini create mode 100644 conf/config.py create mode 100644 conf/conftest.py create mode 100644 conf/logger.py create mode 100644 conf/pytest.ini diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/JazzX.iml b/.idea/JazzX.iml new file mode 100644 index 0000000..2c80e12 --- /dev/null +++ b/.idea/JazzX.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..c4c81cc --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6085835 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/API_Requests/Data/Request_Body/post_data.json b/API_Requests/Data/Request_Body/post_data.json new file mode 100644 index 0000000..3c28c10 --- /dev/null +++ b/API_Requests/Data/Request_Body/post_data.json @@ -0,0 +1,4 @@ +{ + "name": "morpheus", + "job": "leader" +} \ No newline at end of file diff --git a/API_Requests/Data/Request_Body/put_data.json b/API_Requests/Data/Request_Body/put_data.json new file mode 100644 index 0000000..212bba3 --- /dev/null +++ b/API_Requests/Data/Request_Body/put_data.json @@ -0,0 +1,4 @@ +{ + "name": "morpheus", + "job": "zion resident" +} \ No newline at end of file diff --git a/API_Requests/Data/Response_Body/get_data.json b/API_Requests/Data/Response_Body/get_data.json new file mode 100644 index 0000000..a32fe54 --- /dev/null +++ b/API_Requests/Data/Response_Body/get_data.json @@ -0,0 +1,13 @@ +{ + "data": { + "id": 2, + "email": "janet.weaver@reqres.in", + "first_name": "Janet", + "last_name": "Weaver", + "avatar": "https://reqres.in/img/faces/2-image.jpg" + }, + "support": { + "url": "https://reqres.in/#support-heading", + "text": "To keep ReqRes free, contributions towards server costs are appreciated!" + } +} \ No newline at end of file diff --git a/API_Requests/Lib/Auth_details.py b/API_Requests/Lib/Auth_details.py new file mode 100644 index 0000000..2b535ac --- /dev/null +++ b/API_Requests/Lib/Auth_details.py @@ -0,0 +1,26 @@ +class Auth_Details: + """ + A utility class for handling authentication details like username and password. + This class provides static methods to retrieve the username and password + for authentication purposes. These methods can be used to fetch credentials + when making API requests or connecting to services that require authentication. + """ + + @staticmethod + def get_username(): + """ + Retrieve the username for authentication. + :return: A string representing the username. + """ + username = "kunal.sontakke" + return username + + @staticmethod + def get_password(): + """ + Retrieve the password for authentication. + :return: A string representing the password. + """ + + password = " " + return password diff --git a/API_Requests/Lib/File_Operations.py b/API_Requests/Lib/File_Operations.py new file mode 100644 index 0000000..15907a8 --- /dev/null +++ b/API_Requests/Lib/File_Operations.py @@ -0,0 +1,74 @@ +import json +import os.path +from conf.conftest import logger + + +def save_json_to_file(response,file_path,response_dir='API_Requests/Data/Response_Body'): + """ + Prepare the response data and save it to a JSON file. + + :param response_dir: The response directory where all response file will be stored + :param response: The response data to be saved, can be a dict, list, tuple, or string. + :param file_path: Path to the file where the JSON data will be saved. + + """ + + def handle_tuple(data): + return data[0] + + def handle_list(data): + return data + + def handle_string(data): + return json.loads(data) + + def handle_dict(data): + return data + # Mapping of types to their corresponding handling functions + handler_mapping = { + tuple: handle_tuple, + list : handle_list, + str : handle_string, + dict : handle_dict + } + + try: + # Select the handler based on the type of response + handler = handler_mapping.get(type(response)) + if not handler: + raise TypeError("Unsupported response type") + json_data = handler(response) + # Save the JSON data to the specified file + full_path = os.path.join(response_dir, file_path) + with open(full_path,'w') as file: + json.dump(json_data, file, indent=4, separators=(',',': ')) + logger.info(f"JSON data successfully saved to {full_path}") + except (json.JSONDecodeError, TypeError) as e: + logger.error(f"An error occurred while preparing JSON data:{e}") + raise e + except OSError as e: + logger.error(f"An error occurred while saving JSON data:{e}") + raise e + + +def read_json_from_file(file_path,request_dir='API_Requests/Data/Request_Body'): + """ Static method to read JSON data from a file. + :param request_dir: directory where the request json data is stored. + :param file_path: Path to the file from which the JSON data will be read. + :return: Parsed JSON data (as a dictionary or list). + """ + try: + full_path = os.path.join(request_dir,file_path) + with open(full_path, 'r') as file: + data = json.load(file) + logger.info(f"JSON data successfully read from {full_path}") + return data + except json.JSONDecodeError as e: + logger.error(f"Failed to decode JSON: {e}") + raise e + except FileNotFoundError as e: + logger.error(f"File not found: {e}") + raise e + except Exception as e: + logger.exception(f"An error occurred while reading JSON data: {e}") + raise e diff --git a/API_Requests/Lib/Rest_Client.py b/API_Requests/Lib/Rest_Client.py new file mode 100644 index 0000000..b319eb2 --- /dev/null +++ b/API_Requests/Lib/Rest_Client.py @@ -0,0 +1,254 @@ +import time +import requests +import json +from conf.logger import logGen + +logger = logGen() + + +class RestClient: + def __init__(self, base_url, headers=None): + self.base_url = base_url + self.http_session = requests.Session() + self.http_session.headers = headers + self.http_session.verify = True + + + logger.info(f"Base url is : {self.base_url}") + self.success_status_code = (200, 201, 202, 204) + + + def get_request(self, end_point=None, data=None, headers=None, json_data_fmt=False, params=None, fmt='json', + retries=0, response_with_status_code=False,verify=True): + """ + This method is to send 'Get' request + :param end_point(str): API endpoint/url + :param data (dict) : Body of Request + :param headers: Header of a request + :param json_data_fmt (bool): True if data should be in json else False + :param params (dict) : Parameter for a request + :param fmt: used for return response type + :param retries: + :param response_with_status_code (bool): True if status code is required else false + :return: + + """ + if end_point is None: + request_url = self.base_url + else: + request_url = self.base_url + end_point + + + logger.info(f"Request url is : {request_url}") + if json_data_fmt: + data = json.dumps(data) + + try: + logger.info(f"Initializing GET rest call from {request_url}") + get_response = self.http_session.get(request_url, params=params, headers=headers, + data=data, verify=True) + logger.info(f"GET Response : {self.parse_response(get_response)}") + logger.info(f"GET Request Status Code : {get_response.status_code}") + if get_response.status_code in self.success_status_code: + logger.info("GET request is Successful.....") + if fmt == "raw": + return get_response + if response_with_status_code: + return self.parse_response(get_response), get_response.status_code + return self.parse_response(get_response) + else: + logger.error(f"GET Request failed....!!!") + logger.error(f"Response Error Message: {self.parse_response(get_response)}") + return self.parse_response(get_response), get_response.status_code + except Exception as exc: + if retries > 0: + logger.info(f"GET request failed, retrying : {str(retries)} more times...") + time.sleep(15) + self.get_request(end_point=end_point, params=params, headers=headers, data=data, + json_data_fmt=json_data_fmt, retries=retries - 1) + + else: + logger.info(f"GET request failed...") + logger.exception(f"Exception occurred : {exc}") + raise exc + + + def post_request(self, end_point, data=None, headers=None, json_data_fmt=False, params=None, + fmt='json', retries=1, response_with_status_code=False): + """ + This method is used to send 'POST' Request + :param end_point: API end point/url + :param data: Body of a Request + :param headers (dict) : Header of a request + :param json_data_fmt: True if data should be in json else false + :param params (dict): Parameters of a request + :param fmt(str) : Used for response type json or row + :param retries: Number of Retires + :param response_with_status_code(bool): True if status code is required else false + :return: response of the request + + """ + request_url = self.base_url + end_point + logger.info(f"Request url is : {request_url}") + if json_data_fmt: + data = json.dumps(data) + + try: + logger.info(f"Initializing POST rest call from {request_url}") + post_response = self.http_session.post(request_url, params=params, headers=headers, data=data, verify=True) + logger.info(f"POST Response : {self.parse_response(post_response)}") + logger.info(f"POST Request Status Code : {post_response.status_code}") + if post_response.status_code in self.success_status_code: + logger.info(f"POST Request Status Code : {post_response.status_code}") + if post_response.status_code in self.success_status_code: + logger.info("POST request is successful...") + if fmt == 'raw': + return post_response + if response_with_status_code: + return self.parse_response(post_response), post_response.status_code + return self.parse_response(post_response) + + else: + logger.error(f"POST Request Failed") + logger.error(f"Response Error message: {self.parse_response(post_response)}") + return self.parse_response(post_response), post_response.status_code + except Exception as exc: + if retries > 0: + logger.info(f"POST request failed,retrying: {str(retries)} more times...") + logger.info("Waiting for 15 sec....") + time.sleep(15) + self.post_request(end_point=end_point, data=data, headers=headers, + json_data_fmt=json_data_fmt, fmt=fmt, retries=retries - 1) + else: + logger.info("POST request failed...!!!") + logger.exception(f"Exception Occurred : {exc}") + + + def put_request(self, end_point, data=None, headers=None, json_data_fmt=False, params=None, + fmt="json", response_with_status_code=False): + """ + This method is to send put request + :param end_point (str): API endpoint/url + :param data (dict): Body of a request + :param headers (dict): Headers of a request + :param json_data_fmt (bool): True if data should be in json else False + :param params (dict): parameters for a request + :param fmt(str): Used for response type json or raw + :param response_with_status_code (bool): True if status code os required else False + :return: response of the request + + """ + request_url = self.base_url + end_point + + + logger.info(f"Request url is : {request_url}") + if json_data_fmt: + data = json.dumps(data) + + try: + logger.info(f"Initializing PUT rest call from {request_url}") + put_response = self.http_session.put(request_url, params=params, headers=headers, + data=data,verify=True) + logger.info(f"PUT Response : {self.parse_response(put_response)}") + logger.info(f"PUT request Status code : {put_response.status_code}") + if put_response.status_code in self.success_status_code: + logger.info("PUT request is successful.....") + if fmt == "raw": + return put_response + if response_with_status_code: + return self.parse_response(put_response), put_response.status_code + return self.parse_response(put_response) + else: + logger.error(f"PUT request Failed....") + logger.error(f"Response Error Message: {self.parse_response(put_response)}") + return self.parse_response(put_response), put_response.status_code + except Exception as exc: + logger.info("PUT Request is failed...!!!") + logger.exception(f"Exception Occurred : {exc}") + + + def delete_request(self, end_point, data=None, headers=None, json_data_fmt=None, params=None, + fmt="json", response_with_status_code=False): + """ + This method is to send delete request + :param end_point (str): API endpoint/URL + :param data (dict): Body of a request + :param headers (dict): Parameters for a request + :param json_data_fmt (bool): True if data should be in json else False + :param params: Used for response type json or raw + :param fmt: + :param response_with_status_coode (bool): True if Status code os required else False + :return: Response of the request + + """ + request_url = self.base_url + end_point + + logger.info(f"Request url is : {request_url}") + if json_data_fmt: + data = json.dumps(data) + try: + logger.info(f"Initializing DELETE REST call from {request_url}") + delete_response = self.http_session.delete(request_url, params=params, headers=headers, data=data,verify=True) + logger.info(f"DELETE Response : {self.parse_response(delete_response)}") + logger.info(f"DELETE request Status code : {delete_response.status_code}") + if delete_response.status_code in self.success_status_code: + logger.info(f"DELETE request is successful....") + if fmt == "raw": + return delete_response + if response_with_status_code: + return self.parse_response(delete_response), delete_response.status_code + return self.parse_response(delete_response) + else: + logger.error(f"PUT request Failed...!!!") + logger.error(f"Response Error Message: {self.parse_response(delete_response)}") + return self.parse_response(delete_response), delete_response.status_code + + except Exception as exc: + logger.info("DELETE request is failed...!!!") + logger.exception(f"Exception occurred : {exc}") + + + def parse_response(self, response): + """ + This method is to parse a response from the API. + :param response: request response + :return: parsed response based on expected format + """ + try: + # Check if the response is a requests.Response object + if hasattr(response, 'headers'): + content_type = response.headers.get('Content-Type') + # Handle JSON responses + if content_type in ['application/json', 'application/json; charset=utf-8']: + logger.info(f"Response JSON : {response.text}") + try: + return response.json() + except ValueError: + logger.error("Response content is not valid JSON.") + return None + # Handle non-JSON responses (text, HTML, etc.) + # elif response.text: + # logger.info(f"Response Text : {response.text}") + # return response.text + + else: + # For DELETE requests with no response content + if response.request.method.upper() == 'DELETE' and not response.content: + logger.info("DELETE request sent successfully, no response content returned.") + return None + + logger.error("Unknown content type or empty response.") + return None + + # If response is directly passed (like list, str, tuple) + elif isinstance(response, (list, str, tuple, dict)): + return response + + else: + logger.error("Unexpected response type encountered.") + return None + + except Exception as exc: + logger.exception(f"Failed to parse response: {str(exc)}") + time.sleep(5) + raise exc diff --git a/API_Requests/Lib/__init__.py b/API_Requests/Lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/API_Requests/Tests/__init__.py b/API_Requests/Tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/API_Requests/Tests/assets/style.css b/API_Requests/Tests/assets/style.css new file mode 100644 index 0000000..561524c --- /dev/null +++ b/API_Requests/Tests/assets/style.css @@ -0,0 +1,319 @@ +body { + font-family: Helvetica, Arial, sans-serif; + font-size: 12px; + /* do not increase min-width as some may use split screens */ + min-width: 800px; + color: #999; +} + +h1 { + font-size: 24px; + color: black; +} + +h2 { + font-size: 16px; + color: black; +} + +p { + color: black; +} + +a { + color: #999; +} + +table { + border-collapse: collapse; +} + +/****************************** + * SUMMARY INFORMATION + ******************************/ +#environment td { + padding: 5px; + border: 1px solid #e6e6e6; + vertical-align: top; +} +#environment tr:nth-child(odd) { + background-color: #f6f6f6; +} +#environment ul { + margin: 0; + padding: 0 20px; +} + +/****************************** + * TEST RESULT COLORS + ******************************/ +span.passed, +.passed .col-result { + color: green; +} + +span.skipped, +span.xfailed, +span.rerun, +.skipped .col-result, +.xfailed .col-result, +.rerun .col-result { + color: orange; +} + +span.error, +span.failed, +span.xpassed, +.error .col-result, +.failed .col-result, +.xpassed .col-result { + color: red; +} + +.col-links__extra { + margin-right: 3px; +} + +/****************************** + * RESULTS TABLE + * + * 1. Table Layout + * 2. Extra + * 3. Sorting items + * + ******************************/ +/*------------------ + * 1. Table Layout + *------------------*/ +#results-table { + border: 1px solid #e6e6e6; + color: #999; + font-size: 12px; + width: 100%; +} +#results-table th, +#results-table td { + padding: 5px; + border: 1px solid #e6e6e6; + text-align: left; +} +#results-table th { + font-weight: bold; +} + +/*------------------ + * 2. Extra + *------------------*/ +.logwrapper { + max-height: 230px; + overflow-y: scroll; + background-color: #e6e6e6; +} +.logwrapper.expanded { + max-height: none; +} +.logwrapper.expanded .logexpander:after { + content: "collapse [-]"; +} +.logwrapper .logexpander { + z-index: 1; + position: sticky; + top: 10px; + width: max-content; + border: 1px solid; + border-radius: 3px; + padding: 5px 7px; + margin: 10px 0 10px calc(100% - 80px); + cursor: pointer; + background-color: #e6e6e6; +} +.logwrapper .logexpander:after { + content: "expand [+]"; +} +.logwrapper .logexpander:hover { + color: #000; + border-color: #000; +} +.logwrapper .log { + min-height: 40px; + position: relative; + top: -50px; + height: calc(100% + 50px); + border: 1px solid #e6e6e6; + color: black; + display: block; + font-family: "Courier New", Courier, monospace; + padding: 5px; + padding-right: 80px; + white-space: pre-wrap; +} + +div.media { + border: 1px solid #e6e6e6; + float: right; + height: 240px; + margin: 0 5px; + overflow: hidden; + width: 320px; +} + +.media-container { + display: grid; + grid-template-columns: 25px auto 25px; + align-items: center; + flex: 1 1; + overflow: hidden; + height: 200px; +} + +.media-container--fullscreen { + grid-template-columns: 0px auto 0px; +} + +.media-container__nav--right, +.media-container__nav--left { + text-align: center; + cursor: pointer; +} + +.media-container__viewport { + cursor: pointer; + text-align: center; + height: inherit; +} +.media-container__viewport img, +.media-container__viewport video { + object-fit: cover; + width: 100%; + max-height: 100%; +} + +.media__name, +.media__counter { + display: flex; + flex-direction: row; + justify-content: space-around; + flex: 0 0 25px; + align-items: center; +} + +.collapsible td:not(.col-links) { + cursor: pointer; +} +.collapsible td:not(.col-links):hover::after { + color: #bbb; + font-style: italic; + cursor: pointer; +} + +.col-result { + width: 130px; +} +.col-result:hover::after { + content: " (hide details)"; +} + +.col-result.collapsed:hover::after { + content: " (show details)"; +} + +#environment-header h2:hover::after { + content: " (hide details)"; + color: #bbb; + font-style: italic; + cursor: pointer; + font-size: 12px; +} + +#environment-header.collapsed h2:hover::after { + content: " (show details)"; + color: #bbb; + font-style: italic; + cursor: pointer; + font-size: 12px; +} + +/*------------------ + * 3. Sorting items + *------------------*/ +.sortable { + cursor: pointer; +} +.sortable.desc:after { + content: " "; + position: relative; + left: 5px; + bottom: -12.5px; + border: 10px solid #4caf50; + border-bottom: 0; + border-left-color: transparent; + border-right-color: transparent; +} +.sortable.asc:after { + content: " "; + position: relative; + left: 5px; + bottom: 12.5px; + border: 10px solid #4caf50; + border-top: 0; + border-left-color: transparent; + border-right-color: transparent; +} + +.hidden, .summary__reload__button.hidden { + display: none; +} + +.summary__data { + flex: 0 0 550px; +} +.summary__reload { + flex: 1 1; + display: flex; + justify-content: center; +} +.summary__reload__button { + flex: 0 0 300px; + display: flex; + color: white; + font-weight: bold; + background-color: #4caf50; + text-align: center; + justify-content: center; + align-items: center; + border-radius: 3px; + cursor: pointer; +} +.summary__reload__button:hover { + background-color: #46a049; +} +.summary__spacer { + flex: 0 0 550px; +} + +.controls { + display: flex; + justify-content: space-between; +} + +.filters, +.collapse { + display: flex; + align-items: center; +} +.filters button, +.collapse button { + color: #999; + border: none; + background: none; + cursor: pointer; + text-decoration: underline; +} +.filters button:hover, +.collapse button:hover { + color: #ccc; +} + +.filter__label { + margin-right: 10px; +} diff --git a/API_Requests/Tests/test_delete_request.py b/API_Requests/Tests/test_delete_request.py new file mode 100644 index 0000000..840aa21 --- /dev/null +++ b/API_Requests/Tests/test_delete_request.py @@ -0,0 +1,24 @@ +from API_Requests.Lib.Rest_Client import RestClient +from conf.config import get_config +from conf.logger import logGen +from conf.conftest import setup_teardown + +logging = logGen() + + +class Test_004: + def test_004(self,setup_teardown): + """Test to resource is deleted from Backend """ + self.base_url = get_config()['API']['base_url'] + self.client = RestClient(self.base_url) + self.headers = { + 'Content-Type':'application/json' + } + + logging.info("*********** executing test_004 ****************") + + # send delete request + delete_request = self.client.delete_request(end_point="objects/6",headers=self.headers,json_data_fmt=True,response_with_status_code=True) + + # verify to get response + assert delete_request is not None, "DELETE request returned None" diff --git a/API_Requests/Tests/test_get_request.py b/API_Requests/Tests/test_get_request.py new file mode 100644 index 0000000..241c959 --- /dev/null +++ b/API_Requests/Tests/test_get_request.py @@ -0,0 +1,34 @@ +from API_Requests.Lib.Rest_Client import RestClient +from conf.config import get_config +from conf.logger import logGen +from conf.conftest import setup_teardown +from API_Requests.Lib.File_Operations import save_json_to_file + + +logger = logGen() + + +class Test_001: + def test_001(self,setup_teardown): + + """" Test to check GET Request is successful with response and successful status code""" + + self.base_url = get_config()['API']['base_url'] + self.client = RestClient(self.base_url) + + self.headers = { + 'Content-Type' : 'application/json' + } + + logger.info("*********** executing test_001 ****************") + + # send get request + get_request,status_code = self.client.get_request(end_point="users/2", headers=self.headers,response_with_status_code=True,json_data_fmt=True) + + # verify response is not None (json) + assert get_request is not None, "GET request returned None" + + logger.info(f"type of json response : {type(self.client.parse_response(get_request))}") + + # saving response into json file + save_json_to_file(get_request,'get_data.json') diff --git a/API_Requests/Tests/test_no_data_found_request.py b/API_Requests/Tests/test_no_data_found_request.py new file mode 100644 index 0000000..e896909 --- /dev/null +++ b/API_Requests/Tests/test_no_data_found_request.py @@ -0,0 +1,31 @@ +from API_Requests.Lib.Rest_Client import RestClient, logger +from conf.config import get_config +from conf.logger import logGen +from conf.conftest import setup_teardown +from API_Requests.Lib.File_Operations import save_json_to_file + + +logging = logGen() + + +class Test_001: + def test_001(self,setup_teardown): + + """" Test to check GET Request is successful with response and successful status code""" + + self.base_url = get_config()['API']['base_url'] + self.client = RestClient(self.base_url) + + self.headers = { + 'Content-Type' : 'application/json' + } + + logging.info("*********** executing test_001 ****************") + + get_request,status_code = self.client.get_request(end_point="unknown/23", headers=self.headers,response_with_status_code=True,json_data_fmt=True) + + assert get_request is not None, "GET request returned None" + + logger.info(f"type of json response : {type(self.client.parse_response(get_request))}") + assert status_code == 200 + save_json_to_file(get_request,'get_data.json') diff --git a/API_Requests/Tests/test_post_data_request.py b/API_Requests/Tests/test_post_data_request.py new file mode 100644 index 0000000..9dc5508 --- /dev/null +++ b/API_Requests/Tests/test_post_data_request.py @@ -0,0 +1,26 @@ +from API_Requests.Lib.Rest_Client import RestClient +from conf.config import get_config +from conf.logger import logGen +from conf.conftest import setup_teardown +from API_Requests.Lib.File_Operations import read_json_from_file + +logger = logGen() + + +class Test_005: + def test_005(self,setup_teardown): + """" Test to check POST Request is successful to add new resource into server""" + + self.base_url = get_config()['API']['base_url'] + self.client = RestClient(self.base_url) + self.json = read_json_from_file('post_data.json') + + self.headers = { + 'Content-Type': 'application/json' + } + + logger.info("*********** executing test_005 ****************") + + post_request = self.client.post_request(end_point="users",data=self.json,headers=self.headers,json_data_fmt=True,response_with_status_code=True) + + assert post_request is not None, "POST request returned None" diff --git a/API_Requests/Tests/test_post_request.py b/API_Requests/Tests/test_post_request.py new file mode 100644 index 0000000..45816ba --- /dev/null +++ b/API_Requests/Tests/test_post_request.py @@ -0,0 +1,32 @@ +from API_Requests.Lib.Rest_Client import RestClient +from conf.config import get_config +from conf.logger import logGen +from conf.conftest import setup_teardown + +logger = logGen() + + +class Test_002: + def test_002(self,setup_teardown): + """" Test to check POST Request is successful to add new resource into server""" + + self.base_url = get_config()['API']['base_url'] + self.client = RestClient(self.base_url) + self.json = { + "name": "morpheus", + "job": "leader" + } + + + headers ={ + 'Content-Type' : 'application/json' + } + + logger.info("*********** executing test_002 ****************") + + # send post request + post_request = self.client.post_request(end_point="users", data=self.json, json_data_fmt=True, response_with_status_code=True,headers=headers) + + # verify response + assert post_request is not None, "POST request returned None" + diff --git a/API_Requests/Tests/test_put_request.py b/API_Requests/Tests/test_put_request.py new file mode 100644 index 0000000..89a3fff --- /dev/null +++ b/API_Requests/Tests/test_put_request.py @@ -0,0 +1,23 @@ +from API_Requests.Lib.Rest_Client import RestClient +from conf.config import get_config +from conf.logger import logGen +from conf.conftest import setup_teardown +from API_Requests.Lib.File_Operations import read_json_from_file +logger = logGen() + + +class Test_003: + def test_003(self,setup_teardown): + self.base_url = get_config()['API']['base_url'] + self.client = RestClient(self.base_url) + self.json = read_json_from_file('put_data.json') + + self.headers = { + 'Content-Type' : 'application/json' + } + + logger.info("*********** executing test_003 ****************") + + put_request = self.client.put_request(end_point="users/2",data=self.json,headers=self.headers, json_data_fmt=True,response_with_status_code=True) + + assert put_request is not None, "PUT request returned None" diff --git a/API_Requests/Tests/test_register_unsuccessful.py b/API_Requests/Tests/test_register_unsuccessful.py new file mode 100644 index 0000000..a126935 --- /dev/null +++ b/API_Requests/Tests/test_register_unsuccessful.py @@ -0,0 +1,31 @@ +from jinja2.nodes import Assign + +from API_Requests.Lib.Rest_Client import RestClient +from conf.config import get_config +from conf.logger import logGen +from conf.conftest import setup_teardown +from API_Requests.Lib.File_Operations import read_json_from_file + +logger = logGen() + + +class Test_007: + def test_007(self,setup_teardown): + """" Test to check POST Request to register successfully """ + + self.base_url = get_config()['API']['base_url'] + self.client = RestClient(self.base_url) + self.json = { + "email": "sydney@fife" + } + + self.headers = { + 'Content-Type': 'application/json' + } + + logger.info("*********** executing test_007 ****************") + + post_request,status_code = self.client.post_request(end_point="register",data=self.json,headers=self.headers,json_data_fmt=True,response_with_status_code=True) + + assert post_request is not None, "POST request returned None" + assert status_code == 201 \ No newline at end of file diff --git a/API_Requests/__init__.py b/API_Requests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Certificates/reqres.pem.txt b/Certificates/reqres.pem.txt new file mode 100644 index 0000000..e69de29 diff --git a/Logs/log_20240905_123259.log b/Logs/log_20240905_123259.log new file mode 100644 index 0000000..fc3d1f5 --- /dev/null +++ b/Logs/log_20240905_123259.log @@ -0,0 +1,19 @@ +2024-09-05 12:32:59,251 INFO ===================Setup Initialised======================== +2024-09-05 12:32:59,251 INFO creating driver instance created +2024-09-05 12:32:59,267 INFO Base url is : https://reqres.in/api/ +2024-09-05 12:32:59,267 INFO ===================Setup Completed========================== +2024-09-05 12:32:59,267 INFO Base url is : https://reqres.in/api/ +2024-09-05 12:32:59,267 INFO *********** executing test_001 **************** +2024-09-05 12:32:59,267 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 12:32:59,267 INFO Initializing GET rest call from https://reqres.in/api/users/2 +2024-09-05 12:32:59,394 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 12:32:59,394 INFO GET Response : {'data': {'id': 2, 'email': 'janet.weaver@reqres.in', 'first_name': 'Janet', 'last_name': 'Weaver', 'avatar': 'https://reqres.in/img/faces/2-image.jpg'}, 'support': {'url': 'https://reqres.in/#support-heading', 'text': 'To keep ReqRes free, contributions towards server costs are appreciated!'}} +2024-09-05 12:32:59,394 INFO GET Request Status Code : 200 +2024-09-05 12:32:59,394 INFO GET request is Successful..... +2024-09-05 12:32:59,394 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 12:32:59,394 INFO type of json response : +2024-09-05 12:32:59,394 INFO JSON data successfully saved to get_data.json +2024-09-05 12:32:59,394 INFO ===================Teardown Initialised===================== +2024-09-05 12:32:59,394 INFO Clean-up started +2024-09-05 12:32:59,394 INFO clean completed +2024-09-05 12:32:59,394 INFO ===================Teardown Completed======================= diff --git a/Logs/log_20240905_141551.log b/Logs/log_20240905_141551.log new file mode 100644 index 0000000..fa072bf --- /dev/null +++ b/Logs/log_20240905_141551.log @@ -0,0 +1,19 @@ +2024-09-05 14:15:51,763 INFO ===================Setup Initialised======================== +2024-09-05 14:15:51,763 INFO creating driver instance created +2024-09-05 14:15:51,763 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:15:51,763 INFO ===================Setup Completed========================== +2024-09-05 14:15:51,763 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:15:51,763 INFO *********** executing test_001 **************** +2024-09-05 14:15:51,763 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 14:15:51,763 INFO Initializing GET rest call from https://reqres.in/api/users/2 +2024-09-05 14:15:51,921 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 14:15:51,921 INFO GET Response : {'data': {'id': 2, 'email': 'janet.weaver@reqres.in', 'first_name': 'Janet', 'last_name': 'Weaver', 'avatar': 'https://reqres.in/img/faces/2-image.jpg'}, 'support': {'url': 'https://reqres.in/#support-heading', 'text': 'To keep ReqRes free, contributions towards server costs are appreciated!'}} +2024-09-05 14:15:51,921 INFO GET Request Status Code : 200 +2024-09-05 14:15:51,921 INFO GET request is Successful..... +2024-09-05 14:15:51,921 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 14:15:51,921 INFO type of json response : +2024-09-05 14:15:51,921 INFO JSON data successfully saved to API_Requests/Data/Response_Body\get_data.json +2024-09-05 14:15:51,921 INFO ===================Teardown Initialised===================== +2024-09-05 14:15:51,921 INFO Clean-up started +2024-09-05 14:15:51,921 INFO clean completed +2024-09-05 14:15:51,921 INFO ===================Teardown Completed======================= diff --git a/Logs/log_20240905_141835.log b/Logs/log_20240905_141835.log new file mode 100644 index 0000000..5246dcf --- /dev/null +++ b/Logs/log_20240905_141835.log @@ -0,0 +1,19 @@ +2024-09-05 14:18:35,943 INFO ===================Setup Initialised======================== +2024-09-05 14:18:35,943 INFO creating driver instance created +2024-09-05 14:18:35,943 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:18:35,943 INFO ===================Setup Completed========================== +2024-09-05 14:18:35,954 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:18:35,954 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 14:18:35,954 INFO *********** executing test_005 **************** +2024-09-05 14:18:35,954 INFO Request url is : https://reqres.in/api/users +2024-09-05 14:18:35,971 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 14:18:36,421 INFO Response JSON : {"name":"morpheus","job":"leader","id":"402","createdAt":"2024-09-05T08:47:03.680Z"} +2024-09-05 14:18:36,421 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '402', 'createdAt': '2024-09-05T08:47:03.680Z'} +2024-09-05 14:18:36,421 INFO POST Request Status Code : 201 +2024-09-05 14:18:36,421 INFO POST Request Status Code : 201 +2024-09-05 14:18:36,421 INFO POST request is successful... +2024-09-05 14:18:36,421 INFO Response JSON : {"name":"morpheus","job":"leader","id":"402","createdAt":"2024-09-05T08:47:03.680Z"} +2024-09-05 14:18:36,426 INFO ===================Teardown Initialised===================== +2024-09-05 14:18:36,426 INFO Clean-up started +2024-09-05 14:18:36,426 INFO clean completed +2024-09-05 14:18:36,426 INFO ===================Teardown Completed======================= diff --git a/Logs/log_20240905_141908.log b/Logs/log_20240905_141908.log new file mode 100644 index 0000000..e134f03 --- /dev/null +++ b/Logs/log_20240905_141908.log @@ -0,0 +1,19 @@ +2024-09-05 14:19:08,636 INFO ===================Setup Initialised======================== +2024-09-05 14:19:08,636 INFO creating driver instance created +2024-09-05 14:19:08,636 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:19:08,645 INFO ===================Setup Completed========================== +2024-09-05 14:19:08,645 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:19:08,645 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 14:19:08,645 INFO *********** executing test_005 **************** +2024-09-05 14:19:08,645 INFO Request url is : https://reqres.in/api/users +2024-09-05 14:19:08,663 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 14:19:09,091 INFO Response JSON : {"name":"morpheus","job":"leader","id":"230","createdAt":"2024-09-05T08:47:36.372Z"} +2024-09-05 14:19:09,091 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '230', 'createdAt': '2024-09-05T08:47:36.372Z'} +2024-09-05 14:19:09,091 INFO POST Request Status Code : 201 +2024-09-05 14:19:09,091 INFO POST Request Status Code : 201 +2024-09-05 14:19:09,091 INFO POST request is successful... +2024-09-05 14:19:09,091 INFO Response JSON : {"name":"morpheus","job":"leader","id":"230","createdAt":"2024-09-05T08:47:36.372Z"} +2024-09-05 14:19:09,091 INFO ===================Teardown Initialised===================== +2024-09-05 14:19:09,091 INFO Clean-up started +2024-09-05 14:19:09,091 INFO clean completed +2024-09-05 14:19:09,091 INFO ===================Teardown Completed======================= diff --git a/Logs/log_20240905_141937.log b/Logs/log_20240905_141937.log new file mode 100644 index 0000000..498a8d1 --- /dev/null +++ b/Logs/log_20240905_141937.log @@ -0,0 +1,19 @@ +2024-09-05 14:19:37,369 INFO ===================Setup Initialised======================== +2024-09-05 14:19:37,369 INFO creating driver instance created +2024-09-05 14:19:37,369 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:19:37,369 INFO ===================Setup Completed========================== +2024-09-05 14:19:37,369 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:19:37,378 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 14:19:37,378 INFO *********** executing test_005 **************** +2024-09-05 14:19:37,378 INFO Request url is : https://reqres.in/api/users +2024-09-05 14:19:37,378 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 14:19:37,854 INFO Response JSON : {"name":"morpheus","job":"leader","id":"1","createdAt":"2024-09-05T08:48:05.086Z"} +2024-09-05 14:19:37,854 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '1', 'createdAt': '2024-09-05T08:48:05.086Z'} +2024-09-05 14:19:37,854 INFO POST Request Status Code : 201 +2024-09-05 14:19:37,854 INFO POST Request Status Code : 201 +2024-09-05 14:19:37,854 INFO POST request is successful... +2024-09-05 14:19:37,854 INFO Response JSON : {"name":"morpheus","job":"leader","id":"1","createdAt":"2024-09-05T08:48:05.086Z"} +2024-09-05 14:19:37,854 INFO ===================Teardown Initialised===================== +2024-09-05 14:19:37,854 INFO Clean-up started +2024-09-05 14:19:37,854 INFO clean completed +2024-09-05 14:19:37,854 INFO ===================Teardown Completed======================= diff --git a/Logs/log_20240905_141945.log b/Logs/log_20240905_141945.log new file mode 100644 index 0000000..cae81eb --- /dev/null +++ b/Logs/log_20240905_141945.log @@ -0,0 +1,19 @@ +2024-09-05 14:19:45,962 INFO ===================Setup Initialised======================== +2024-09-05 14:19:45,962 INFO creating driver instance created +2024-09-05 14:19:45,962 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:19:45,962 INFO ===================Setup Completed========================== +2024-09-05 14:19:45,962 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:19:45,962 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 14:19:45,962 INFO *********** executing test_005 **************** +2024-09-05 14:19:45,962 INFO Request url is : https://reqres.in/api/users +2024-09-05 14:19:45,983 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 14:19:46,357 INFO Response JSON : {"name":"morpheus","job":"leader","id":"444","createdAt":"2024-09-05T08:48:13.662Z"} +2024-09-05 14:19:46,357 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '444', 'createdAt': '2024-09-05T08:48:13.662Z'} +2024-09-05 14:19:46,357 INFO POST Request Status Code : 201 +2024-09-05 14:19:46,357 INFO POST Request Status Code : 201 +2024-09-05 14:19:46,357 INFO POST request is successful... +2024-09-05 14:19:46,357 INFO Response JSON : {"name":"morpheus","job":"leader","id":"444","createdAt":"2024-09-05T08:48:13.662Z"} +2024-09-05 14:19:46,357 INFO ===================Teardown Initialised===================== +2024-09-05 14:19:46,357 INFO Clean-up started +2024-09-05 14:19:46,357 INFO clean completed +2024-09-05 14:19:46,357 INFO ===================Teardown Completed======================= diff --git a/Logs/log_20240905_144405.log b/Logs/log_20240905_144405.log new file mode 100644 index 0000000..7c4e272 --- /dev/null +++ b/Logs/log_20240905_144405.log @@ -0,0 +1,131 @@ +2024-09-05 14:44:05,780 INFO ===================Setup Initialised======================== +2024-09-05 14:44:05,780 INFO creating driver instance created +2024-09-05 14:44:05,780 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:05,780 INFO ===================Setup Completed========================== +2024-09-05 14:44:05,780 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:05,788 INFO *********** executing test_004 **************** +2024-09-05 14:44:05,788 INFO Request url is : https://reqres.in/api/objects/6 +2024-09-05 14:44:05,788 INFO Initializing DELETE REST call from https://reqres.in/api/objects/6 +2024-09-05 14:44:06,302 ERROR Unknown content type or empty response. +2024-09-05 14:44:06,302 INFO DELETE Response : None +2024-09-05 14:44:06,302 INFO DELETE request Status code : 400 +2024-09-05 14:44:06,302 ERROR PUT request Failed...!!! +2024-09-05 14:44:06,302 ERROR Unknown content type or empty response. +2024-09-05 14:44:06,302 ERROR Response Error Message: None +2024-09-05 14:44:06,302 ERROR Unknown content type or empty response. +2024-09-05 14:44:06,302 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:06,302 INFO Clean-up started +2024-09-05 14:44:06,302 INFO clean completed +2024-09-05 14:44:06,302 INFO ===================Teardown Completed======================= +2024-09-05 14:44:06,302 INFO ===================Setup Initialised======================== +2024-09-05 14:44:06,302 INFO creating driver instance created +2024-09-05 14:44:06,311 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:06,311 INFO ===================Setup Completed========================== +2024-09-05 14:44:06,311 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:06,311 INFO *********** executing test_001 **************** +2024-09-05 14:44:06,311 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 14:44:06,311 INFO Initializing GET rest call from https://reqres.in/api/users/2 +2024-09-05 14:44:06,397 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 14:44:06,397 INFO GET Response : {'data': {'id': 2, 'email': 'janet.weaver@reqres.in', 'first_name': 'Janet', 'last_name': 'Weaver', 'avatar': 'https://reqres.in/img/faces/2-image.jpg'}, 'support': {'url': 'https://reqres.in/#support-heading', 'text': 'To keep ReqRes free, contributions towards server costs are appreciated!'}} +2024-09-05 14:44:06,397 INFO GET Request Status Code : 200 +2024-09-05 14:44:06,397 INFO GET request is Successful..... +2024-09-05 14:44:06,397 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 14:44:06,397 INFO type of json response : +2024-09-05 14:44:06,397 INFO JSON data successfully saved toAPI_Requests/Data/Request_Body\get_data.json +2024-09-05 14:44:06,397 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:06,407 INFO Clean-up started +2024-09-05 14:44:06,407 INFO clean completed +2024-09-05 14:44:06,407 INFO ===================Teardown Completed======================= +2024-09-05 14:44:06,407 INFO ===================Setup Initialised======================== +2024-09-05 14:44:06,407 INFO creating driver instance created +2024-09-05 14:44:06,407 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:06,407 INFO ===================Setup Completed========================== +2024-09-05 14:44:06,407 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:06,407 INFO *********** executing test_001 **************** +2024-09-05 14:44:06,407 INFO Request url is : https://reqres.in/api/unknown/23 +2024-09-05 14:44:06,407 INFO Initializing GET rest call from https://reqres.in/api/unknown/23 +2024-09-05 14:44:06,904 ERROR Unknown content type or empty response. +2024-09-05 14:44:06,919 INFO GET Response : None +2024-09-05 14:44:06,919 INFO GET Request Status Code : 400 +2024-09-05 14:44:06,919 ERROR GET Request failed....!!! +2024-09-05 14:44:06,919 ERROR Unknown content type or empty response. +2024-09-05 14:44:06,919 ERROR Response Error Message: None +2024-09-05 14:44:06,919 ERROR Unknown content type or empty response. +2024-09-05 14:44:07,030 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:07,030 INFO Clean-up started +2024-09-05 14:44:07,030 INFO clean completed +2024-09-05 14:44:07,030 INFO ===================Teardown Completed======================= +2024-09-05 14:44:07,030 INFO ===================Setup Initialised======================== +2024-09-05 14:44:07,030 INFO creating driver instance created +2024-09-05 14:44:07,030 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:07,030 INFO ===================Setup Completed========================== +2024-09-05 14:44:07,030 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:07,045 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 14:44:07,045 INFO *********** executing test_005 **************** +2024-09-05 14:44:07,045 INFO Request url is : https://reqres.in/api/users +2024-09-05 14:44:07,045 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 14:44:07,620 INFO Response JSON : {"name":"morpheus","job":"leader","id":"887","createdAt":"2024-09-05T09:12:34.853Z"} +2024-09-05 14:44:07,635 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '887', 'createdAt': '2024-09-05T09:12:34.853Z'} +2024-09-05 14:44:07,635 INFO POST Request Status Code : 201 +2024-09-05 14:44:07,635 INFO POST Request Status Code : 201 +2024-09-05 14:44:07,635 INFO POST request is successful... +2024-09-05 14:44:07,635 INFO Response JSON : {"name":"morpheus","job":"leader","id":"887","createdAt":"2024-09-05T09:12:34.853Z"} +2024-09-05 14:44:07,635 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:07,635 INFO Clean-up started +2024-09-05 14:44:07,635 INFO clean completed +2024-09-05 14:44:07,635 INFO ===================Teardown Completed======================= +2024-09-05 14:44:07,635 INFO ===================Setup Initialised======================== +2024-09-05 14:44:07,635 INFO creating driver instance created +2024-09-05 14:44:07,635 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:07,635 INFO ===================Setup Completed========================== +2024-09-05 14:44:07,635 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:07,651 INFO *********** executing test_002 **************** +2024-09-05 14:44:07,651 INFO Request url is : https://reqres.in/api/users +2024-09-05 14:44:07,651 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 14:44:08,147 INFO Response JSON : {"name":"morpheus","job":"leader","id":"571","createdAt":"2024-09-05T09:12:35.376Z"} +2024-09-05 14:44:08,147 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '571', 'createdAt': '2024-09-05T09:12:35.376Z'} +2024-09-05 14:44:08,147 INFO POST Request Status Code : 201 +2024-09-05 14:44:08,147 INFO POST Request Status Code : 201 +2024-09-05 14:44:08,147 INFO POST request is successful... +2024-09-05 14:44:08,147 INFO Response JSON : {"name":"morpheus","job":"leader","id":"571","createdAt":"2024-09-05T09:12:35.376Z"} +2024-09-05 14:44:08,147 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:08,154 INFO Clean-up started +2024-09-05 14:44:08,154 INFO clean completed +2024-09-05 14:44:08,154 INFO ===================Teardown Completed======================= +2024-09-05 14:44:08,154 INFO ===================Setup Initialised======================== +2024-09-05 14:44:08,154 INFO creating driver instance created +2024-09-05 14:44:08,161 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:08,161 INFO ===================Setup Completed========================== +2024-09-05 14:44:08,167 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:08,167 INFO JSON data successfully read from API_Requests/Data/Request_Body\put_data.json +2024-09-05 14:44:08,167 INFO *********** executing test_003 **************** +2024-09-05 14:44:08,167 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 14:44:08,167 INFO Initializing PUT rest call from https://reqres.in/api/users/2 +2024-09-05 14:44:08,664 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T09:12:35.871Z"} +2024-09-05 14:44:08,664 INFO PUT Response : {'name': 'morpheus', 'job': 'zion resident', 'updatedAt': '2024-09-05T09:12:35.871Z'} +2024-09-05 14:44:08,664 INFO PUT request Status code : 200 +2024-09-05 14:44:08,664 INFO PUT request is successful..... +2024-09-05 14:44:08,664 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T09:12:35.871Z"} +2024-09-05 14:44:08,664 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:08,664 INFO Clean-up started +2024-09-05 14:44:08,664 INFO clean completed +2024-09-05 14:44:08,664 INFO ===================Teardown Completed======================= +2024-09-05 14:44:08,664 INFO ===================Setup Initialised======================== +2024-09-05 14:44:08,664 INFO creating driver instance created +2024-09-05 14:44:08,679 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:08,679 INFO ===================Setup Completed========================== +2024-09-05 14:44:08,681 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:08,684 INFO *********** executing test_007 **************** +2024-09-05 14:44:08,684 INFO Request url is : https://reqres.in/api/register +2024-09-05 14:44:08,684 INFO Initializing POST rest call from https://reqres.in/api/register +2024-09-05 14:44:09,157 INFO Response JSON : {"error":"Missing password"} +2024-09-05 14:44:09,157 INFO POST Response : {'error': 'Missing password'} +2024-09-05 14:44:09,157 INFO POST Request Status Code : 400 +2024-09-05 14:44:09,157 ERROR POST Request Failed +2024-09-05 14:44:09,157 INFO Response JSON : {"error":"Missing password"} +2024-09-05 14:44:09,157 ERROR Response Error message: {'error': 'Missing password'} +2024-09-05 14:44:09,157 INFO Response JSON : {"error":"Missing password"} +2024-09-05 14:44:09,184 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:09,184 INFO Clean-up started +2024-09-05 14:44:09,184 INFO clean completed +2024-09-05 14:44:09,188 INFO ===================Teardown Completed======================= diff --git a/Logs/log_20240905_144418.log b/Logs/log_20240905_144418.log new file mode 100644 index 0000000..72a4b36 --- /dev/null +++ b/Logs/log_20240905_144418.log @@ -0,0 +1,131 @@ +2024-09-05 14:44:18,580 INFO ===================Setup Initialised======================== +2024-09-05 14:44:18,580 INFO creating driver instance created +2024-09-05 14:44:18,580 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:18,580 INFO ===================Setup Completed========================== +2024-09-05 14:44:18,580 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:18,580 INFO *********** executing test_004 **************** +2024-09-05 14:44:18,580 INFO Request url is : https://reqres.in/api/objects/6 +2024-09-05 14:44:18,580 INFO Initializing DELETE REST call from https://reqres.in/api/objects/6 +2024-09-05 14:44:19,102 ERROR Unknown content type or empty response. +2024-09-05 14:44:19,103 INFO DELETE Response : None +2024-09-05 14:44:19,103 INFO DELETE request Status code : 400 +2024-09-05 14:44:19,103 ERROR PUT request Failed...!!! +2024-09-05 14:44:19,103 ERROR Unknown content type or empty response. +2024-09-05 14:44:19,103 ERROR Response Error Message: None +2024-09-05 14:44:19,103 ERROR Unknown content type or empty response. +2024-09-05 14:44:19,103 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:19,103 INFO Clean-up started +2024-09-05 14:44:19,103 INFO clean completed +2024-09-05 14:44:19,103 INFO ===================Teardown Completed======================= +2024-09-05 14:44:19,103 INFO ===================Setup Initialised======================== +2024-09-05 14:44:19,103 INFO creating driver instance created +2024-09-05 14:44:19,103 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:19,103 INFO ===================Setup Completed========================== +2024-09-05 14:44:19,103 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:19,103 INFO *********** executing test_001 **************** +2024-09-05 14:44:19,103 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 14:44:19,119 INFO Initializing GET rest call from https://reqres.in/api/users/2 +2024-09-05 14:44:19,202 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 14:44:19,213 INFO GET Response : {'data': {'id': 2, 'email': 'janet.weaver@reqres.in', 'first_name': 'Janet', 'last_name': 'Weaver', 'avatar': 'https://reqres.in/img/faces/2-image.jpg'}, 'support': {'url': 'https://reqres.in/#support-heading', 'text': 'To keep ReqRes free, contributions towards server costs are appreciated!'}} +2024-09-05 14:44:19,213 INFO GET Request Status Code : 200 +2024-09-05 14:44:19,213 INFO GET request is Successful..... +2024-09-05 14:44:19,213 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 14:44:19,213 INFO type of json response : +2024-09-05 14:44:19,213 INFO JSON data successfully saved toAPI_Requests/Data/Request_Body\get_data.json +2024-09-05 14:44:19,213 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:19,213 INFO Clean-up started +2024-09-05 14:44:19,213 INFO clean completed +2024-09-05 14:44:19,213 INFO ===================Teardown Completed======================= +2024-09-05 14:44:19,213 INFO ===================Setup Initialised======================== +2024-09-05 14:44:19,213 INFO creating driver instance created +2024-09-05 14:44:19,213 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:19,213 INFO ===================Setup Completed========================== +2024-09-05 14:44:19,229 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:19,229 INFO *********** executing test_001 **************** +2024-09-05 14:44:19,229 INFO Request url is : https://reqres.in/api/unknown/23 +2024-09-05 14:44:19,229 INFO Initializing GET rest call from https://reqres.in/api/unknown/23 +2024-09-05 14:44:19,740 ERROR Unknown content type or empty response. +2024-09-05 14:44:19,740 INFO GET Response : None +2024-09-05 14:44:19,740 INFO GET Request Status Code : 400 +2024-09-05 14:44:19,755 ERROR GET Request failed....!!! +2024-09-05 14:44:19,755 ERROR Unknown content type or empty response. +2024-09-05 14:44:19,757 ERROR Response Error Message: None +2024-09-05 14:44:19,758 ERROR Unknown content type or empty response. +2024-09-05 14:44:19,851 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:19,866 INFO Clean-up started +2024-09-05 14:44:19,867 INFO clean completed +2024-09-05 14:44:19,867 INFO ===================Teardown Completed======================= +2024-09-05 14:44:19,867 INFO ===================Setup Initialised======================== +2024-09-05 14:44:19,867 INFO creating driver instance created +2024-09-05 14:44:19,867 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:19,867 INFO ===================Setup Completed========================== +2024-09-05 14:44:19,867 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:19,873 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 14:44:19,873 INFO *********** executing test_005 **************** +2024-09-05 14:44:19,873 INFO Request url is : https://reqres.in/api/users +2024-09-05 14:44:19,873 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 14:44:20,431 INFO Response JSON : {"name":"morpheus","job":"leader","id":"289","createdAt":"2024-09-05T09:12:47.616Z"} +2024-09-05 14:44:20,431 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '289', 'createdAt': '2024-09-05T09:12:47.616Z'} +2024-09-05 14:44:20,431 INFO POST Request Status Code : 201 +2024-09-05 14:44:20,431 INFO POST Request Status Code : 201 +2024-09-05 14:44:20,431 INFO POST request is successful... +2024-09-05 14:44:20,431 INFO Response JSON : {"name":"morpheus","job":"leader","id":"289","createdAt":"2024-09-05T09:12:47.616Z"} +2024-09-05 14:44:20,431 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:20,431 INFO Clean-up started +2024-09-05 14:44:20,437 INFO clean completed +2024-09-05 14:44:20,437 INFO ===================Teardown Completed======================= +2024-09-05 14:44:20,437 INFO ===================Setup Initialised======================== +2024-09-05 14:44:20,437 INFO creating driver instance created +2024-09-05 14:44:20,437 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:20,437 INFO ===================Setup Completed========================== +2024-09-05 14:44:20,437 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:20,437 INFO *********** executing test_002 **************** +2024-09-05 14:44:20,437 INFO Request url is : https://reqres.in/api/users +2024-09-05 14:44:20,437 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 14:44:20,943 INFO Response JSON : {"name":"morpheus","job":"leader","id":"719","createdAt":"2024-09-05T09:12:48.118Z"} +2024-09-05 14:44:20,943 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '719', 'createdAt': '2024-09-05T09:12:48.118Z'} +2024-09-05 14:44:20,943 INFO POST Request Status Code : 201 +2024-09-05 14:44:20,943 INFO POST Request Status Code : 201 +2024-09-05 14:44:20,943 INFO POST request is successful... +2024-09-05 14:44:20,943 INFO Response JSON : {"name":"morpheus","job":"leader","id":"719","createdAt":"2024-09-05T09:12:48.118Z"} +2024-09-05 14:44:20,943 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:20,943 INFO Clean-up started +2024-09-05 14:44:20,943 INFO clean completed +2024-09-05 14:44:20,943 INFO ===================Teardown Completed======================= +2024-09-05 14:44:20,943 INFO ===================Setup Initialised======================== +2024-09-05 14:44:20,943 INFO creating driver instance created +2024-09-05 14:44:20,943 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:20,943 INFO ===================Setup Completed========================== +2024-09-05 14:44:20,943 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:20,954 INFO JSON data successfully read from API_Requests/Data/Request_Body\put_data.json +2024-09-05 14:44:20,954 INFO *********** executing test_003 **************** +2024-09-05 14:44:20,954 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 14:44:20,954 INFO Initializing PUT rest call from https://reqres.in/api/users/2 +2024-09-05 14:44:21,341 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T09:12:48.603Z"} +2024-09-05 14:44:21,341 INFO PUT Response : {'name': 'morpheus', 'job': 'zion resident', 'updatedAt': '2024-09-05T09:12:48.603Z'} +2024-09-05 14:44:21,341 INFO PUT request Status code : 200 +2024-09-05 14:44:21,341 INFO PUT request is successful..... +2024-09-05 14:44:21,341 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T09:12:48.603Z"} +2024-09-05 14:44:21,357 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:21,358 INFO Clean-up started +2024-09-05 14:44:21,358 INFO clean completed +2024-09-05 14:44:21,358 INFO ===================Teardown Completed======================= +2024-09-05 14:44:21,358 INFO ===================Setup Initialised======================== +2024-09-05 14:44:21,358 INFO creating driver instance created +2024-09-05 14:44:21,363 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:21,363 INFO ===================Setup Completed========================== +2024-09-05 14:44:21,363 INFO Base url is : https://reqres.in/api/ +2024-09-05 14:44:21,363 INFO *********** executing test_007 **************** +2024-09-05 14:44:21,363 INFO Request url is : https://reqres.in/api/register +2024-09-05 14:44:21,363 INFO Initializing POST rest call from https://reqres.in/api/register +2024-09-05 14:44:21,868 INFO Response JSON : {"error":"Missing password"} +2024-09-05 14:44:21,868 INFO POST Response : {'error': 'Missing password'} +2024-09-05 14:44:21,868 INFO POST Request Status Code : 400 +2024-09-05 14:44:21,868 ERROR POST Request Failed +2024-09-05 14:44:21,868 INFO Response JSON : {"error":"Missing password"} +2024-09-05 14:44:21,868 ERROR Response Error message: {'error': 'Missing password'} +2024-09-05 14:44:21,868 INFO Response JSON : {"error":"Missing password"} +2024-09-05 14:44:21,868 INFO ===================Teardown Initialised===================== +2024-09-05 14:44:21,868 INFO Clean-up started +2024-09-05 14:44:21,868 INFO clean completed +2024-09-05 14:44:21,868 INFO ===================Teardown Completed======================= diff --git a/Logs/log_20240905_151553.log b/Logs/log_20240905_151553.log new file mode 100644 index 0000000..439a303 --- /dev/null +++ b/Logs/log_20240905_151553.log @@ -0,0 +1,138 @@ +2024-09-05 15:15:53,140 INFO Starting test setup process... +2024-09-05 15:15:53,140 INFO Generating authentication token... +2024-09-05 15:15:53,140 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:53,140 INFO Authentication token generated successfully. +2024-09-05 15:15:53,140 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:15:53,156 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:53,156 INFO *********** executing test_004 **************** +2024-09-05 15:15:53,156 INFO Request url is : https://reqres.in/api/objects/6 +2024-09-05 15:15:53,156 INFO Initializing DELETE REST call from https://reqres.in/api/objects/6 +2024-09-05 15:15:53,572 ERROR Unknown content type or empty response. +2024-09-05 15:15:53,572 INFO DELETE Response : None +2024-09-05 15:15:53,572 INFO DELETE request Status code : 400 +2024-09-05 15:15:53,572 ERROR PUT request Failed...!!! +2024-09-05 15:15:53,572 ERROR Unknown content type or empty response. +2024-09-05 15:15:53,572 ERROR Response Error Message: None +2024-09-05 15:15:53,572 ERROR Unknown content type or empty response. +2024-09-05 15:15:53,586 INFO Starting test cleanup process... +2024-09-05 15:15:53,586 INFO Cleaning up authentication token... +2024-09-05 15:15:53,586 INFO Authentication token cleaned up successfully. +2024-09-05 15:15:53,586 INFO Test cleanup completed. Resources released. +2024-09-05 15:15:53,586 INFO Starting test setup process... +2024-09-05 15:15:53,586 INFO Generating authentication token... +2024-09-05 15:15:53,586 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:53,586 INFO Authentication token generated successfully. +2024-09-05 15:15:53,586 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:15:53,586 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:53,586 INFO *********** executing test_001 **************** +2024-09-05 15:15:53,586 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 15:15:53,586 INFO Initializing GET rest call from https://reqres.in/api/users/2 +2024-09-05 15:15:53,666 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 15:15:53,666 INFO GET Response : {'data': {'id': 2, 'email': 'janet.weaver@reqres.in', 'first_name': 'Janet', 'last_name': 'Weaver', 'avatar': 'https://reqres.in/img/faces/2-image.jpg'}, 'support': {'url': 'https://reqres.in/#support-heading', 'text': 'To keep ReqRes free, contributions towards server costs are appreciated!'}} +2024-09-05 15:15:53,666 INFO GET Request Status Code : 200 +2024-09-05 15:15:53,666 INFO GET request is Successful..... +2024-09-05 15:15:53,666 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 15:15:53,666 INFO type of json response : +2024-09-05 15:15:53,666 INFO JSON data successfully saved to API_Requests/Data/Request_Body\get_data.json +2024-09-05 15:15:53,681 INFO Starting test cleanup process... +2024-09-05 15:15:53,682 INFO Cleaning up authentication token... +2024-09-05 15:15:53,682 INFO Authentication token cleaned up successfully. +2024-09-05 15:15:53,682 INFO Test cleanup completed. Resources released. +2024-09-05 15:15:53,682 INFO Starting test setup process... +2024-09-05 15:15:53,682 INFO Generating authentication token... +2024-09-05 15:15:53,686 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:53,686 INFO Authentication token generated successfully. +2024-09-05 15:15:53,686 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:15:53,686 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:53,686 INFO *********** executing test_001 **************** +2024-09-05 15:15:53,686 INFO Request url is : https://reqres.in/api/unknown/23 +2024-09-05 15:15:53,686 INFO Initializing GET rest call from https://reqres.in/api/unknown/23 +2024-09-05 15:15:54,143 ERROR Unknown content type or empty response. +2024-09-05 15:15:54,143 INFO GET Response : None +2024-09-05 15:15:54,143 INFO GET Request Status Code : 400 +2024-09-05 15:15:54,143 ERROR GET Request failed....!!! +2024-09-05 15:15:54,159 ERROR Unknown content type or empty response. +2024-09-05 15:15:54,159 ERROR Response Error Message: None +2024-09-05 15:15:54,159 ERROR Unknown content type or empty response. +2024-09-05 15:15:54,270 INFO Starting test cleanup process... +2024-09-05 15:15:54,270 INFO Cleaning up authentication token... +2024-09-05 15:15:54,270 INFO Authentication token cleaned up successfully. +2024-09-05 15:15:54,270 INFO Test cleanup completed. Resources released. +2024-09-05 15:15:54,270 INFO Starting test setup process... +2024-09-05 15:15:54,270 INFO Generating authentication token... +2024-09-05 15:15:54,270 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:54,270 INFO Authentication token generated successfully. +2024-09-05 15:15:54,270 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:15:54,288 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:54,288 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 15:15:54,290 INFO *********** executing test_005 **************** +2024-09-05 15:15:54,290 INFO Request url is : https://reqres.in/api/users +2024-09-05 15:15:54,290 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 15:15:54,759 INFO Response JSON : {"name":"morpheus","job":"leader","id":"929","createdAt":"2024-09-05T09:44:21.984Z"} +2024-09-05 15:15:54,774 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '929', 'createdAt': '2024-09-05T09:44:21.984Z'} +2024-09-05 15:15:54,774 INFO POST Request Status Code : 201 +2024-09-05 15:15:54,774 INFO POST Request Status Code : 201 +2024-09-05 15:15:54,774 INFO POST request is successful... +2024-09-05 15:15:54,774 INFO Response JSON : {"name":"morpheus","job":"leader","id":"929","createdAt":"2024-09-05T09:44:21.984Z"} +2024-09-05 15:15:54,774 INFO Starting test cleanup process... +2024-09-05 15:15:54,774 INFO Cleaning up authentication token... +2024-09-05 15:15:54,774 INFO Authentication token cleaned up successfully. +2024-09-05 15:15:54,774 INFO Test cleanup completed. Resources released. +2024-09-05 15:15:54,774 INFO Starting test setup process... +2024-09-05 15:15:54,774 INFO Generating authentication token... +2024-09-05 15:15:54,774 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:54,774 INFO Authentication token generated successfully. +2024-09-05 15:15:54,774 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:15:54,774 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:54,774 INFO *********** executing test_002 **************** +2024-09-05 15:15:54,774 INFO Request url is : https://reqres.in/api/users +2024-09-05 15:15:54,789 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 15:15:55,189 INFO Response JSON : {"name":"morpheus","job":"leader","id":"736","createdAt":"2024-09-05T09:44:22.468Z"} +2024-09-05 15:15:55,189 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '736', 'createdAt': '2024-09-05T09:44:22.468Z'} +2024-09-05 15:15:55,189 INFO POST Request Status Code : 201 +2024-09-05 15:15:55,189 INFO POST Request Status Code : 201 +2024-09-05 15:15:55,189 INFO POST request is successful... +2024-09-05 15:15:55,189 INFO Response JSON : {"name":"morpheus","job":"leader","id":"736","createdAt":"2024-09-05T09:44:22.468Z"} +2024-09-05 15:15:55,189 INFO Starting test cleanup process... +2024-09-05 15:15:55,189 INFO Cleaning up authentication token... +2024-09-05 15:15:55,189 INFO Authentication token cleaned up successfully. +2024-09-05 15:15:55,189 INFO Test cleanup completed. Resources released. +2024-09-05 15:15:55,203 INFO Starting test setup process... +2024-09-05 15:15:55,203 INFO Generating authentication token... +2024-09-05 15:15:55,204 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:55,204 INFO Authentication token generated successfully. +2024-09-05 15:15:55,204 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:15:55,204 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:55,204 INFO JSON data successfully read from API_Requests/Data/Request_Body\put_data.json +2024-09-05 15:15:55,204 INFO *********** executing test_003 **************** +2024-09-05 15:15:55,204 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 15:15:55,204 INFO Initializing PUT rest call from https://reqres.in/api/users/2 +2024-09-05 15:15:55,692 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T09:44:22.838Z"} +2024-09-05 15:15:55,692 INFO PUT Response : {'name': 'morpheus', 'job': 'zion resident', 'updatedAt': '2024-09-05T09:44:22.838Z'} +2024-09-05 15:15:55,692 INFO PUT request Status code : 200 +2024-09-05 15:15:55,692 INFO PUT request is successful..... +2024-09-05 15:15:55,692 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T09:44:22.838Z"} +2024-09-05 15:15:55,692 INFO Starting test cleanup process... +2024-09-05 15:15:55,692 INFO Cleaning up authentication token... +2024-09-05 15:15:55,692 INFO Authentication token cleaned up successfully. +2024-09-05 15:15:55,692 INFO Test cleanup completed. Resources released. +2024-09-05 15:15:55,692 INFO Starting test setup process... +2024-09-05 15:15:55,692 INFO Generating authentication token... +2024-09-05 15:15:55,692 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:55,708 INFO Authentication token generated successfully. +2024-09-05 15:15:55,708 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:15:55,708 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:15:55,708 INFO *********** executing test_007 **************** +2024-09-05 15:15:55,708 INFO Request url is : https://reqres.in/api/register +2024-09-05 15:15:55,708 INFO Initializing POST rest call from https://reqres.in/api/register +2024-09-05 15:15:56,201 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:15:56,201 INFO POST Response : {'error': 'Missing password'} +2024-09-05 15:15:56,201 INFO POST Request Status Code : 400 +2024-09-05 15:15:56,201 ERROR POST Request Failed +2024-09-05 15:15:56,201 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:15:56,201 ERROR Response Error message: {'error': 'Missing password'} +2024-09-05 15:15:56,201 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:15:56,219 INFO Starting test cleanup process... +2024-09-05 15:15:56,232 INFO Cleaning up authentication token... +2024-09-05 15:15:56,237 INFO Authentication token cleaned up successfully. +2024-09-05 15:15:56,237 INFO Test cleanup completed. Resources released. diff --git a/Logs/log_20240905_151754.log b/Logs/log_20240905_151754.log new file mode 100644 index 0000000..1cdcb0b --- /dev/null +++ b/Logs/log_20240905_151754.log @@ -0,0 +1,138 @@ +2024-09-05 15:17:54,783 INFO Starting test setup process... +2024-09-05 15:17:54,783 INFO Generating authentication token... +2024-09-05 15:17:54,783 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:54,783 INFO Authentication token generated successfully. +2024-09-05 15:17:54,783 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:17:54,789 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:54,789 INFO *********** executing test_004 **************** +2024-09-05 15:17:54,789 INFO Request url is : https://reqres.in/api/objects/6 +2024-09-05 15:17:54,789 INFO Initializing DELETE REST call from https://reqres.in/api/objects/6 +2024-09-05 15:17:55,291 ERROR Unknown content type or empty response. +2024-09-05 15:17:55,291 INFO DELETE Response : None +2024-09-05 15:17:55,291 INFO DELETE request Status code : 400 +2024-09-05 15:17:55,291 ERROR PUT request Failed...!!! +2024-09-05 15:17:55,291 ERROR Unknown content type or empty response. +2024-09-05 15:17:55,291 ERROR Response Error Message: None +2024-09-05 15:17:55,291 ERROR Unknown content type or empty response. +2024-09-05 15:17:55,291 INFO Starting test cleanup process... +2024-09-05 15:17:55,291 INFO Cleaning up authentication token... +2024-09-05 15:17:55,291 INFO Authentication token cleaned up successfully. +2024-09-05 15:17:55,291 INFO Test cleanup completed. Resources released. +2024-09-05 15:17:55,307 INFO Starting test setup process... +2024-09-05 15:17:55,307 INFO Generating authentication token... +2024-09-05 15:17:55,307 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:55,307 INFO Authentication token generated successfully. +2024-09-05 15:17:55,307 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:17:55,323 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:55,323 INFO *********** executing test_001 **************** +2024-09-05 15:17:55,323 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 15:17:55,323 INFO Initializing GET rest call from https://reqres.in/api/users/2 +2024-09-05 15:17:55,387 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 15:17:55,387 INFO GET Response : {'data': {'id': 2, 'email': 'janet.weaver@reqres.in', 'first_name': 'Janet', 'last_name': 'Weaver', 'avatar': 'https://reqres.in/img/faces/2-image.jpg'}, 'support': {'url': 'https://reqres.in/#support-heading', 'text': 'To keep ReqRes free, contributions towards server costs are appreciated!'}} +2024-09-05 15:17:55,387 INFO GET Request Status Code : 200 +2024-09-05 15:17:55,387 INFO GET request is Successful..... +2024-09-05 15:17:55,402 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 15:17:55,402 INFO type of json response : +2024-09-05 15:17:55,402 INFO JSON data successfully saved to API_Requests/Data/Request_Body\get_data.json +2024-09-05 15:17:55,402 INFO Starting test cleanup process... +2024-09-05 15:17:55,402 INFO Cleaning up authentication token... +2024-09-05 15:17:55,402 INFO Authentication token cleaned up successfully. +2024-09-05 15:17:55,402 INFO Test cleanup completed. Resources released. +2024-09-05 15:17:55,418 INFO Starting test setup process... +2024-09-05 15:17:55,418 INFO Generating authentication token... +2024-09-05 15:17:55,418 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:55,418 INFO Authentication token generated successfully. +2024-09-05 15:17:55,418 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:17:55,418 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:55,418 INFO *********** executing test_001 **************** +2024-09-05 15:17:55,418 INFO Request url is : https://reqres.in/api/unknown/23 +2024-09-05 15:17:55,418 INFO Initializing GET rest call from https://reqres.in/api/unknown/23 +2024-09-05 15:17:55,921 ERROR Unknown content type or empty response. +2024-09-05 15:17:55,921 INFO GET Response : None +2024-09-05 15:17:55,921 INFO GET Request Status Code : 400 +2024-09-05 15:17:55,921 ERROR GET Request failed....!!! +2024-09-05 15:17:55,921 ERROR Unknown content type or empty response. +2024-09-05 15:17:55,921 ERROR Response Error Message: None +2024-09-05 15:17:55,921 ERROR Unknown content type or empty response. +2024-09-05 15:17:56,031 INFO Starting test cleanup process... +2024-09-05 15:17:56,031 INFO Cleaning up authentication token... +2024-09-05 15:17:56,031 INFO Authentication token cleaned up successfully. +2024-09-05 15:17:56,031 INFO Test cleanup completed. Resources released. +2024-09-05 15:17:56,048 INFO Starting test setup process... +2024-09-05 15:17:56,048 INFO Generating authentication token... +2024-09-05 15:17:56,048 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:56,048 INFO Authentication token generated successfully. +2024-09-05 15:17:56,048 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:17:56,048 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:56,048 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 15:17:56,048 INFO *********** executing test_005 **************** +2024-09-05 15:17:56,048 INFO Request url is : https://reqres.in/api/users +2024-09-05 15:17:56,048 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 15:17:56,533 INFO Response JSON : {"name":"morpheus","job":"leader","id":"344","createdAt":"2024-09-05T09:46:23.717Z"} +2024-09-05 15:17:56,533 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '344', 'createdAt': '2024-09-05T09:46:23.717Z'} +2024-09-05 15:17:56,533 INFO POST Request Status Code : 201 +2024-09-05 15:17:56,533 INFO POST Request Status Code : 201 +2024-09-05 15:17:56,533 INFO POST request is successful... +2024-09-05 15:17:56,533 INFO Response JSON : {"name":"morpheus","job":"leader","id":"344","createdAt":"2024-09-05T09:46:23.717Z"} +2024-09-05 15:17:56,533 INFO Starting test cleanup process... +2024-09-05 15:17:56,533 INFO Cleaning up authentication token... +2024-09-05 15:17:56,533 INFO Authentication token cleaned up successfully. +2024-09-05 15:17:56,533 INFO Test cleanup completed. Resources released. +2024-09-05 15:17:56,549 INFO Starting test setup process... +2024-09-05 15:17:56,549 INFO Generating authentication token... +2024-09-05 15:17:56,558 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:56,559 INFO Authentication token generated successfully. +2024-09-05 15:17:56,559 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:17:56,562 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:56,563 INFO *********** executing test_002 **************** +2024-09-05 15:17:56,563 INFO Request url is : https://reqres.in/api/users +2024-09-05 15:17:56,563 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 15:17:57,036 INFO Response JSON : {"name":"morpheus","job":"leader","id":"349","createdAt":"2024-09-05T09:46:24.205Z"} +2024-09-05 15:17:57,036 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '349', 'createdAt': '2024-09-05T09:46:24.205Z'} +2024-09-05 15:17:57,036 INFO POST Request Status Code : 201 +2024-09-05 15:17:57,036 INFO POST Request Status Code : 201 +2024-09-05 15:17:57,036 INFO POST request is successful... +2024-09-05 15:17:57,036 INFO Response JSON : {"name":"morpheus","job":"leader","id":"349","createdAt":"2024-09-05T09:46:24.205Z"} +2024-09-05 15:17:57,036 INFO Starting test cleanup process... +2024-09-05 15:17:57,036 INFO Cleaning up authentication token... +2024-09-05 15:17:57,036 INFO Authentication token cleaned up successfully. +2024-09-05 15:17:57,036 INFO Test cleanup completed. Resources released. +2024-09-05 15:17:57,052 INFO Starting test setup process... +2024-09-05 15:17:57,052 INFO Generating authentication token... +2024-09-05 15:17:57,052 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:57,052 INFO Authentication token generated successfully. +2024-09-05 15:17:57,052 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:17:57,052 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:57,052 INFO JSON data successfully read from API_Requests/Data/Request_Body\put_data.json +2024-09-05 15:17:57,052 INFO *********** executing test_003 **************** +2024-09-05 15:17:57,052 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 15:17:57,052 INFO Initializing PUT rest call from https://reqres.in/api/users/2 +2024-09-05 15:17:57,545 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T09:46:24.698Z"} +2024-09-05 15:17:57,545 INFO PUT Response : {'name': 'morpheus', 'job': 'zion resident', 'updatedAt': '2024-09-05T09:46:24.698Z'} +2024-09-05 15:17:57,545 INFO PUT request Status code : 200 +2024-09-05 15:17:57,545 INFO PUT request is successful..... +2024-09-05 15:17:57,545 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T09:46:24.698Z"} +2024-09-05 15:17:57,545 INFO Starting test cleanup process... +2024-09-05 15:17:57,545 INFO Cleaning up authentication token... +2024-09-05 15:17:57,545 INFO Authentication token cleaned up successfully. +2024-09-05 15:17:57,545 INFO Test cleanup completed. Resources released. +2024-09-05 15:17:57,566 INFO Starting test setup process... +2024-09-05 15:17:57,566 INFO Generating authentication token... +2024-09-05 15:17:57,566 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:57,566 INFO Authentication token generated successfully. +2024-09-05 15:17:57,566 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:17:57,566 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:17:57,566 INFO *********** executing test_007 **************** +2024-09-05 15:17:57,566 INFO Request url is : https://reqres.in/api/register +2024-09-05 15:17:57,566 INFO Initializing POST rest call from https://reqres.in/api/register +2024-09-05 15:17:58,053 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:17:58,053 INFO POST Response : {'error': 'Missing password'} +2024-09-05 15:17:58,053 INFO POST Request Status Code : 400 +2024-09-05 15:17:58,053 ERROR POST Request Failed +2024-09-05 15:17:58,053 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:17:58,053 ERROR Response Error message: {'error': 'Missing password'} +2024-09-05 15:17:58,053 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:17:58,069 INFO Starting test cleanup process... +2024-09-05 15:17:58,069 INFO Cleaning up authentication token... +2024-09-05 15:17:58,069 INFO Authentication token cleaned up successfully. +2024-09-05 15:17:58,069 INFO Test cleanup completed. Resources released. diff --git a/Logs/log_20240905_152213.log b/Logs/log_20240905_152213.log new file mode 100644 index 0000000..51d72e6 --- /dev/null +++ b/Logs/log_20240905_152213.log @@ -0,0 +1,138 @@ +2024-09-05 15:22:13,294 INFO Starting test setup process... +2024-09-05 15:22:13,294 INFO Generating authentication token... +2024-09-05 15:22:13,294 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:13,294 INFO Authentication token generated successfully. +2024-09-05 15:22:13,294 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:22:13,307 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:13,307 INFO *********** executing test_004 **************** +2024-09-05 15:22:13,307 INFO Request url is : https://reqres.in/api/objects/6 +2024-09-05 15:22:13,307 INFO Initializing DELETE REST call from https://reqres.in/api/objects/6 +2024-09-05 15:22:13,869 ERROR Unknown content type or empty response. +2024-09-05 15:22:13,872 INFO DELETE Response : None +2024-09-05 15:22:13,872 INFO DELETE request Status code : 400 +2024-09-05 15:22:13,872 ERROR PUT request Failed...!!! +2024-09-05 15:22:13,872 ERROR Unknown content type or empty response. +2024-09-05 15:22:13,872 ERROR Response Error Message: None +2024-09-05 15:22:13,872 ERROR Unknown content type or empty response. +2024-09-05 15:22:13,872 INFO Starting test cleanup process... +2024-09-05 15:22:13,872 INFO Cleaning up authentication token... +2024-09-05 15:22:13,878 INFO Authentication token cleaned up successfully. +2024-09-05 15:22:13,878 INFO Test cleanup completed. Resources released. +2024-09-05 15:22:13,887 INFO Starting test setup process... +2024-09-05 15:22:13,887 INFO Generating authentication token... +2024-09-05 15:22:13,887 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:13,887 INFO Authentication token generated successfully. +2024-09-05 15:22:13,887 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:22:13,894 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:13,894 INFO *********** executing test_001 **************** +2024-09-05 15:22:13,894 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 15:22:13,894 INFO Initializing GET rest call from https://reqres.in/api/users/2 +2024-09-05 15:22:14,005 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 15:22:14,005 INFO GET Response : {'data': {'id': 2, 'email': 'janet.weaver@reqres.in', 'first_name': 'Janet', 'last_name': 'Weaver', 'avatar': 'https://reqres.in/img/faces/2-image.jpg'}, 'support': {'url': 'https://reqres.in/#support-heading', 'text': 'To keep ReqRes free, contributions towards server costs are appreciated!'}} +2024-09-05 15:22:14,005 INFO GET Request Status Code : 200 +2024-09-05 15:22:14,005 INFO GET request is Successful..... +2024-09-05 15:22:14,005 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 15:22:14,005 INFO type of json response : +2024-09-05 15:22:14,020 INFO JSON data successfully saved to API_Requests/Data/Request_Body\get_data.json +2024-09-05 15:22:14,022 INFO Starting test cleanup process... +2024-09-05 15:22:14,023 INFO Cleaning up authentication token... +2024-09-05 15:22:14,023 INFO Authentication token cleaned up successfully. +2024-09-05 15:22:14,023 INFO Test cleanup completed. Resources released. +2024-09-05 15:22:14,031 INFO Starting test setup process... +2024-09-05 15:22:14,031 INFO Generating authentication token... +2024-09-05 15:22:14,031 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:14,031 INFO Authentication token generated successfully. +2024-09-05 15:22:14,031 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:22:14,036 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:14,036 INFO *********** executing test_001 **************** +2024-09-05 15:22:14,036 INFO Request url is : https://reqres.in/api/unknown/23 +2024-09-05 15:22:14,036 INFO Initializing GET rest call from https://reqres.in/api/unknown/23 +2024-09-05 15:22:14,574 ERROR Unknown content type or empty response. +2024-09-05 15:22:14,574 INFO GET Response : None +2024-09-05 15:22:14,574 INFO GET Request Status Code : 400 +2024-09-05 15:22:14,574 ERROR GET Request failed....!!! +2024-09-05 15:22:14,574 ERROR Unknown content type or empty response. +2024-09-05 15:22:14,574 ERROR Response Error Message: None +2024-09-05 15:22:14,574 ERROR Unknown content type or empty response. +2024-09-05 15:22:14,685 INFO Starting test cleanup process... +2024-09-05 15:22:14,685 INFO Cleaning up authentication token... +2024-09-05 15:22:14,685 INFO Authentication token cleaned up successfully. +2024-09-05 15:22:14,685 INFO Test cleanup completed. Resources released. +2024-09-05 15:22:14,696 INFO Starting test setup process... +2024-09-05 15:22:14,696 INFO Generating authentication token... +2024-09-05 15:22:14,696 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:14,696 INFO Authentication token generated successfully. +2024-09-05 15:22:14,696 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:22:14,700 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:14,701 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 15:22:14,701 INFO *********** executing test_005 **************** +2024-09-05 15:22:14,701 INFO Request url is : https://reqres.in/api/users +2024-09-05 15:22:14,701 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 15:22:15,191 INFO Response JSON : {"name":"morpheus","job":"leader","id":"732","createdAt":"2024-09-05T09:50:42.384Z"} +2024-09-05 15:22:15,191 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '732', 'createdAt': '2024-09-05T09:50:42.384Z'} +2024-09-05 15:22:15,191 INFO POST Request Status Code : 201 +2024-09-05 15:22:15,191 INFO POST Request Status Code : 201 +2024-09-05 15:22:15,191 INFO POST request is successful... +2024-09-05 15:22:15,191 INFO Response JSON : {"name":"morpheus","job":"leader","id":"732","createdAt":"2024-09-05T09:50:42.384Z"} +2024-09-05 15:22:15,191 INFO Starting test cleanup process... +2024-09-05 15:22:15,191 INFO Cleaning up authentication token... +2024-09-05 15:22:15,191 INFO Authentication token cleaned up successfully. +2024-09-05 15:22:15,191 INFO Test cleanup completed. Resources released. +2024-09-05 15:22:15,206 INFO Starting test setup process... +2024-09-05 15:22:15,209 INFO Generating authentication token... +2024-09-05 15:22:15,209 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:15,209 INFO Authentication token generated successfully. +2024-09-05 15:22:15,209 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:22:15,209 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:15,209 INFO *********** executing test_002 **************** +2024-09-05 15:22:15,209 INFO Request url is : https://reqres.in/api/users +2024-09-05 15:22:15,209 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 15:22:15,696 INFO Response JSON : {"name":"morpheus","job":"leader","id":"712","createdAt":"2024-09-05T09:50:42.921Z"} +2024-09-05 15:22:15,696 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '712', 'createdAt': '2024-09-05T09:50:42.921Z'} +2024-09-05 15:22:15,696 INFO POST Request Status Code : 201 +2024-09-05 15:22:15,696 INFO POST Request Status Code : 201 +2024-09-05 15:22:15,696 INFO POST request is successful... +2024-09-05 15:22:15,696 INFO Response JSON : {"name":"morpheus","job":"leader","id":"712","createdAt":"2024-09-05T09:50:42.921Z"} +2024-09-05 15:22:15,711 INFO Starting test cleanup process... +2024-09-05 15:22:15,711 INFO Cleaning up authentication token... +2024-09-05 15:22:15,711 INFO Authentication token cleaned up successfully. +2024-09-05 15:22:15,711 INFO Test cleanup completed. Resources released. +2024-09-05 15:22:15,739 INFO Starting test setup process... +2024-09-05 15:22:15,739 INFO Generating authentication token... +2024-09-05 15:22:15,743 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:15,743 INFO Authentication token generated successfully. +2024-09-05 15:22:15,743 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:22:15,743 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:15,743 INFO JSON data successfully read from API_Requests/Data/Request_Body\put_data.json +2024-09-05 15:22:15,743 INFO *********** executing test_003 **************** +2024-09-05 15:22:15,743 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 15:22:15,743 INFO Initializing PUT rest call from https://reqres.in/api/users/2 +2024-09-05 15:22:16,221 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T09:50:43.422Z"} +2024-09-05 15:22:16,221 INFO PUT Response : {'name': 'morpheus', 'job': 'zion resident', 'updatedAt': '2024-09-05T09:50:43.422Z'} +2024-09-05 15:22:16,221 INFO PUT request Status code : 200 +2024-09-05 15:22:16,221 INFO PUT request is successful..... +2024-09-05 15:22:16,221 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T09:50:43.422Z"} +2024-09-05 15:22:16,221 INFO Starting test cleanup process... +2024-09-05 15:22:16,221 INFO Cleaning up authentication token... +2024-09-05 15:22:16,221 INFO Authentication token cleaned up successfully. +2024-09-05 15:22:16,221 INFO Test cleanup completed. Resources released. +2024-09-05 15:22:16,239 INFO Starting test setup process... +2024-09-05 15:22:16,239 INFO Generating authentication token... +2024-09-05 15:22:16,239 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:16,239 INFO Authentication token generated successfully. +2024-09-05 15:22:16,239 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:22:16,239 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:22:16,239 INFO *********** executing test_007 **************** +2024-09-05 15:22:16,239 INFO Request url is : https://reqres.in/api/register +2024-09-05 15:22:16,239 INFO Initializing POST rest call from https://reqres.in/api/register +2024-09-05 15:22:16,730 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:22:16,730 INFO POST Response : {'error': 'Missing password'} +2024-09-05 15:22:16,730 INFO POST Request Status Code : 400 +2024-09-05 15:22:16,730 ERROR POST Request Failed +2024-09-05 15:22:16,730 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:22:16,730 ERROR Response Error message: {'error': 'Missing password'} +2024-09-05 15:22:16,730 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:22:16,744 INFO Starting test cleanup process... +2024-09-05 15:22:16,744 INFO Cleaning up authentication token... +2024-09-05 15:22:16,744 INFO Authentication token cleaned up successfully. +2024-09-05 15:22:16,744 INFO Test cleanup completed. Resources released. diff --git a/Logs/log_20240905_154322.log b/Logs/log_20240905_154322.log new file mode 100644 index 0000000..6693014 --- /dev/null +++ b/Logs/log_20240905_154322.log @@ -0,0 +1,20 @@ +2024-09-05 15:43:22,339 INFO Starting test setup process... +2024-09-05 15:43:22,339 INFO Generating authentication token... +2024-09-05 15:43:22,342 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:43:22,342 INFO Authentication token generated successfully. +2024-09-05 15:43:22,342 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:43:22,345 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:43:22,345 INFO *********** executing test_001 **************** +2024-09-05 15:43:22,345 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 15:43:22,345 INFO Initializing GET rest call from https://reqres.in/api/users/2 +2024-09-05 15:43:22,486 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 15:43:22,486 INFO GET Response : {'data': {'id': 2, 'email': 'janet.weaver@reqres.in', 'first_name': 'Janet', 'last_name': 'Weaver', 'avatar': 'https://reqres.in/img/faces/2-image.jpg'}, 'support': {'url': 'https://reqres.in/#support-heading', 'text': 'To keep ReqRes free, contributions towards server costs are appreciated!'}} +2024-09-05 15:43:22,486 INFO GET Request Status Code : 200 +2024-09-05 15:43:22,486 INFO GET request is Successful..... +2024-09-05 15:43:22,486 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 15:43:22,486 INFO type of json response : +2024-09-05 15:43:22,488 INFO JSON data successfully saved to API_Requests/Data/Response_Body\get_data.json +2024-09-05 15:43:22,489 INFO Starting test cleanup process... +2024-09-05 15:43:22,489 INFO Cleaning up authentication token... +2024-09-05 15:43:22,489 INFO Authentication token cleaned up successfully. +2024-09-05 15:43:22,489 INFO Test cleanup completed. Resources released. diff --git a/Logs/log_20240905_154424.log b/Logs/log_20240905_154424.log new file mode 100644 index 0000000..081d37c --- /dev/null +++ b/Logs/log_20240905_154424.log @@ -0,0 +1,20 @@ +2024-09-05 15:44:24,622 INFO Starting test setup process... +2024-09-05 15:44:24,623 INFO Generating authentication token... +2024-09-05 15:44:24,626 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:44:24,626 INFO Authentication token generated successfully. +2024-09-05 15:44:24,626 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:44:24,629 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:44:24,630 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 15:44:24,630 INFO *********** executing test_005 **************** +2024-09-05 15:44:24,643 INFO Request url is : https://reqres.in/api/users +2024-09-05 15:44:24,643 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 15:44:25,139 INFO Response JSON : {"name":"morpheus","job":"leader","id":"945","createdAt":"2024-09-05T10:12:52.325Z"} +2024-09-05 15:44:25,139 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '945', 'createdAt': '2024-09-05T10:12:52.325Z'} +2024-09-05 15:44:25,139 INFO POST Request Status Code : 201 +2024-09-05 15:44:25,140 INFO POST Request Status Code : 201 +2024-09-05 15:44:25,140 INFO POST request is successful... +2024-09-05 15:44:25,140 INFO Response JSON : {"name":"morpheus","job":"leader","id":"945","createdAt":"2024-09-05T10:12:52.325Z"} +2024-09-05 15:44:25,142 INFO Starting test cleanup process... +2024-09-05 15:44:25,142 INFO Cleaning up authentication token... +2024-09-05 15:44:25,142 INFO Authentication token cleaned up successfully. +2024-09-05 15:44:25,142 INFO Test cleanup completed. Resources released. diff --git a/Logs/log_20240905_154651.log b/Logs/log_20240905_154651.log new file mode 100644 index 0000000..1f2d19e --- /dev/null +++ b/Logs/log_20240905_154651.log @@ -0,0 +1,138 @@ +2024-09-05 15:46:51,549 INFO Starting test setup process... +2024-09-05 15:46:51,550 INFO Generating authentication token... +2024-09-05 15:46:51,553 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:51,554 INFO Authentication token generated successfully. +2024-09-05 15:46:51,554 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:46:51,558 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:51,559 INFO *********** executing test_004 **************** +2024-09-05 15:46:51,560 INFO Request url is : https://reqres.in/api/objects/6 +2024-09-05 15:46:51,561 INFO Initializing DELETE REST call from https://reqres.in/api/objects/6 +2024-09-05 15:46:52,066 ERROR Unknown content type or empty response. +2024-09-05 15:46:52,066 INFO DELETE Response : None +2024-09-05 15:46:52,067 INFO DELETE request Status code : 400 +2024-09-05 15:46:52,067 ERROR PUT request Failed...!!! +2024-09-05 15:46:52,067 ERROR Unknown content type or empty response. +2024-09-05 15:46:52,067 ERROR Response Error Message: None +2024-09-05 15:46:52,068 ERROR Unknown content type or empty response. +2024-09-05 15:46:52,069 INFO Starting test cleanup process... +2024-09-05 15:46:52,069 INFO Cleaning up authentication token... +2024-09-05 15:46:52,069 INFO Authentication token cleaned up successfully. +2024-09-05 15:46:52,069 INFO Test cleanup completed. Resources released. +2024-09-05 15:46:52,085 INFO Starting test setup process... +2024-09-05 15:46:52,085 INFO Generating authentication token... +2024-09-05 15:46:52,088 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:52,089 INFO Authentication token generated successfully. +2024-09-05 15:46:52,089 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:46:52,093 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:52,093 INFO *********** executing test_001 **************** +2024-09-05 15:46:52,093 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 15:46:52,094 INFO Initializing GET rest call from https://reqres.in/api/users/2 +2024-09-05 15:46:52,188 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 15:46:52,188 INFO GET Response : {'data': {'id': 2, 'email': 'janet.weaver@reqres.in', 'first_name': 'Janet', 'last_name': 'Weaver', 'avatar': 'https://reqres.in/img/faces/2-image.jpg'}, 'support': {'url': 'https://reqres.in/#support-heading', 'text': 'To keep ReqRes free, contributions towards server costs are appreciated!'}} +2024-09-05 15:46:52,188 INFO GET Request Status Code : 200 +2024-09-05 15:46:52,189 INFO GET request is Successful..... +2024-09-05 15:46:52,189 INFO Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +2024-09-05 15:46:52,189 INFO type of json response : +2024-09-05 15:46:52,191 INFO JSON data successfully saved to API_Requests/Data/Response_Body\get_data.json +2024-09-05 15:46:52,193 INFO Starting test cleanup process... +2024-09-05 15:46:52,193 INFO Cleaning up authentication token... +2024-09-05 15:46:52,193 INFO Authentication token cleaned up successfully. +2024-09-05 15:46:52,194 INFO Test cleanup completed. Resources released. +2024-09-05 15:46:52,202 INFO Starting test setup process... +2024-09-05 15:46:52,203 INFO Generating authentication token... +2024-09-05 15:46:52,204 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:52,205 INFO Authentication token generated successfully. +2024-09-05 15:46:52,205 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:46:52,206 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:52,207 INFO *********** executing test_001 **************** +2024-09-05 15:46:52,207 INFO Request url is : https://reqres.in/api/unknown/23 +2024-09-05 15:46:52,207 INFO Initializing GET rest call from https://reqres.in/api/unknown/23 +2024-09-05 15:46:52,654 ERROR Unknown content type or empty response. +2024-09-05 15:46:52,655 INFO GET Response : None +2024-09-05 15:46:52,655 INFO GET Request Status Code : 400 +2024-09-05 15:46:52,655 ERROR GET Request failed....!!! +2024-09-05 15:46:52,655 ERROR Unknown content type or empty response. +2024-09-05 15:46:52,655 ERROR Response Error Message: None +2024-09-05 15:46:52,656 ERROR Unknown content type or empty response. +2024-09-05 15:46:52,778 INFO Starting test cleanup process... +2024-09-05 15:46:52,778 INFO Cleaning up authentication token... +2024-09-05 15:46:52,778 INFO Authentication token cleaned up successfully. +2024-09-05 15:46:52,778 INFO Test cleanup completed. Resources released. +2024-09-05 15:46:52,787 INFO Starting test setup process... +2024-09-05 15:46:52,787 INFO Generating authentication token... +2024-09-05 15:46:52,789 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:52,789 INFO Authentication token generated successfully. +2024-09-05 15:46:52,789 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:46:52,792 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:52,794 INFO JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +2024-09-05 15:46:52,794 INFO *********** executing test_005 **************** +2024-09-05 15:46:52,794 INFO Request url is : https://reqres.in/api/users +2024-09-05 15:46:52,794 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 15:46:53,175 INFO Response JSON : {"name":"morpheus","job":"leader","id":"305","createdAt":"2024-09-05T10:15:20.414Z"} +2024-09-05 15:46:53,175 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '305', 'createdAt': '2024-09-05T10:15:20.414Z'} +2024-09-05 15:46:53,176 INFO POST Request Status Code : 201 +2024-09-05 15:46:53,176 INFO POST Request Status Code : 201 +2024-09-05 15:46:53,177 INFO POST request is successful... +2024-09-05 15:46:53,178 INFO Response JSON : {"name":"morpheus","job":"leader","id":"305","createdAt":"2024-09-05T10:15:20.414Z"} +2024-09-05 15:46:53,179 INFO Starting test cleanup process... +2024-09-05 15:46:53,179 INFO Cleaning up authentication token... +2024-09-05 15:46:53,179 INFO Authentication token cleaned up successfully. +2024-09-05 15:46:53,181 INFO Test cleanup completed. Resources released. +2024-09-05 15:46:53,191 INFO Starting test setup process... +2024-09-05 15:46:53,192 INFO Generating authentication token... +2024-09-05 15:46:53,194 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:53,194 INFO Authentication token generated successfully. +2024-09-05 15:46:53,195 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:46:53,197 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:53,197 INFO *********** executing test_002 **************** +2024-09-05 15:46:53,197 INFO Request url is : https://reqres.in/api/users +2024-09-05 15:46:53,197 INFO Initializing POST rest call from https://reqres.in/api/users +2024-09-05 15:46:53,579 INFO Response JSON : {"name":"morpheus","job":"leader","id":"807","createdAt":"2024-09-05T10:15:20.815Z"} +2024-09-05 15:46:53,579 INFO POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '807', 'createdAt': '2024-09-05T10:15:20.815Z'} +2024-09-05 15:46:53,580 INFO POST Request Status Code : 201 +2024-09-05 15:46:53,580 INFO POST Request Status Code : 201 +2024-09-05 15:46:53,581 INFO POST request is successful... +2024-09-05 15:46:53,581 INFO Response JSON : {"name":"morpheus","job":"leader","id":"807","createdAt":"2024-09-05T10:15:20.815Z"} +2024-09-05 15:46:53,582 INFO Starting test cleanup process... +2024-09-05 15:46:53,582 INFO Cleaning up authentication token... +2024-09-05 15:46:53,583 INFO Authentication token cleaned up successfully. +2024-09-05 15:46:53,583 INFO Test cleanup completed. Resources released. +2024-09-05 15:46:53,592 INFO Starting test setup process... +2024-09-05 15:46:53,592 INFO Generating authentication token... +2024-09-05 15:46:53,596 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:53,596 INFO Authentication token generated successfully. +2024-09-05 15:46:53,597 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:46:53,599 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:53,602 INFO JSON data successfully read from API_Requests/Data/Request_Body\put_data.json +2024-09-05 15:46:53,602 INFO *********** executing test_003 **************** +2024-09-05 15:46:53,603 INFO Request url is : https://reqres.in/api/users/2 +2024-09-05 15:46:53,603 INFO Initializing PUT rest call from https://reqres.in/api/users/2 +2024-09-05 15:46:53,988 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T10:15:21.230Z"} +2024-09-05 15:46:53,988 INFO PUT Response : {'name': 'morpheus', 'job': 'zion resident', 'updatedAt': '2024-09-05T10:15:21.230Z'} +2024-09-05 15:46:53,989 INFO PUT request Status code : 200 +2024-09-05 15:46:53,989 INFO PUT request is successful..... +2024-09-05 15:46:53,990 INFO Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T10:15:21.230Z"} +2024-09-05 15:46:53,992 INFO Starting test cleanup process... +2024-09-05 15:46:53,993 INFO Cleaning up authentication token... +2024-09-05 15:46:53,993 INFO Authentication token cleaned up successfully. +2024-09-05 15:46:53,994 INFO Test cleanup completed. Resources released. +2024-09-05 15:46:54,005 INFO Starting test setup process... +2024-09-05 15:46:54,005 INFO Generating authentication token... +2024-09-05 15:46:54,007 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:54,007 INFO Authentication token generated successfully. +2024-09-05 15:46:54,007 INFO Test setup completed. Ready to execute tests. +2024-09-05 15:46:54,009 INFO Base url is : https://reqres.in/api/ +2024-09-05 15:46:54,009 INFO *********** executing test_007 **************** +2024-09-05 15:46:54,009 INFO Request url is : https://reqres.in/api/register +2024-09-05 15:46:54,009 INFO Initializing POST rest call from https://reqres.in/api/register +2024-09-05 15:46:54,400 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:46:54,400 INFO POST Response : {'error': 'Missing password'} +2024-09-05 15:46:54,400 INFO POST Request Status Code : 400 +2024-09-05 15:46:54,401 ERROR POST Request Failed +2024-09-05 15:46:54,401 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:46:54,401 ERROR Response Error message: {'error': 'Missing password'} +2024-09-05 15:46:54,402 INFO Response JSON : {"error":"Missing password"} +2024-09-05 15:46:54,410 INFO Starting test cleanup process... +2024-09-05 15:46:54,410 INFO Cleaning up authentication token... +2024-09-05 15:46:54,411 INFO Authentication token cleaned up successfully. +2024-09-05 15:46:54,411 INFO Test cleanup completed. Resources released. diff --git a/Reports/Allure_Reports/17aeb801-eb48-4ada-8ece-5db552612b96-result.json b/Reports/Allure_Reports/17aeb801-eb48-4ada-8ece-5db552612b96-result.json new file mode 100644 index 0000000..6490d16 --- /dev/null +++ b/Reports/Allure_Reports/17aeb801-eb48-4ada-8ece-5db552612b96-result.json @@ -0,0 +1 @@ +{"name": "test_004", "status": "passed", "description": "Test to resource is deleted from Backend ", "attachments": [{"name": "log", "source": "36edb3d7-c8e5-4ebc-81cc-fe308b904a2a-attachment.txt", "type": "text/plain"}], "start": 1725531411556, "stop": 1725531412068, "uuid": "4acb0e07-6510-438e-b229-c454f0a58116", "historyId": "e71bba15a74711cba86cb7e372fc729a", "testCaseId": "e71bba15a74711cba86cb7e372fc729a", "fullName": "API_Requests.Tests.test_delete_request.Test_004#test_004", "labels": [{"name": "parentSuite", "value": "API_Requests.Tests"}, {"name": "suite", "value": "test_delete_request"}, {"name": "subSuite", "value": "Test_004"}, {"name": "host", "value": "NIT2LPT-24-269"}, {"name": "thread", "value": "15292-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "API_Requests.Tests.test_delete_request"}]} \ No newline at end of file diff --git a/Reports/Allure_Reports/23d9e55b-38bf-44d3-9140-1c6d59b0864f-attachment.txt b/Reports/Allure_Reports/23d9e55b-38bf-44d3-9140-1c6d59b0864f-attachment.txt new file mode 100644 index 0000000..9264a3f --- /dev/null +++ b/Reports/Allure_Reports/23d9e55b-38bf-44d3-9140-1c6d59b0864f-attachment.txt @@ -0,0 +1,20 @@ +INFO  conf.logger:conftest.py:27 Starting test setup process... +INFO  conf.logger:conftest.py:29 Generating authentication token... +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:conftest.py:31 Authentication token generated successfully. +INFO  conf.logger:conftest.py:32 Test setup completed. Ready to execute tests. +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:test_register_unsuccessful.py:26 *********** executing test_007 **************** +INFO  conf.logger:Rest_Client.py:92 Request url is : https://reqres.in/api/register +INFO  conf.logger:Rest_Client.py:97 Initializing POST rest call from https://reqres.in/api/register +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"error":"Missing password"} +INFO  conf.logger:Rest_Client.py:99 POST Response : {'error': 'Missing password'} +INFO  conf.logger:Rest_Client.py:100 POST Request Status Code : 400 +ERROR  conf.logger:Rest_Client.py:112 POST Request Failed +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"error":"Missing password"} +ERROR  conf.logger:Rest_Client.py:113 Response Error message: {'error': 'Missing password'} +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"error":"Missing password"} +INFO  conf.logger:conftest.py:34 Starting test cleanup process... +INFO  conf.logger:conftest.py:36 Cleaning up authentication token... +INFO  conf.logger:conftest.py:37 Authentication token cleaned up successfully. +INFO  conf.logger:conftest.py:38 Test cleanup completed. Resources released. \ No newline at end of file diff --git a/Reports/Allure_Reports/29a305ae-2029-4844-be40-65134db21569-container.json b/Reports/Allure_Reports/29a305ae-2029-4844-be40-65134db21569-container.json new file mode 100644 index 0000000..c935f31 --- /dev/null +++ b/Reports/Allure_Reports/29a305ae-2029-4844-be40-65134db21569-container.json @@ -0,0 +1 @@ +{"uuid": "473263a6-5c97-47f9-8616-c75faa62db15", "children": ["9704c27b-6b66-43f2-8091-1b39f2d17a8f"], "befores": [{"name": "setup_teardown", "status": "passed", "start": 1725531413191, "stop": 1725531413195}], "afters": [{"name": "setup_teardown::0", "status": "passed", "start": 1725531413583, "stop": 1725531413584}], "start": 1725531413191, "stop": 1725531413584} \ No newline at end of file diff --git a/Reports/Allure_Reports/32aedb8a-655a-4f3c-82d0-c9b8be96901a-attachment.txt b/Reports/Allure_Reports/32aedb8a-655a-4f3c-82d0-c9b8be96901a-attachment.txt new file mode 100644 index 0000000..c7d8faa --- /dev/null +++ b/Reports/Allure_Reports/32aedb8a-655a-4f3c-82d0-c9b8be96901a-attachment.txt @@ -0,0 +1,20 @@ +INFO  conf.logger:conftest.py:27 Starting test setup process... +INFO  conf.logger:conftest.py:29 Generating authentication token... +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:conftest.py:31 Authentication token generated successfully. +INFO  conf.logger:conftest.py:32 Test setup completed. Ready to execute tests. +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:test_no_data_found_request.py:23 *********** executing test_001 **************** +INFO  conf.logger:Rest_Client.py:42 Request url is : https://reqres.in/api/unknown/23 +INFO  conf.logger:Rest_Client.py:47 Initializing GET rest call from https://reqres.in/api/unknown/23 +ERROR  conf.logger:Rest_Client.py:240 Unknown content type or empty response. +INFO  conf.logger:Rest_Client.py:50 GET Response : None +INFO  conf.logger:Rest_Client.py:51 GET Request Status Code : 400 +ERROR  conf.logger:Rest_Client.py:60 GET Request failed....!!! +ERROR  conf.logger:Rest_Client.py:240 Unknown content type or empty response. +ERROR  conf.logger:Rest_Client.py:61 Response Error Message: None +ERROR  conf.logger:Rest_Client.py:240 Unknown content type or empty response. +INFO  conf.logger:conftest.py:34 Starting test cleanup process... +INFO  conf.logger:conftest.py:36 Cleaning up authentication token... +INFO  conf.logger:conftest.py:37 Authentication token cleaned up successfully. +INFO  conf.logger:conftest.py:38 Test cleanup completed. Resources released. \ No newline at end of file diff --git a/Reports/Allure_Reports/36edb3d7-c8e5-4ebc-81cc-fe308b904a2a-attachment.txt b/Reports/Allure_Reports/36edb3d7-c8e5-4ebc-81cc-fe308b904a2a-attachment.txt new file mode 100644 index 0000000..8a93dd3 --- /dev/null +++ b/Reports/Allure_Reports/36edb3d7-c8e5-4ebc-81cc-fe308b904a2a-attachment.txt @@ -0,0 +1,20 @@ +INFO  conf.logger:conftest.py:27 Starting test setup process... +INFO  conf.logger:conftest.py:29 Generating authentication token... +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:conftest.py:31 Authentication token generated successfully. +INFO  conf.logger:conftest.py:32 Test setup completed. Ready to execute tests. +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:test_delete_request.py:18 *********** executing test_004 **************** +INFO  conf.logger:Rest_Client.py:186 Request url is : https://reqres.in/api/objects/6 +INFO  conf.logger:Rest_Client.py:190 Initializing DELETE REST call from https://reqres.in/api/objects/6 +ERROR  conf.logger:Rest_Client.py:240 Unknown content type or empty response. +INFO  conf.logger:Rest_Client.py:192 DELETE Response : None +INFO  conf.logger:Rest_Client.py:193 DELETE request Status code : 400 +ERROR  conf.logger:Rest_Client.py:202 PUT request Failed...!!! +ERROR  conf.logger:Rest_Client.py:240 Unknown content type or empty response. +ERROR  conf.logger:Rest_Client.py:203 Response Error Message: None +ERROR  conf.logger:Rest_Client.py:240 Unknown content type or empty response. +INFO  conf.logger:conftest.py:34 Starting test cleanup process... +INFO  conf.logger:conftest.py:36 Cleaning up authentication token... +INFO  conf.logger:conftest.py:37 Authentication token cleaned up successfully. +INFO  conf.logger:conftest.py:38 Test cleanup completed. Resources released. \ No newline at end of file diff --git a/Reports/Allure_Reports/52681722-9e67-42bb-86a2-6edca016f6c1-result.json b/Reports/Allure_Reports/52681722-9e67-42bb-86a2-6edca016f6c1-result.json new file mode 100644 index 0000000..6ffe5b8 --- /dev/null +++ b/Reports/Allure_Reports/52681722-9e67-42bb-86a2-6edca016f6c1-result.json @@ -0,0 +1 @@ +{"name": "test_007", "status": "failed", "statusDetails": {"message": "AssertionError: assert 400 == 201", "trace": "self = , setup_teardown = None\n\n def test_007(self,setup_teardown):\n \"\"\"\" Test to check POST Request to register successfully \"\"\"\n \n self.base_url = get_config()['API']['base_url']\n self.client = RestClient(self.base_url)\n self.json = {\n \"email\": \"sydney@fife\"\n }\n \n self.headers = {\n 'Content-Type': 'application/json'\n }\n \n logger.info(\"*********** executing test_007 ****************\")\n \n post_request,status_code = self.client.post_request(end_point=\"register\",data=self.json,headers=self.headers,json_data_fmt=True,response_with_status_code=True)\n \n assert post_request is not None, \"POST request returned None\"\n> assert status_code == 201\nE assert 400 == 201\n\nAPI_Requests\\Tests\\test_register_unsuccessful.py:31: AssertionError"}, "description": "\" Test to check POST Request to register successfully ", "attachments": [{"name": "log", "source": "23d9e55b-38bf-44d3-9140-1c6d59b0864f-attachment.txt", "type": "text/plain"}], "start": 1725531414009, "stop": 1725531414403, "uuid": "fb299356-b11d-434a-920d-f2e51b401eb3", "historyId": "9e8b938e99f38f72b31ca7e0fe06f4c0", "testCaseId": "9e8b938e99f38f72b31ca7e0fe06f4c0", "fullName": "API_Requests.Tests.test_register_unsuccessful.Test_007#test_007", "labels": [{"name": "parentSuite", "value": "API_Requests.Tests"}, {"name": "suite", "value": "test_register_unsuccessful"}, {"name": "subSuite", "value": "Test_007"}, {"name": "host", "value": "NIT2LPT-24-269"}, {"name": "thread", "value": "15292-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "API_Requests.Tests.test_register_unsuccessful"}]} \ No newline at end of file diff --git a/Reports/Allure_Reports/5853ce53-0837-42e9-a604-49a24071ed8d-result.json b/Reports/Allure_Reports/5853ce53-0837-42e9-a604-49a24071ed8d-result.json new file mode 100644 index 0000000..81fb308 --- /dev/null +++ b/Reports/Allure_Reports/5853ce53-0837-42e9-a604-49a24071ed8d-result.json @@ -0,0 +1 @@ +{"name": "test_001", "status": "failed", "statusDetails": {"message": "AssertionError: GET request returned None\nassert None is not None", "trace": "self = , setup_teardown = None\n\n def test_001(self,setup_teardown):\n \n \"\"\"\" Test to check GET Request is successful with response and successful status code\"\"\"\n \n self.base_url = get_config()['API']['base_url']\n self.client = RestClient(self.base_url)\n \n self.headers = {\n 'Content-Type' : 'application/json'\n }\n \n logging.info(\"*********** executing test_001 ****************\")\n \n get_request,status_code = self.client.get_request(end_point=\"unknown/23\", headers=self.headers,response_with_status_code=True,json_data_fmt=True)\n \n> assert get_request is not None, \"GET request returned None\"\nE AssertionError: GET request returned None\nE assert None is not None\n\nAPI_Requests\\Tests\\test_no_data_found_request.py:27: AssertionError"}, "description": "\" Test to check GET Request is successful with response and successful status code", "attachments": [{"name": "log", "source": "32aedb8a-655a-4f3c-82d0-c9b8be96901a-attachment.txt", "type": "text/plain"}], "start": 1725531412206, "stop": 1725531412656, "uuid": "63b7fdb4-da3c-4c08-87dd-5bd0d38766cb", "historyId": "d7acae85205a2935734d14c95149a29a", "testCaseId": "d7acae85205a2935734d14c95149a29a", "fullName": "API_Requests.Tests.test_no_data_found_request.Test_001#test_001", "labels": [{"name": "parentSuite", "value": "API_Requests.Tests"}, {"name": "suite", "value": "test_no_data_found_request"}, {"name": "subSuite", "value": "Test_001"}, {"name": "host", "value": "NIT2LPT-24-269"}, {"name": "thread", "value": "15292-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "API_Requests.Tests.test_no_data_found_request"}]} \ No newline at end of file diff --git a/Reports/Allure_Reports/7aec0816-3fc7-47ae-971a-b9382e210bc2-attachment.txt b/Reports/Allure_Reports/7aec0816-3fc7-47ae-971a-b9382e210bc2-attachment.txt new file mode 100644 index 0000000..5baad1f --- /dev/null +++ b/Reports/Allure_Reports/7aec0816-3fc7-47ae-971a-b9382e210bc2-attachment.txt @@ -0,0 +1,20 @@ +INFO  conf.logger:conftest.py:27 Starting test setup process... +INFO  conf.logger:conftest.py:29 Generating authentication token... +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:conftest.py:31 Authentication token generated successfully. +INFO  conf.logger:conftest.py:32 Test setup completed. Ready to execute tests. +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:test_get_request.py:23 *********** executing test_001 **************** +INFO  conf.logger:Rest_Client.py:42 Request url is : https://reqres.in/api/users/2 +INFO  conf.logger:Rest_Client.py:47 Initializing GET rest call from https://reqres.in/api/users/2 +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +INFO  conf.logger:Rest_Client.py:50 GET Response : {'data': {'id': 2, 'email': 'janet.weaver@reqres.in', 'first_name': 'Janet', 'last_name': 'Weaver', 'avatar': 'https://reqres.in/img/faces/2-image.jpg'}, 'support': {'url': 'https://reqres.in/#support-heading', 'text': 'To keep ReqRes free, contributions towards server costs are appreciated!'}} +INFO  conf.logger:Rest_Client.py:51 GET Request Status Code : 200 +INFO  conf.logger:Rest_Client.py:53 GET request is Successful..... +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"data":{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}} +INFO  conf.logger:test_get_request.py:31 type of json response : +INFO  conf.logger:File_Operations.py:45 JSON data successfully saved to API_Requests/Data/Response_Body\get_data.json +INFO  conf.logger:conftest.py:34 Starting test cleanup process... +INFO  conf.logger:conftest.py:36 Cleaning up authentication token... +INFO  conf.logger:conftest.py:37 Authentication token cleaned up successfully. +INFO  conf.logger:conftest.py:38 Test cleanup completed. Resources released. \ No newline at end of file diff --git a/Reports/Allure_Reports/7f364411-531b-4b40-b81a-966ed61337e8-attachment.txt b/Reports/Allure_Reports/7f364411-531b-4b40-b81a-966ed61337e8-attachment.txt new file mode 100644 index 0000000..6f1c5ee --- /dev/null +++ b/Reports/Allure_Reports/7f364411-531b-4b40-b81a-966ed61337e8-attachment.txt @@ -0,0 +1,20 @@ +INFO  conf.logger:conftest.py:27 Starting test setup process... +INFO  conf.logger:conftest.py:29 Generating authentication token... +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:conftest.py:31 Authentication token generated successfully. +INFO  conf.logger:conftest.py:32 Test setup completed. Ready to execute tests. +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:File_Operations.py:64 JSON data successfully read from API_Requests/Data/Request_Body\post_data.json +INFO  conf.logger:test_post_data_request.py:22 *********** executing test_005 **************** +INFO  conf.logger:Rest_Client.py:92 Request url is : https://reqres.in/api/users +INFO  conf.logger:Rest_Client.py:97 Initializing POST rest call from https://reqres.in/api/users +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"name":"morpheus","job":"leader","id":"305","createdAt":"2024-09-05T10:15:20.414Z"} +INFO  conf.logger:Rest_Client.py:99 POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '305', 'createdAt': '2024-09-05T10:15:20.414Z'} +INFO  conf.logger:Rest_Client.py:100 POST Request Status Code : 201 +INFO  conf.logger:Rest_Client.py:102 POST Request Status Code : 201 +INFO  conf.logger:Rest_Client.py:104 POST request is successful... +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"name":"morpheus","job":"leader","id":"305","createdAt":"2024-09-05T10:15:20.414Z"} +INFO  conf.logger:conftest.py:34 Starting test cleanup process... +INFO  conf.logger:conftest.py:36 Cleaning up authentication token... +INFO  conf.logger:conftest.py:37 Authentication token cleaned up successfully. +INFO  conf.logger:conftest.py:38 Test cleanup completed. Resources released. \ No newline at end of file diff --git a/Reports/Allure_Reports/825afacb-9939-408c-88d1-4ef3b5efd67a-container.json b/Reports/Allure_Reports/825afacb-9939-408c-88d1-4ef3b5efd67a-container.json new file mode 100644 index 0000000..18fa16b --- /dev/null +++ b/Reports/Allure_Reports/825afacb-9939-408c-88d1-4ef3b5efd67a-container.json @@ -0,0 +1 @@ +{"uuid": "be4ae1a1-d2c9-4dd5-b190-23b8c658280a", "children": ["10be088d-5a96-4b14-92fd-bb6ec641bebd"], "befores": [{"name": "setup_teardown", "status": "passed", "start": 1725531413591, "stop": 1725531413598}], "afters": [{"name": "setup_teardown::0", "status": "passed", "start": 1725531413992, "stop": 1725531413994}], "start": 1725531413591, "stop": 1725531413994} \ No newline at end of file diff --git a/Reports/Allure_Reports/96f69c31-c961-4912-a207-a46693e23256-result.json b/Reports/Allure_Reports/96f69c31-c961-4912-a207-a46693e23256-result.json new file mode 100644 index 0000000..7d56d90 --- /dev/null +++ b/Reports/Allure_Reports/96f69c31-c961-4912-a207-a46693e23256-result.json @@ -0,0 +1 @@ +{"name": "test_001", "status": "passed", "description": "\" Test to check GET Request is successful with response and successful status code", "attachments": [{"name": "log", "source": "7aec0816-3fc7-47ae-971a-b9382e210bc2-attachment.txt", "type": "text/plain"}], "start": 1725531412091, "stop": 1725531412193, "uuid": "ce9366f1-e08c-4196-bf74-e528698bb00c", "historyId": "c49f6ccde30bba5f761972896245fa5d", "testCaseId": "c49f6ccde30bba5f761972896245fa5d", "fullName": "API_Requests.Tests.test_get_request.Test_001#test_001", "labels": [{"name": "parentSuite", "value": "API_Requests.Tests"}, {"name": "suite", "value": "test_get_request"}, {"name": "subSuite", "value": "Test_001"}, {"name": "host", "value": "NIT2LPT-24-269"}, {"name": "thread", "value": "15292-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "API_Requests.Tests.test_get_request"}]} \ No newline at end of file diff --git a/Reports/Allure_Reports/99933b7a-84ea-47ee-92a8-2319708dc768-container.json b/Reports/Allure_Reports/99933b7a-84ea-47ee-92a8-2319708dc768-container.json new file mode 100644 index 0000000..e3b7efe --- /dev/null +++ b/Reports/Allure_Reports/99933b7a-84ea-47ee-92a8-2319708dc768-container.json @@ -0,0 +1 @@ +{"uuid": "30908757-f535-4110-9342-c78735708255", "children": ["f15613be-d981-4b54-a1a2-b4a3f0a0a34d"], "befores": [{"name": "setup_teardown", "status": "passed", "start": 1725531412787, "stop": 1725531412789}], "afters": [{"name": "setup_teardown::0", "status": "passed", "start": 1725531413180, "stop": 1725531413181}], "start": 1725531412787, "stop": 1725531413181} \ No newline at end of file diff --git a/Reports/Allure_Reports/a4b3837d-ea84-4138-8e32-cee846e6b2bd-result.json b/Reports/Allure_Reports/a4b3837d-ea84-4138-8e32-cee846e6b2bd-result.json new file mode 100644 index 0000000..dc9f8e3 --- /dev/null +++ b/Reports/Allure_Reports/a4b3837d-ea84-4138-8e32-cee846e6b2bd-result.json @@ -0,0 +1 @@ +{"name": "test_002", "status": "passed", "description": "\" Test to check POST Request is successful to add new resource into server", "attachments": [{"name": "log", "source": "c6fb5d42-64d5-475c-8f3f-ede4ba856a9d-attachment.txt", "type": "text/plain"}], "start": 1725531413195, "stop": 1725531413583, "uuid": "9704c27b-6b66-43f2-8091-1b39f2d17a8f", "historyId": "999315d5795dc310f54aeea4256b3c9d", "testCaseId": "999315d5795dc310f54aeea4256b3c9d", "fullName": "API_Requests.Tests.test_post_request.Test_002#test_002", "labels": [{"name": "parentSuite", "value": "API_Requests.Tests"}, {"name": "suite", "value": "test_post_request"}, {"name": "subSuite", "value": "Test_002"}, {"name": "host", "value": "NIT2LPT-24-269"}, {"name": "thread", "value": "15292-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "API_Requests.Tests.test_post_request"}]} \ No newline at end of file diff --git a/Reports/Allure_Reports/aff6372d-8698-4e61-8cf8-58fb9ae49027-result.json b/Reports/Allure_Reports/aff6372d-8698-4e61-8cf8-58fb9ae49027-result.json new file mode 100644 index 0000000..f8b6275 --- /dev/null +++ b/Reports/Allure_Reports/aff6372d-8698-4e61-8cf8-58fb9ae49027-result.json @@ -0,0 +1 @@ +{"name": "test_003", "status": "passed", "attachments": [{"name": "log", "source": "b165887c-e152-4f37-aa95-bd41fcddb8e7-attachment.txt", "type": "text/plain"}], "start": 1725531413598, "stop": 1725531413992, "uuid": "10be088d-5a96-4b14-92fd-bb6ec641bebd", "historyId": "f58e8e4672b2f85a67ec3dd4aec1e97e", "testCaseId": "f58e8e4672b2f85a67ec3dd4aec1e97e", "fullName": "API_Requests.Tests.test_put_request.Test_003#test_003", "labels": [{"name": "parentSuite", "value": "API_Requests.Tests"}, {"name": "suite", "value": "test_put_request"}, {"name": "subSuite", "value": "Test_003"}, {"name": "host", "value": "NIT2LPT-24-269"}, {"name": "thread", "value": "15292-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "API_Requests.Tests.test_put_request"}]} \ No newline at end of file diff --git a/Reports/Allure_Reports/b165887c-e152-4f37-aa95-bd41fcddb8e7-attachment.txt b/Reports/Allure_Reports/b165887c-e152-4f37-aa95-bd41fcddb8e7-attachment.txt new file mode 100644 index 0000000..02e3b1c --- /dev/null +++ b/Reports/Allure_Reports/b165887c-e152-4f37-aa95-bd41fcddb8e7-attachment.txt @@ -0,0 +1,19 @@ +INFO  conf.logger:conftest.py:27 Starting test setup process... +INFO  conf.logger:conftest.py:29 Generating authentication token... +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:conftest.py:31 Authentication token generated successfully. +INFO  conf.logger:conftest.py:32 Test setup completed. Ready to execute tests. +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:File_Operations.py:64 JSON data successfully read from API_Requests/Data/Request_Body\put_data.json +INFO  conf.logger:test_put_request.py:19 *********** executing test_003 **************** +INFO  conf.logger:Rest_Client.py:144 Request url is : https://reqres.in/api/users/2 +INFO  conf.logger:Rest_Client.py:149 Initializing PUT rest call from https://reqres.in/api/users/2 +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T10:15:21.230Z"} +INFO  conf.logger:Rest_Client.py:152 PUT Response : {'name': 'morpheus', 'job': 'zion resident', 'updatedAt': '2024-09-05T10:15:21.230Z'} +INFO  conf.logger:Rest_Client.py:153 PUT request Status code : 200 +INFO  conf.logger:Rest_Client.py:155 PUT request is successful..... +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"name":"morpheus","job":"zion resident","updatedAt":"2024-09-05T10:15:21.230Z"} +INFO  conf.logger:conftest.py:34 Starting test cleanup process... +INFO  conf.logger:conftest.py:36 Cleaning up authentication token... +INFO  conf.logger:conftest.py:37 Authentication token cleaned up successfully. +INFO  conf.logger:conftest.py:38 Test cleanup completed. Resources released. \ No newline at end of file diff --git a/Reports/Allure_Reports/c1496cde-54a8-40da-95fa-078d835ee1ff-container.json b/Reports/Allure_Reports/c1496cde-54a8-40da-95fa-078d835ee1ff-container.json new file mode 100644 index 0000000..6ec36bd --- /dev/null +++ b/Reports/Allure_Reports/c1496cde-54a8-40da-95fa-078d835ee1ff-container.json @@ -0,0 +1 @@ +{"uuid": "10a9b466-662d-4138-b760-b0facac489cd", "children": ["fb299356-b11d-434a-920d-f2e51b401eb3"], "befores": [{"name": "setup_teardown", "status": "passed", "start": 1725531414004, "stop": 1725531414008}], "afters": [{"name": "setup_teardown::0", "status": "passed", "start": 1725531414411, "stop": 1725531414411}], "start": 1725531414004, "stop": 1725531414411} \ No newline at end of file diff --git a/Reports/Allure_Reports/c6fb5d42-64d5-475c-8f3f-ede4ba856a9d-attachment.txt b/Reports/Allure_Reports/c6fb5d42-64d5-475c-8f3f-ede4ba856a9d-attachment.txt new file mode 100644 index 0000000..927daf7 --- /dev/null +++ b/Reports/Allure_Reports/c6fb5d42-64d5-475c-8f3f-ede4ba856a9d-attachment.txt @@ -0,0 +1,19 @@ +INFO  conf.logger:conftest.py:27 Starting test setup process... +INFO  conf.logger:conftest.py:29 Generating authentication token... +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:conftest.py:31 Authentication token generated successfully. +INFO  conf.logger:conftest.py:32 Test setup completed. Ready to execute tests. +INFO  conf.logger:Rest_Client.py:17 Base url is : https://reqres.in/api/ +INFO  conf.logger:test_post_request.py:25 *********** executing test_002 **************** +INFO  conf.logger:Rest_Client.py:92 Request url is : https://reqres.in/api/users +INFO  conf.logger:Rest_Client.py:97 Initializing POST rest call from https://reqres.in/api/users +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"name":"morpheus","job":"leader","id":"807","createdAt":"2024-09-05T10:15:20.815Z"} +INFO  conf.logger:Rest_Client.py:99 POST Response : {'name': 'morpheus', 'job': 'leader', 'id': '807', 'createdAt': '2024-09-05T10:15:20.815Z'} +INFO  conf.logger:Rest_Client.py:100 POST Request Status Code : 201 +INFO  conf.logger:Rest_Client.py:102 POST Request Status Code : 201 +INFO  conf.logger:Rest_Client.py:104 POST request is successful... +INFO  conf.logger:Rest_Client.py:223 Response JSON : {"name":"morpheus","job":"leader","id":"807","createdAt":"2024-09-05T10:15:20.815Z"} +INFO  conf.logger:conftest.py:34 Starting test cleanup process... +INFO  conf.logger:conftest.py:36 Cleaning up authentication token... +INFO  conf.logger:conftest.py:37 Authentication token cleaned up successfully. +INFO  conf.logger:conftest.py:38 Test cleanup completed. Resources released. \ No newline at end of file diff --git a/Reports/Allure_Reports/e50cb7b3-208e-4f4b-ba7d-050c82ef4231-container.json b/Reports/Allure_Reports/e50cb7b3-208e-4f4b-ba7d-050c82ef4231-container.json new file mode 100644 index 0000000..63418a9 --- /dev/null +++ b/Reports/Allure_Reports/e50cb7b3-208e-4f4b-ba7d-050c82ef4231-container.json @@ -0,0 +1 @@ +{"uuid": "57ed48b3-c4af-4882-8e3e-fa5a9599e5f1", "children": ["63b7fdb4-da3c-4c08-87dd-5bd0d38766cb"], "befores": [{"name": "setup_teardown", "status": "passed", "start": 1725531412202, "stop": 1725531412205}], "afters": [{"name": "setup_teardown::0", "status": "passed", "start": 1725531412779, "stop": 1725531412780}], "start": 1725531412202, "stop": 1725531412780} \ No newline at end of file diff --git a/Reports/Allure_Reports/e61c76c2-c3b5-41ad-91fc-b3945d45aed4-result.json b/Reports/Allure_Reports/e61c76c2-c3b5-41ad-91fc-b3945d45aed4-result.json new file mode 100644 index 0000000..69da695 --- /dev/null +++ b/Reports/Allure_Reports/e61c76c2-c3b5-41ad-91fc-b3945d45aed4-result.json @@ -0,0 +1 @@ +{"name": "test_005", "status": "passed", "description": "\" Test to check POST Request is successful to add new resource into server", "attachments": [{"name": "log", "source": "7f364411-531b-4b40-b81a-966ed61337e8-attachment.txt", "type": "text/plain"}], "start": 1725531412789, "stop": 1725531413179, "uuid": "f15613be-d981-4b54-a1a2-b4a3f0a0a34d", "historyId": "5da66ed5337946512b8cde1b66de5fa3", "testCaseId": "5da66ed5337946512b8cde1b66de5fa3", "fullName": "API_Requests.Tests.test_post_data_request.Test_005#test_005", "labels": [{"name": "parentSuite", "value": "API_Requests.Tests"}, {"name": "suite", "value": "test_post_data_request"}, {"name": "subSuite", "value": "Test_005"}, {"name": "host", "value": "NIT2LPT-24-269"}, {"name": "thread", "value": "15292-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "API_Requests.Tests.test_post_data_request"}]} \ No newline at end of file diff --git a/Reports/Allure_Reports/eb86f39f-9a01-4d38-8812-e7af990fe508-container.json b/Reports/Allure_Reports/eb86f39f-9a01-4d38-8812-e7af990fe508-container.json new file mode 100644 index 0000000..e5a3308 --- /dev/null +++ b/Reports/Allure_Reports/eb86f39f-9a01-4d38-8812-e7af990fe508-container.json @@ -0,0 +1 @@ +{"uuid": "0c2025ca-8f72-43db-a212-04467ea238c1", "children": ["ce9366f1-e08c-4196-bf74-e528698bb00c"], "befores": [{"name": "setup_teardown", "status": "passed", "start": 1725531412085, "stop": 1725531412089}], "afters": [{"name": "setup_teardown::0", "status": "passed", "start": 1725531412194, "stop": 1725531412195}], "start": 1725531412085, "stop": 1725531412195} \ No newline at end of file diff --git a/Reports/Allure_Reports/fe8d3973-6d84-4bf2-b676-2a8c1aaced9b-container.json b/Reports/Allure_Reports/fe8d3973-6d84-4bf2-b676-2a8c1aaced9b-container.json new file mode 100644 index 0000000..29dc289 --- /dev/null +++ b/Reports/Allure_Reports/fe8d3973-6d84-4bf2-b676-2a8c1aaced9b-container.json @@ -0,0 +1 @@ +{"uuid": "4473cb33-bd84-464e-aae1-dcf467780305", "children": ["4acb0e07-6510-438e-b229-c454f0a58116"], "befores": [{"name": "setup_teardown", "status": "passed", "start": 1725531411549, "stop": 1725531411555}], "afters": [{"name": "setup_teardown::0", "status": "passed", "start": 1725531412069, "stop": 1725531412069}], "start": 1725531411549, "stop": 1725531412069} \ No newline at end of file diff --git a/Reports/HTML_Reports/assets/style.css b/Reports/HTML_Reports/assets/style.css new file mode 100644 index 0000000..561524c --- /dev/null +++ b/Reports/HTML_Reports/assets/style.css @@ -0,0 +1,319 @@ +body { + font-family: Helvetica, Arial, sans-serif; + font-size: 12px; + /* do not increase min-width as some may use split screens */ + min-width: 800px; + color: #999; +} + +h1 { + font-size: 24px; + color: black; +} + +h2 { + font-size: 16px; + color: black; +} + +p { + color: black; +} + +a { + color: #999; +} + +table { + border-collapse: collapse; +} + +/****************************** + * SUMMARY INFORMATION + ******************************/ +#environment td { + padding: 5px; + border: 1px solid #e6e6e6; + vertical-align: top; +} +#environment tr:nth-child(odd) { + background-color: #f6f6f6; +} +#environment ul { + margin: 0; + padding: 0 20px; +} + +/****************************** + * TEST RESULT COLORS + ******************************/ +span.passed, +.passed .col-result { + color: green; +} + +span.skipped, +span.xfailed, +span.rerun, +.skipped .col-result, +.xfailed .col-result, +.rerun .col-result { + color: orange; +} + +span.error, +span.failed, +span.xpassed, +.error .col-result, +.failed .col-result, +.xpassed .col-result { + color: red; +} + +.col-links__extra { + margin-right: 3px; +} + +/****************************** + * RESULTS TABLE + * + * 1. Table Layout + * 2. Extra + * 3. Sorting items + * + ******************************/ +/*------------------ + * 1. Table Layout + *------------------*/ +#results-table { + border: 1px solid #e6e6e6; + color: #999; + font-size: 12px; + width: 100%; +} +#results-table th, +#results-table td { + padding: 5px; + border: 1px solid #e6e6e6; + text-align: left; +} +#results-table th { + font-weight: bold; +} + +/*------------------ + * 2. Extra + *------------------*/ +.logwrapper { + max-height: 230px; + overflow-y: scroll; + background-color: #e6e6e6; +} +.logwrapper.expanded { + max-height: none; +} +.logwrapper.expanded .logexpander:after { + content: "collapse [-]"; +} +.logwrapper .logexpander { + z-index: 1; + position: sticky; + top: 10px; + width: max-content; + border: 1px solid; + border-radius: 3px; + padding: 5px 7px; + margin: 10px 0 10px calc(100% - 80px); + cursor: pointer; + background-color: #e6e6e6; +} +.logwrapper .logexpander:after { + content: "expand [+]"; +} +.logwrapper .logexpander:hover { + color: #000; + border-color: #000; +} +.logwrapper .log { + min-height: 40px; + position: relative; + top: -50px; + height: calc(100% + 50px); + border: 1px solid #e6e6e6; + color: black; + display: block; + font-family: "Courier New", Courier, monospace; + padding: 5px; + padding-right: 80px; + white-space: pre-wrap; +} + +div.media { + border: 1px solid #e6e6e6; + float: right; + height: 240px; + margin: 0 5px; + overflow: hidden; + width: 320px; +} + +.media-container { + display: grid; + grid-template-columns: 25px auto 25px; + align-items: center; + flex: 1 1; + overflow: hidden; + height: 200px; +} + +.media-container--fullscreen { + grid-template-columns: 0px auto 0px; +} + +.media-container__nav--right, +.media-container__nav--left { + text-align: center; + cursor: pointer; +} + +.media-container__viewport { + cursor: pointer; + text-align: center; + height: inherit; +} +.media-container__viewport img, +.media-container__viewport video { + object-fit: cover; + width: 100%; + max-height: 100%; +} + +.media__name, +.media__counter { + display: flex; + flex-direction: row; + justify-content: space-around; + flex: 0 0 25px; + align-items: center; +} + +.collapsible td:not(.col-links) { + cursor: pointer; +} +.collapsible td:not(.col-links):hover::after { + color: #bbb; + font-style: italic; + cursor: pointer; +} + +.col-result { + width: 130px; +} +.col-result:hover::after { + content: " (hide details)"; +} + +.col-result.collapsed:hover::after { + content: " (show details)"; +} + +#environment-header h2:hover::after { + content: " (hide details)"; + color: #bbb; + font-style: italic; + cursor: pointer; + font-size: 12px; +} + +#environment-header.collapsed h2:hover::after { + content: " (show details)"; + color: #bbb; + font-style: italic; + cursor: pointer; + font-size: 12px; +} + +/*------------------ + * 3. Sorting items + *------------------*/ +.sortable { + cursor: pointer; +} +.sortable.desc:after { + content: " "; + position: relative; + left: 5px; + bottom: -12.5px; + border: 10px solid #4caf50; + border-bottom: 0; + border-left-color: transparent; + border-right-color: transparent; +} +.sortable.asc:after { + content: " "; + position: relative; + left: 5px; + bottom: 12.5px; + border: 10px solid #4caf50; + border-top: 0; + border-left-color: transparent; + border-right-color: transparent; +} + +.hidden, .summary__reload__button.hidden { + display: none; +} + +.summary__data { + flex: 0 0 550px; +} +.summary__reload { + flex: 1 1; + display: flex; + justify-content: center; +} +.summary__reload__button { + flex: 0 0 300px; + display: flex; + color: white; + font-weight: bold; + background-color: #4caf50; + text-align: center; + justify-content: center; + align-items: center; + border-radius: 3px; + cursor: pointer; +} +.summary__reload__button:hover { + background-color: #46a049; +} +.summary__spacer { + flex: 0 0 550px; +} + +.controls { + display: flex; + justify-content: space-between; +} + +.filters, +.collapse { + display: flex; + align-items: center; +} +.filters button, +.collapse button { + color: #999; + border: none; + background: none; + cursor: pointer; + text-decoration: underline; +} +.filters button:hover, +.collapse button:hover { + color: #ccc; +} + +.filter__label { + margin-right: 10px; +} diff --git a/Reports/HTML_Reports/requests_report.html b/Reports/HTML_Reports/requests_report.html new file mode 100644 index 0000000..0a8c0fa --- /dev/null +++ b/Reports/HTML_Reports/requests_report.html @@ -0,0 +1,770 @@ + + + + + requests_report.html + + + +

requests_report.html

+

Report generated on 05-Sep-2024 at 15:46:54 by pytest-html + v4.1.1

+
+

Environment

+
+
+ + + + + +
+
+

Summary

+
+
+

7 tests took 00:00:03.

+

(Un)check the boxes to filter the results.

+
+ +
+
+
+
+ + 2 Failed, + + 5 Passed, + + 0 Skipped, + + 0 Expected failures, + + 0 Unexpected passes, + + 0 Errors, + + 0 Reruns +
+
+  /  +
+
+
+
+
+
+
+
+ + + + + + + + + +
ResultTestDurationLinks
+ +
+
+ +
+ \ No newline at end of file diff --git a/Requirements/Architecture.txt b/Requirements/Architecture.txt new file mode 100644 index 0000000..d1a1e30 --- /dev/null +++ b/Requirements/Architecture.txt @@ -0,0 +1,46 @@ +JazzX/ +| +|-- API_Requests/ + |-- Data/ + |- Request_Body/ + |- post_data.json + |- put_data.json + |- Response_Body + |- get_data.json + + |-- Lib/ + |-- __init__.py + |-- Auth_details.py + |-- Rest_Client.py + |-- File_Operations.py + |-- Tests/ + |-- __init__.py + |-- test_delete_request.py + |-- test_get_request.py + |-- test_post_request.py + |-- test_post_data_request.py + |-- test_put_request.py + |-- conf/ + |-- __init__.py + |-- config.ini + |-- config.py + |-- conftest.py + |-- logger.py + |-- pytest.ini + |-- Logs/ + |-- log_20240828_172445.log + |-- log_20240828_173640.log + |-- Reports/ + |-- Allure_reports/ + |-- 5ec124e0-c4dc-4124-96c0-3d781f7d90f8-container.json + |-- 7bf6fe5a-6471-4808-8d54-960778cd2b00-attachment.txt + |-- 7df51b1e-3229-4b67-b91a-357b55060143-container.json + |-- 9c5bc5f9-05aa-47f8-bf25-789056a784e9-attachment.txt + |-- HTML_Reports/ + |-- getRequest_report.html + |-- postRequest_report.html + |-- Requirements/ + |-- Architecture.txt + |-- README.txt + |-- Requirements.txt + |-- Certificates diff --git a/Requirements/README.txt b/Requirements/README.txt new file mode 100644 index 0000000..2ce00fd --- /dev/null +++ b/Requirements/README.txt @@ -0,0 +1,37 @@ +Prerequisites +Python 3.9.1 or above + + +Steps to set_up +1. Create Python Virtual Environment +python -m venv /path/to/new/virtual/environment + +2.Activate Python virtual environment +\Scripts\activate + + +3.Install required python3 package +Navigate to home directory of project +pip3 install -r requirements.txt + + +Run the tests: +To execute all tests under example run: +pytest -v -s -rA +To execute a specific tests under example add -m and test marker: +pytest -v -s -m smoke -rA +To execute a specific tests with certain keyword under example file: +pytest -v -s -rA -k example + + +Reports +After execution is completed reports will get generated under report folders name called Allure_Reports and HTML_Reports +to generate HTML report +pytest -v -s -rA --html=test_example_report.html + +to generate Allure Report +1) first to make directory where all json files will be stored +pytest -v -s -rA --alluredir=Allure_Reports + +2) to generate allure reports pytest +allure serve Allure_Reports diff --git a/Requirements/Requirements.txt b/Requirements/Requirements.txt new file mode 100644 index 0000000..51af4c9 --- /dev/null +++ b/Requirements/Requirements.txt @@ -0,0 +1,19 @@ +Jinja2 == 3.1.4 +MarkupSafe == 2.1.5 +allure-pytest == 2.13.5 +allure-python-commons == 2.13.5 +attrs == 24.2.0 +certifi == 2024.7.4 +charset-normalizer == 3.3.2 +colorama == 0.4.6 +idna == 3.7 +iniconfig == 2.0.0 +logging == 0.4.9.6 +packaging == 24.1 +pip == 23.2.1 +pluggy == 1.5.0 +pytest == 8.3.2 +pytest-html == 4.1.1 +pytest-metadata == 3.1.1 +requests == 2.32.3 + diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 0000000..561524c --- /dev/null +++ b/assets/style.css @@ -0,0 +1,319 @@ +body { + font-family: Helvetica, Arial, sans-serif; + font-size: 12px; + /* do not increase min-width as some may use split screens */ + min-width: 800px; + color: #999; +} + +h1 { + font-size: 24px; + color: black; +} + +h2 { + font-size: 16px; + color: black; +} + +p { + color: black; +} + +a { + color: #999; +} + +table { + border-collapse: collapse; +} + +/****************************** + * SUMMARY INFORMATION + ******************************/ +#environment td { + padding: 5px; + border: 1px solid #e6e6e6; + vertical-align: top; +} +#environment tr:nth-child(odd) { + background-color: #f6f6f6; +} +#environment ul { + margin: 0; + padding: 0 20px; +} + +/****************************** + * TEST RESULT COLORS + ******************************/ +span.passed, +.passed .col-result { + color: green; +} + +span.skipped, +span.xfailed, +span.rerun, +.skipped .col-result, +.xfailed .col-result, +.rerun .col-result { + color: orange; +} + +span.error, +span.failed, +span.xpassed, +.error .col-result, +.failed .col-result, +.xpassed .col-result { + color: red; +} + +.col-links__extra { + margin-right: 3px; +} + +/****************************** + * RESULTS TABLE + * + * 1. Table Layout + * 2. Extra + * 3. Sorting items + * + ******************************/ +/*------------------ + * 1. Table Layout + *------------------*/ +#results-table { + border: 1px solid #e6e6e6; + color: #999; + font-size: 12px; + width: 100%; +} +#results-table th, +#results-table td { + padding: 5px; + border: 1px solid #e6e6e6; + text-align: left; +} +#results-table th { + font-weight: bold; +} + +/*------------------ + * 2. Extra + *------------------*/ +.logwrapper { + max-height: 230px; + overflow-y: scroll; + background-color: #e6e6e6; +} +.logwrapper.expanded { + max-height: none; +} +.logwrapper.expanded .logexpander:after { + content: "collapse [-]"; +} +.logwrapper .logexpander { + z-index: 1; + position: sticky; + top: 10px; + width: max-content; + border: 1px solid; + border-radius: 3px; + padding: 5px 7px; + margin: 10px 0 10px calc(100% - 80px); + cursor: pointer; + background-color: #e6e6e6; +} +.logwrapper .logexpander:after { + content: "expand [+]"; +} +.logwrapper .logexpander:hover { + color: #000; + border-color: #000; +} +.logwrapper .log { + min-height: 40px; + position: relative; + top: -50px; + height: calc(100% + 50px); + border: 1px solid #e6e6e6; + color: black; + display: block; + font-family: "Courier New", Courier, monospace; + padding: 5px; + padding-right: 80px; + white-space: pre-wrap; +} + +div.media { + border: 1px solid #e6e6e6; + float: right; + height: 240px; + margin: 0 5px; + overflow: hidden; + width: 320px; +} + +.media-container { + display: grid; + grid-template-columns: 25px auto 25px; + align-items: center; + flex: 1 1; + overflow: hidden; + height: 200px; +} + +.media-container--fullscreen { + grid-template-columns: 0px auto 0px; +} + +.media-container__nav--right, +.media-container__nav--left { + text-align: center; + cursor: pointer; +} + +.media-container__viewport { + cursor: pointer; + text-align: center; + height: inherit; +} +.media-container__viewport img, +.media-container__viewport video { + object-fit: cover; + width: 100%; + max-height: 100%; +} + +.media__name, +.media__counter { + display: flex; + flex-direction: row; + justify-content: space-around; + flex: 0 0 25px; + align-items: center; +} + +.collapsible td:not(.col-links) { + cursor: pointer; +} +.collapsible td:not(.col-links):hover::after { + color: #bbb; + font-style: italic; + cursor: pointer; +} + +.col-result { + width: 130px; +} +.col-result:hover::after { + content: " (hide details)"; +} + +.col-result.collapsed:hover::after { + content: " (show details)"; +} + +#environment-header h2:hover::after { + content: " (hide details)"; + color: #bbb; + font-style: italic; + cursor: pointer; + font-size: 12px; +} + +#environment-header.collapsed h2:hover::after { + content: " (show details)"; + color: #bbb; + font-style: italic; + cursor: pointer; + font-size: 12px; +} + +/*------------------ + * 3. Sorting items + *------------------*/ +.sortable { + cursor: pointer; +} +.sortable.desc:after { + content: " "; + position: relative; + left: 5px; + bottom: -12.5px; + border: 10px solid #4caf50; + border-bottom: 0; + border-left-color: transparent; + border-right-color: transparent; +} +.sortable.asc:after { + content: " "; + position: relative; + left: 5px; + bottom: 12.5px; + border: 10px solid #4caf50; + border-top: 0; + border-left-color: transparent; + border-right-color: transparent; +} + +.hidden, .summary__reload__button.hidden { + display: none; +} + +.summary__data { + flex: 0 0 550px; +} +.summary__reload { + flex: 1 1; + display: flex; + justify-content: center; +} +.summary__reload__button { + flex: 0 0 300px; + display: flex; + color: white; + font-weight: bold; + background-color: #4caf50; + text-align: center; + justify-content: center; + align-items: center; + border-radius: 3px; + cursor: pointer; +} +.summary__reload__button:hover { + background-color: #46a049; +} +.summary__spacer { + flex: 0 0 550px; +} + +.controls { + display: flex; + justify-content: space-between; +} + +.filters, +.collapse { + display: flex; + align-items: center; +} +.filters button, +.collapse button { + color: #999; + border: none; + background: none; + cursor: pointer; + text-decoration: underline; +} +.filters button:hover, +.collapse button:hover { + color: #ccc; +} + +.filter__label { + margin-right: 10px; +} diff --git a/conf/__init__.py b/conf/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/conf/config.ini b/conf/config.ini new file mode 100644 index 0000000..a860e08 --- /dev/null +++ b/conf/config.ini @@ -0,0 +1,14 @@ +[API] +base_url = https://reqres.in/api/ + +[API1] +base_url = https://api.restful-api.dev/ + +[API2] +base_url = https://anapioficeandfire.com/api/ + +[API3] +base_url = https://catfact.ninja/#/ + +[API4] +base_url = https://api.nationalize.io/ \ No newline at end of file diff --git a/conf/config.py b/conf/config.py new file mode 100644 index 0000000..3376116 --- /dev/null +++ b/conf/config.py @@ -0,0 +1,16 @@ +import configparser + +def get_config(): + """ + Load and parse the configuration settings from the 'conf/config.ini' file. + This function reads the 'conf/config.ini' file using the ConfigParser module + and returns a ConfigParser object containing the configuration data. + The configuration file should be in standard INI format. + :return: A ConfigParser object with the loaded configuration settings. + + """ + + config = configparser.ConfigParser() + config.read('conf/config.ini') + + return config diff --git a/conf/conftest.py b/conf/conftest.py new file mode 100644 index 0000000..ebc4b88 --- /dev/null +++ b/conf/conftest.py @@ -0,0 +1,38 @@ +import pytest +from API_Requests.Lib.Rest_Client import RestClient +from conf.config import get_config +from conf.logger import logGen + +logger = logGen() + + +def pytest_addoption(parser): + parser.addoption("--log_file", action="store", default="Logs/pytest.log", help="Specify the log file path.") + parser.addoption("--config_file", action="store", default="config.ini", help="Specify the configuration file path.") + + +@pytest.fixture +def log_file(request): + return request.config.getoption("--log_file") + + +@pytest.fixture +def config_file(request): + return request.config.getoption("--config_file") + + +@pytest.fixture(scope='class', autouse=True) +def setup_teardown(request): + print("==================================================================") + logger.info("Starting test setup process...") + # Simulating the generation of a bearer token (you can replace this with actual logic) + logger.info("Generating authentication token...") + request.cls.restclient = RestClient(get_config()['API']['base_url']) + logger.info("Authentication token generated successfully.") + logger.info("Test setup completed. Ready to execute tests.") + yield + logger.info("Starting test cleanup process...") + # Simulating the cleanup of the bearer token (you can replace this with actual logic) + logger.info("Cleaning up authentication token...") + logger.info("Authentication token cleaned up successfully.") + logger.info("Test cleanup completed. Resources released.") diff --git a/conf/logger.py b/conf/logger.py new file mode 100644 index 0000000..4853753 --- /dev/null +++ b/conf/logger.py @@ -0,0 +1,22 @@ +import logging +import os +import time + + +def logGen(): + logging.basicConfig(filename=f'API_Requests/Logs/log_{time.strftime('%Y%m%d_%H%M%S')}.log',format='%(asctime)s %(levelname)s %(message)s', + datefmt='%m %d %Y %H %M %S', filemode='w') + + log_directory = "Logs" + if not os.path.exists(log_directory): + os.makedirs(log_directory) + + # Configure the logging + logger = logging.getLogger(__name__) + logger.setLevel(logging.INFO) + + file_handler = logging.FileHandler(f"Logs/log_{time.strftime('%Y%m%d_%H%M%S')}.log", mode="w") + file_handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %(message)s")) + logger.addHandler(file_handler) + + return logger \ No newline at end of file diff --git a/conf/pytest.ini b/conf/pytest.ini new file mode 100644 index 0000000..51adbb9 --- /dev/null +++ b/conf/pytest.ini @@ -0,0 +1,11 @@ +[pytest] +markers = +sanity +smoke + +# to filter warnings +filterWarnings = -p no:warnings + + +# +addopts = --alluredir=C:/Users/Kunal.Sontakke/PycharmProjects/JazzX/Reports/Allure_Reports/allure_report \ No newline at end of file