Giter Site home page Giter Site logo

Comments (16)

squidpunch avatar squidpunch commented on September 3, 2024

does expect(page).to look_like("Profile", fuzz_factor: 15) work?

Checking the rspec tests that looks like the syntax you are looking for - let me know!

from motion-juxtapose.

zberkom avatar zberkom commented on September 3, 2024

Just tried it and unfortunately its still failing with a very minor differences between the two screen shots. Any other ideas.

from motion-juxtapose.

squidpunch avatar squidpunch commented on September 3, 2024

I'd try a higher percent. passing in 100 will make an image pass if they are the same size but completely different. so 15% differential may still be below the change threshold you are looking at. I remember discussing the fuzz factor at the #inspect conference, and I believe people were talking about using 85% or so for the fuzz factor, so that the clock on an iphone didnt fail - not sure if thats too much and then will loose the things you are going to test...but my gut says play with this number and see if it impacts your test. Go with 100, make sure that passes, then go down from there 👍

If you have a sample repo I could give it a look too, I've never used juxtapose with a rails app, so I am just throwing out ideas but I bet we can track it down. If i have time later this evening or tomorrow morning Ill throw together a quick app to see if i can reproduce this (assuming you dont have a public repo I can just clone)

from motion-juxtapose.

jamonholmgren avatar jamonholmgren commented on September 3, 2024

I usually use 4% on RubyMotion iOS.

from motion-juxtapose.

squidpunch avatar squidpunch commented on September 3, 2024

...so i was totally wrong on the percent, I was going to tag you @jamonholmgren for clarity :)

from motion-juxtapose.

jamonholmgren avatar jamonholmgren commented on September 3, 2024

I watch this repo, so I saw it. :)

from motion-juxtapose.

zberkom avatar zberkom commented on September 3, 2024

Looked through the source code and can't find a way around this:
image

Is fuzz_factor included for capybara specs?

from motion-juxtapose.

squidpunch avatar squidpunch commented on September 3, 2024

I'll dig around. Or maybe @thegreatape can answer quicker! :)

from motion-juxtapose.

zberkom avatar zberkom commented on September 3, 2024

@squidpunch Thanks!

from motion-juxtapose.

squidpunch avatar squidpunch commented on September 3, 2024

@zberkom pretty sure fuzz_factor isnt setup in rails
https://github.com/terriblelabs/motion-juxtapose/blob/master/lib/juxtapose/rspec.rb#L4-L5

want to throw together a PR for it? I can do it probably sometime after the weekend but I'd gladly review one if you want to work it out before then :)

from motion-juxtapose.

squidpunch avatar squidpunch commented on September 3, 2024

@zberkom pretty sure I have a working fix put together for you. I just want to have @thegreatape review the PR before we merge/release!

you could test this out locally if you wanted by updating your gemfile as the following....

gem "motion-juxtapose", github: "squidpunch/motion-juxtapose", branch: "working-with-rails-matcher"

it would be great to let me know if that fixes your problem - my quick sample app seemed to allow me to use the fuzz factor, but like I said before, I had never used this gem in rails previously.

from motion-juxtapose.

squidpunch avatar squidpunch commented on September 3, 2024

once its merged and released, you can go back to the rubygems released version - but it would be great to verify this is a working fix on your project as well, and I am not overlooking something.

from motion-juxtapose.

zberkom avatar zberkom commented on September 3, 2024

@squidpunch fuzz_factor seems to be working, but only if I put it at 80-90, otherwise it still throws errors for minor differences. Btw. thanks for looking into this for me!

from motion-juxtapose.

squidpunch avatar squidpunch commented on September 3, 2024

@zberkom I'll change up this PR to not include the require stuff, and get this merged. Thanks for reporting it - as far as the percentage you need to use....this is simply being passed down to imagemagick on how they handle the fuzz. I wouldnt expect it to be so high, but at least you have a way to get it working, and maybe there is a way to enhance fuzz a bit more in a future change if someone has time to dive a bit more into how imagemagick actually works :)

from motion-juxtapose.

squidpunch avatar squidpunch commented on September 3, 2024

@zberkom releasing momentarily!

from motion-juxtapose.

zberkom avatar zberkom commented on September 3, 2024

@squidpunch Great, thanks!

from motion-juxtapose.

Related Issues (18)

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.