0

I'm using backstopjs for visual testing while developing my project, After adding new pages to the project I always have to generate reference image right from the first page till the last one.

I don't want this generation of reference images from the startup. I only want to generate reference of the new page that is being added to the configs.

This is the script :

{
"viewports": [
    {
        "name": "desktop",
        "width": 1600,
        "height": 900
    }
],
"grabConfigs": [
    {
        "testName": "testName-1",
        "url": "http://localhost/project/index.html",
        "hideSelectors": [],
        "removeSelectors": [],
        "selectors": [
            "body"
        ]
    },
    {
        "testName": "testName-2",
        "url": "http://localhost/project/about.html",
        "hideSelectors": [],
        "removeSelectors": [],
        "selectors": [
            "body"
        ]
    },
    {
        "testName": "testName-3",
        "url": "http://localhost/project/contact.html",
        "hideSelectors": [],
        "removeSelectors": [],
        "selectors": [
            "body"
        ]
    }
]
}

Now, I only want to generate reference of the ../contact.html.

But after generating reference of the contact.html page it should not delete the previous referrals of about.html and index.html page.

And after running the "gulp test" it should check all the the page referrals of old and newly generated referral images.

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

BackstopJS doesn't support this currently -- however there is a straightforward workaround. It is a little crude but still simple and effective. Here goes...

  1. Locate your reference files directory and copy it to a temporary location.

  2. Update your config file appending any new tests or selectors to the end of their respective branch arrays.

  3. Run gulp reference -- this generates all new references.

  4. Move the contents of the temp directory (created in step 1) back into their original location (overwriting any existing files).

Hope that helps.

garris
  • 11
  • 3
  • Thanks for ur reply. Is there any progress on this factor, bcoz what u suggested was a kind of manual process, however our ned was to handle this thing through ur automated process only. Would be great to hear progress on this – Kamlesh Gupta Jan 08 '16 at 10:35
  • Is there has been any progress in your project on this question – Kamlesh Gupta Feb 11 '16 at 06:59