Giter Club home page Giter Club logo

Comments (1)

erosson avatar erosson commented on July 21, 2024

storybook seems like a winning approach for visualizing the ui states (including the hard part, i18n) we want to screenshot. not only can we browse ui states at our leisure, we get jest snapshot tests for free with storyshots! some pages may take some refactoring for this to work well, but that's very doable - no different than any other integration test, and way better than simulating clicks to setup the state we want to screenshot. I've used storybook before and have this part working.

frameit looks promising for fancypants screenshot postprocessing, though I haven't tried it yet. maybe later.

actually taking the screenshots automatically has been a bit harder:

  • screengrab was what I'd hoped to use, but it appears to require ejecting from expo. also, no good for ios (though that's not a showstopper, we can fake it by hiding system ui)
  • storycap refuses to connect to my @storybook/react-native-server, so it does nothing. debugging/troubleshooting has failed me, including the usual suspects of wipe/reinstall node_modules and local-network-ip instead of localhost.
  • takeSnapshotAsync looks promising, but it appears gone in the latest version of expo, and I'd have to do quite a bit of test setup to use it since it's much lower-level than screengrab/storycap

also, all of these require an emulator - inevitably making CI runs slow and flaky, or if we leave it out of ci for faster runs, dep upgrades will break it when we need it.

...I think this automation is starting to cost more than the task it's automating. it might be best to take screenshots manually. if storybook's managing ui state for us, manual screenshotting is still tedious but not painful, and we don't have to do it often - and if we do solve automated screenshotting, storybook's still good for state management.

from freecbt.

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.