Giter VIP home page Giter VIP logo

Comments (10)

ashfurrow avatar ashfurrow commented on June 30, 2024

Recording snapshots will fail the test, if you change that to haveValidSnapshot then it should work 👍

from nimble-snapshots.

kishykumar avatar kishykumar commented on June 30, 2024

Hi Ash,
I did try both. When I run recordSnapshot, I don't see any newly created image (.png file) of the view.
When I run haveValidSnapshot, that also fails (because there is no reference image).

On a separate note --
What's the default directory for the reference images?
From the README, I think it's ReferenceImages in Test directory. Does the ReferenceImages dir get created automatically, or we need to create it? Because I didn't see any directory getting created after I ran the recordSnapshot.
Even after I create it manually, I don't see any images in it after recordSnapshot.

from nimble-snapshots.

orta avatar orta commented on June 30, 2024

I think it's created automatically, did you try a git status to see if any new folders were created?

from nimble-snapshots.

kishykumar avatar kishykumar commented on June 30, 2024

I just ran git status and there aren't any newly created folders.

Do you know why recordSnapshot is not creating any images?
Any easy way to diagnose it?

from nimble-snapshots.

orta avatar orta commented on June 30, 2024

At that point, the problem could be with FBSnapshots - I'm afraid without any useful error messages from your logs - you're on your own, throw some breakpoints around

from nimble-snapshots.

kishykumar avatar kishykumar commented on June 30, 2024

Let me see if FBSnapshots work by itself in my project.
I will let you know. Thanks for the quick response. 👍

from nimble-snapshots.

kishykumar avatar kishykumar commented on June 30, 2024

So far, I have been running my tests on a real iPhone.
Then, I read on the FBSnapshotTestCase page:
Your unit test must be an "application test", not a "logic test." (That is, it must be run within the Simulator so that it has access to UIKit.)

Not sure what it means. But, when I ran a test with FBSnapshotTestcase on a simulator, it worked!
Then, I ran Nimble_Snapshots on a simulator and it worked too.

Can you please explain why it only works on a simulator? Is it expected to work when running tests on real hardware?

from nimble-snapshots.

orta avatar orta commented on June 30, 2024

Likely because FBSnapshots needs access to your source code to find the refernce images, it can't get the code if it's running on a different computer

from nimble-snapshots.

orta avatar orta commented on June 30, 2024

re: application vs logic tests - app tests are run inside your application, logic tests are tests that don't need to run inside an application

from nimble-snapshots.

orta avatar orta commented on June 30, 2024

closing due to inactivity

from nimble-snapshots.

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.