-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capybara fuzzy matching #22
Comments
does Checking the rspec tests that looks like the syntax you are looking for - let me know! |
Just tried it and unfortunately its still failing with a very minor differences between the two screen shots. Any other ideas. |
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) |
I usually use 4% on RubyMotion iOS. |
...so i was totally wrong on the percent, I was going to tag you @jamonholmgren for clarity :) |
I watch this repo, so I saw it. :) |
I'll dig around. Or maybe @thegreatape can answer quicker! :) |
@squidpunch Thanks! |
@zberkom pretty sure fuzz_factor isnt setup in rails 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 :) |
@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. |
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. |
@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! |
@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 :) |
@zberkom releasing momentarily! |
@squidpunch Great, thanks! |
There are examples of how to do fuzzy matching in Bacon and Frank, but I can't figure out how to do it for a rails app using capybara.
I tried
expect(page).to look_like("Profile", 15)
with no success. Any help would be much appreciatedThanks!
The text was updated successfully, but these errors were encountered: