Closed
Conversation
the project often requires the script to be saved to the collection.
made all locator search in request build section as parent added test script locators added test script writing feature seperate getrequestResult from apiwrap combined getreResult with send button added fill header for request
includes: set auth variables to request login token request set token to env var user login
dependent models needed restructuring
Dancode-188#32 (Dancode-188#36) Added comprehensive URL validation to prevent TypeError when users type partial or invalid URLs in the request input field. ## Changes ### Core Fix - Added URL validation helper functions in src/lib/url-validator.ts - Updated RequestBuilder to safely handle invalid URLs in tab name generation - Prevents crash when typing partial URLs like "h", "ht", "https:", etc. ### User Experience Improvements - Added visual feedback: red border when URL is invalid - Added inline error message: "Please enter a valid HTTP(S) URL" - Smart validation: allows template variables like {{baseUrl}} for environment variables - Non-blocking: users can still attempt to send requests with variables ### Testing - Added comprehensive test suite with 30+ test cases - Tests cover: valid/invalid URLs, template variables, edge cases, partial URLs - All tests verify the fix handles the crash scenario ## Technical Details The crash occurred in a useEffect hook that tried to construct a URL object without validation. The URL constructor throws TypeError for invalid input, causing the app to crash on every keystroke as users typed. The fix uses a three-pronged approach: 1. Validate URLs before constructing URL objects 2. Allow template variables for environment variable substitution 3. Gracefully fallback to displaying raw URL string for invalid URLs Fixes Dancode-188#32
fix: prevent crash when entering invalid URLs in request builder, fix…
WHY: - test sometime fail in CI - so throttling cpu will help - configured throttling only for local
to avoid flaky test and occurance of multiple instance need to wait till one of the button instance is closed.
with selecting locators with same name in different section using these could come handy
optional parameter collection and request name helpfull to select already present request mimics user behaviour better
to select the environemnt the button is in the top header section created a locator to be used as parent
inlcuded auth helper, variables, script
added 28 new test taergeting request builder section rearranged tests into targeting function, components and user workflows added new functionality of adding headers and variables for testing identified Dancode-188#38 Dancode-188#39 bug
Closed
Owner
|
Hey @biocodeit, I'm closing this in favor of #41. You basically took everything from here and refactored it to be cleaner - the base fixture, the centralized fixture imports, moving the throttle logic out of BasePage. All good improvements. The request builder tests you wrote here (all 28 of them) are solid and they carried over to #41, just more efficiently organized. And finding bugs #38 and #39 while writing these tests is exactly what comprehensive e2e testing should do. The work you did here wasn't wasted - it was the foundation for #41. Sometimes the best way to clean architecture is to build it first, then refactor with that knowledge. That's what you did. Closing this as superseded by #41. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a comprehensive request builder test
Added test involve headers , variables, auth helper