Comments (7)
Hi @toolmantim, thanks for reporting this and percy/percy-agent#30
I'm gonna pull down the Buildkite site and see about what we can do to resolve these issues later today.
from percy-puppeteer.
Thanks David! FYI I think I’m going to rejig the Docker/integration test setup, as some things don’t fit together nicely anymore. This was just the simplest thing to try to get it work.
from percy-puppeteer.
I have been able to get successful Percy builds going over the Buildkite site by running the following:
docker-compose build
export PERCY_TOKEN=xxx
docker-compose -f docker-compose.integration-tests.yml run integration-tests
There's a bunch of errors that output along the way. The biggest issue I've found so far are these lines:
https://github.com/buildkite/site/blob/master/integration-tests/index.test.js#L37-L39
I can understand why you might want to assert that no output shows up on console.log
but just FYI that's one place things are breaking.
I changed those lines to:
page.on('console', (msg) => {
console.log(msg)
})
to simply get some visibility on the console and not assert a fail. I'm seeing console errors around fonts:
Failed to decode downloaded font: http://site:3000/_next/static/assets/assets/fonts/lineto-circular-book-d41d8cd9.woff2'
It looks like that might be resolved with some private pieces in your codebase.
Interestingly I'm not seeing CSP errors.
from percy-puppeteer.
Thanks for digging in, and all the awesome info! I’ll give it another shot today and keep you posted.
from percy-puppeteer.
I've pushed a few changes to the branch, which you can run locally against the live https://buildkite.com/
yarn install
env PERCY_TOKEN=xyz yarn run integration:production
It creates a Percy build, but no snapshots are uploaded. The output looks like this:
yarn run v1.12.3
$ env PRODUCTION_HEADERS=true TEST_HOST=https://buildkite.com/ yarn run integration
$ percy exec -- mocha --recursive --no-timeouts integration-tests/*
[percy] created build #35: https://percy.io/buildkite-1/site/builds/1214053
[percy] percy has started.
Started HeadlessChrome/72.0.3617.0
Home
✓ renders the tagline
✓ has a link to about
✓ has the security headers
✓ renders the same page with and without Javascript (1433ms)
Logged in cookie behaviours
without the logged in cookie
✓ has a link to signup (1056ms)
with the logged in cookie
✓ has a link to dashboard (1064ms)
About
warning: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
error: Refused to connect to 'http://localhost:5338/percy/healthcheck' because it violates the following Content Security Policy directive: "connect-src 'self' https://www.google-analytics.com".
warning: percy agent not started.
🤔
from percy-puppeteer.
I went down the rabbit hole of implementing Puppeteer’s request interception API (https://github.com/buildkite/site/commit/f4ecdf8bd23b673016f3806f5fa2a3d8568cc6dc) to rewrite the CORS header responses. But it appears that enabling request interception causes the browser, or Percy agent, to hang for some reason (minimal change to see the problem here https://github.com/buildkite/site/commit/246f98bf542de4b001188801fa1ed55e4cafebb8)
Removing all request interception (https://github.com/buildkite/site/commit/be2ecc38b0f3281c5475ec537ff46d619849531f) and the CORS headers lets everything work again (https://percy.io/buildkite-1/site/builds/1220254)
About
| warning: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
| [percy] snapshot taken: 'About'
| ✓ responds ok (1317ms)
I think my next step might be to try to implement a proxy server, to avoid Puppeteer’s request interception. And figure out what's going on with the styles in the snapshots.
from percy-puppeteer.
Closing this issue now because Percy agent communication now effectively works around CSP issues with #36
Be sure to use @percy/puppeteer 1.0.1 or higher
from percy-puppeteer.
Related Issues (17)
- CSS viewport units are not correct on chrome headless HOT 3
- Capturing a single frame inside a page HOT 2
- percySnapshot sometimes captures part of the page and sometimes full page HOT 6
- Local fonts not loaded on percy rendering environment HOT 6
- More helpful error logging during script injection HOT 3
- PNG images are not displayed HOT 1
- `render.percy.local` error HOT 4
- Error: Caught error after test environment was torn down HOT 1
- During snapshot page is reloaded causing test fail HOT 6
- Support for Jest / use of ES modules dynamic import in SDK HOT 1
- `ReferenceError: window is not defined` with Jest 28 and jest-puppeteer HOT 6
- `@percy/core` development dependency issue HOT 3
- executing percySnapshot on multiple pages HOT 4
- Snapshot requires that the page URL must be HTTP or HTTPS HOT 1
- Improve error message when large DOM is sent HOT 6
- Capturing a selector instead of a page? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from percy-puppeteer.