Add wait-for, cookies, and wait-timeout for authenticated dashboards (v2.2.0) - #10
Merged
Merged
Conversation
Wait for a CSS selector after network idle, then apply the existing extra -t delay. Load session cookies from a JSON, Playwright storageState, or Netscape file before navigation. All options are CLI/batch flags only. Co-authored-by: Helvio Pedreschi <Helvio88@users.noreply.github.com>
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.
Summary
Makes
web-screenshotusable on login-gated / slow SPA dashboards generically, using CLI flags and batch-file lines only. No environment variables.Wait for a selector
-s/--wait-for <selector>calls Puppeteerpage.waitForSelectorafternetworkidle2--wait-timeout [s](default 30, clamped 1–600) is that wait-textra wait still runs after the selector (or after idle if no selector)Cookie / session auth
--cookies <file>loads cookies before navigationstorageStateJSON, or a Netscape cookie fileurlanddomainuse the screenshot URL-a/--auth user:passstill does HTTP basic/NTLM viapage.authenticateBatch
New flags work on batch lines the same way as other options (quote-aware parser).
Docs / version
https://example.com/ dashboard language onlyWEB_SCREENSHOT_*or other env fallbacksTest plan
npm test(no live network; mocked browser)--wait-for,--wait-timeout,--cookies, quoted selectorsdist/rebuild match CI