fix: move hardcoded config to env vars and replace timeouts with waitForSelector [ GSSOC'26 ]#520
Conversation
|
Warning Review limit reached
More reviews will be available in 53 minutes and 50 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@UTKARSHH20 Please review this PR |
1 similar comment
|
@UTKARSHH20 Please review this PR |
|
@UTKARSHH20 Please review this PR |
Fixes #519
##Problem
capture.js hardcodes the dev server URL, login credentials, and screenshot output path. setTimeout is used to wait for the sidebar and chat to load, which is fragile on slow machines.
##Changes:
URL, email, password, and output path now read from .env via dotenv with fallbacks
Replaced both setTimeout waits with waitForSelector so the script reacts to actual DOM readiness
Wrapped browser.close() in a finally block so the browser always closes even if the script throws
Auto-creates the output directory if it doesn't exist
Throws a clear error if login appears to fail (sidebar never appears after submit)