garris / BackstopJS

Catch CSS curve balls.
http://backstopjs.org
MIT License
6.82k stars 607 forks source link

Check slider content using backstopjs #146

Open finis-intrinsic opened 8 years ago

finis-intrinsic commented 8 years ago

I have used bxslider and want to check the 2nd and 3rd child of the slider using backstopjs. I checked using the delay event in both the backstop.json and the bxslider script. it generates references for the child content of the slider. but fails to generate appropriate references of the items.

1) This is my html

<ul class="bxslider">
      <li><img src="http://grab.by/NplU" title="Funky roots" /></li>
      <li><img src="http://grab.by/Npm2" title="The long and winding road" /></li>
      <li><img src="http://grab.by/Npma" title="Happy trees" /></li>
    </ul>

2) bxslider initialize script

$('.bxslider').bxSlider({
        auto: true,
        autoDelay: 900
    });

3) this is my backstopjs script

{
  "viewports": [
    {
      "name": "desktop",
      "width": 1600,
      "height": 900
    }
  ],
  "scenarios": [
    {
      "label": "Bxslider",
      "url": "http://localhost/jquery-bxslider/",
      "hideSelectors": [],
      "removeSelectors": [],
      "selectors": [
        "section ul li:nth-of-type(1)",
        "section ul li:nth-of-type(2)",
        "section ul li:nth-of-type(3)"
      ],
      "readyEvent": null,
      "delay": 1000,
      "misMatchThreshold" : 0.1,
      "onReadyScript": "onReady.js"
    }
  ]
}
garris commented 8 years ago

Sorry, I'm not familiar with bxslider. Here is an article that looks at testing web apps with BackstopJS. Maybe it will help.

http://davidwalsh.name/visual-regression-testing-angular-applications

finis-intrinsic commented 8 years ago

Hi, @garris The above reference is not helpful up to the mark.

Is here anyone who has knowledge in loading an slider content on intervals so that the backstop may be able to capture screenshots at its particular time intervals with respective to its content

Thank you in advance

jasonhick commented 8 years ago

Hi, You'll need to use CasperJS to simulate actions in your browser. There are instructions on using this in the Backstop readme ;)