Skip to content
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

Snapshot requires that the page URL must be HTTP or HTTPS #63

Closed
angellindo opened this issue Mar 18, 2019 · 1 comment
Closed

Snapshot requires that the page URL must be HTTP or HTTPS #63

angellindo opened this issue Mar 18, 2019 · 1 comment

Comments

@angellindo
Copy link

angellindo commented Mar 18, 2019

Hi im having an issue were percy service, it throws an error if I try to snapshot a URL that is a file I opened from the system.

The currently flow is:

  1. user client sends an HTML to the backend
  2. backend parses the HTML and get what ever data it needs
  3. generates a new HTML
  4. puppeteer sends back a PDF

I had to do a work around this simple scenario and create a ExpressJS server to provide that generated HTML as http://localhost/...

My code looks like

  const filePath = resolve(fileName);

  await page.goto(`file://${filePath}`, {
    waitUntil: "networkidle0"
  });

but when I run my tests/snapshot on that code I get
Screen Shot 2019-03-18 at 2 25 04 PM

Is there a way to handle this?

@fotinakis
Copy link
Contributor

Hey @angellindo — thanks for the report. file:// paths are not supported as a security measure in percy's backend, but could potentially be supported in percy-agent's capturing at some point.

The workaround you found using an express server for this is good and will create better automatic snapshot names anyway, so that's what we would suggest you do here. Going to close this as wontfix since there is a good workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants