-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible improvement to core#capture
#98
Comments
Hello again @nathanshelly! I've moved this issue to the new repo since it relates directly to it. If you can provide authorization headers via the percy.capture({
name: 'Behind Login',
url: 'http://localhost:3000/protected',
headers: {
Authorization: 'XXXXXX'
}
}) However, this issue did bring to my attention that if any page navigation occurs inside of the I've addressed both of those issues in PR #99. If you can confirm that this would solve your issue, I'll go ahead and merge it. |
Whoops sorry just blindly created it in the same repo as the previous issue, thanks for moving! That resolution sounds perfect. Thank you so much for the continued incredible support! |
Following up here I was hopeful I would be able to install the latest, unreleased changes including this fix via something like this in my
Unfortunately this fails with an error message about a missing |
Sorry about the delay in releasing! I meant to do that asap, but wasn't near a computer when I merged the PR from mobile. Then my brain turned off work mode all weekend and I forgot. I'll have a release cut shortly! 👍 |
Released 1.0.0-beta.25 🎉 |
No worries whatsoever, thanks! |
Hi again!
I'm trying to use the Percy CLI to test snapshots with two extra requirements that the current
capture
API doesn't seem to account for. One of those cases is pages behind logins and the other is an in-house implementation of frontend deploy previews for PRs.The login case requires programmatically navigating to our company's login page and entering credentials before being redirected back to the page on which I actually want to take the screenshot. The deploy preview case requires navigating to a programmatically generated URL that sets a cookie on the client which then enables viewing the specific frontend assets associated with the corresponding PR.
At one point I was hoping to use the
execute
argument but if thatexecute
function navigates to a separate page I get the following error:[percy] Encountered an error for page: ... [percy] Error: Evaluation failed: ReferenceError: PercyDOM is not defined at __puppeteer_evaluation_script__:5:20
Looking at the code this makes sense since the SDK injects
@percy/dom
before theexecute
function runs so navigating away from the page loses that injection.Do you have a suggestion for handling this use case? If there is no straightforward answer would you all be open to a PR introducing a new argument something like
executeBeforePercySetup
to run any login/other setup logic before that injection?The text was updated successfully, but these errors were encountered: