GithubHelp home page GithubHelp logo

Comments (14)

tdrhq avatar tdrhq commented on May 4, 2024

if you do a "gradle recordMode screenshotTests", it should generate the full pngs and "record" it to a directory.

from screenshot-tests-for-android.

bootstraponline avatar bootstraponline commented on May 4, 2024

Unfortunately that doesn't help. My use case is running on Google's Cloud Test Lab which lacks Gradle support.

Is there no Java API to take a full png screenshot (and delete the tiles/xml files)?

from screenshot-tests-for-android.

bootstraponline avatar bootstraponline commented on May 4, 2024

FYI the way cloud test lab currently works is it dumps everything from /sdcard/screenshots/ into a Screenshots view in the UI. The current screenshot-tests-for-android makes a mess because there are a bunch of intermediary files and no full screenshots.

I guess the short term work around is for me to go back to Spoon which creates exactly one png per screenshot call. Ideally the facebook lib would have an on device stitching solution that doesn't depend on 3rd parties (gradle/python). It's a simple use case: take a screenshot.

from screenshot-tests-for-android.

tdrhq avatar tdrhq commented on May 4, 2024

Hmm, the stitching can't be done on device without external libraries. The reason for the stitching is that we can't store the whole bitmap in memory. (We support really large views)

There were some other libraries that directly constructed the result image files onto the filesystem without having it all stored in memory, but I didn't want an external dependency for that use case.

If you think your device/emulator has enough memory that such stitching isn't worthwhile, try increasing this to a larger number so that it can completely contain your screenshots: https://github.com/facebook/screenshot-tests-for-android/blob/master/core/src/main/java/com/facebook/testing/screenshot/internal/ScreenshotImpl.java#L56

from screenshot-tests-for-android.

tdrhq avatar tdrhq commented on May 4, 2024

we should also make that parameter configurable so you don't have to rebuild from source

from screenshot-tests-for-android.

bootstraponline avatar bootstraponline commented on May 4, 2024

There were some other libraries that directly constructed the result image files onto the filesystem without having it all stored in memory, but I didn't want an external dependency for that use case.

What libs are they? Might be better for my use case.

from screenshot-tests-for-android.

tdrhq avatar tdrhq commented on May 4, 2024

It's been a while since I've looked at that, I'm not able to find it/them at the moment. Do consider just increasing the tile size, that's really the easiest solution as long as you can give it enough heap.

from screenshot-tests-for-android.

bootstraponline avatar bootstraponline commented on May 4, 2024

Ok, even if I do that then there's still no option to prevent the xml files from being generated. I don't want random files in storage because I'm charged $$ for them.

from screenshot-tests-for-android.

tdrhq avatar tdrhq commented on May 4, 2024

Happy to accept a pull request to make the XML file configurable, but for now I'm renaming this task just to make the tile size configurable which I'll try to do soon

from screenshot-tests-for-android.

bootstraponline avatar bootstraponline commented on May 4, 2024

Happy to accept a pull request to make the XML file configurable

Something like this?

public interface RecordBuilder {
    public RecordBuilder disableDumpFile();

from screenshot-tests-for-android.

tdrhq avatar tdrhq commented on May 4, 2024

nope, pass it as an instrumentation argument. I wouldn't want to expose this every time somebody is doing code completion while trying to create a screenshot.

from screenshot-tests-for-android.

bootstraponline avatar bootstraponline commented on May 4, 2024

Makes sense. Should the tile size be configured the same way (instrumentation argument)?

from screenshot-tests-for-android.

tdrhq avatar tdrhq commented on May 4, 2024

That would be my plan, yes. Feel free to send a pull request for that too though

from screenshot-tests-for-android.

bootstraponline avatar bootstraponline commented on May 4, 2024

Submitted #23 for the no dump flag.

from screenshot-tests-for-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.