Skip to content

Enabling javascript causes images to double in height #51

Closed
@rsimha

Description

We're using percy/capybara to generate snapshots in our visual tests for the AMP project. We recently switched from PhantomJS to Chrome / Selenium. Today, I noticed that our snapshots were missing certain portions due to the fact that JavaScript wasn't enabled on the Percy side. (The content showed up on my local machine when the page was first rendered prior to snapshotting, but was missing in the final snapshots because Percy doesn't enable JavaScript by default.)

When I repeated the snapshots with JavaScript enabled (using Percy::Capybara.snapshot(page, name: name, enable_javascript: true)), I noticed that the mere act of enabling JavaScript is causing all our image assets to double in height in the snapshots. (They appear normal when rendered locally, prior to snapshotting.) This is mysterious behavior and I'm not sure what we can do to prevent this. See the snapshots in https://percy.io/ampproject/amphtml/builds/538714 for example. The baselines do not have JavaScript enabled, while the new snapshots do.

FYI, here is how we are setting up Capybara to use Chrome instead of PhantomJS.

Left: with JS, Right: without JS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions