ShaftHQ / SHAFT_ENGINE

SHAFT is a unified test automation engine for web, mobile, API, CLI, database, and desktop e2e testing. Powered by best-in-class frameworks, SHAFT provides a wizard-like syntax to drive your automation efficiently, maximize your ROI, and minimize your learning curve with no limitations! Stop reinventing the wheel! Upgrade now!
https://shafthq.github.io/
MIT License
324 stars 123 forks source link

Fix: Ensure query parameters are added to requests with a body #1633

Closed KyrillosNageh closed 3 months ago

KyrillosNageh commented 3 months ago

Description: This pull request fixes a bug where query parameters were not being added to requests that also have a body. It improves the performRequest method to ensure query parameters are correctly appended to the URL, along with enhancing error handling and modularizing the code.

Files Modified: src/main/java/com/shaft/api/RequestBuilder.java

Solution: Dynamic URL Construction: Added functionality to append query parameters to the request URL, ensuring they are not lost when a body is present. Comprehensive Error Management: Improved exception handling to manage errors during the request process effectively. Modular Helper Methods: Created helper methods to append query parameters, check supported request types, and handle exceptions.

Linked Issue: Fixes https://github.com/ShaftHQ/SHAFT_ENGINE/issues/1615