question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

limiting viewports on a per scenario basis in config file

See original GitHub issue

When creating backstop tests with many scenarios and multiple viewports, the number of reference images gets quite big. In certain cases not all scenarios need to be tested with all viewport sizes. It is often sufficient to only test certain components with a subset of all defined viewports (since they are not responsive and do not change in between the viewports). For other examples which all viewports can be tested.

Would it be possible to add an option field (e.g. limitViewports) to the backstop.json file allowing to limit the viewports on a per scenario basis?

"viewports": [
  {
    "name": "x-small",
    "width": 380,
    "height": 600
  }, {
    "name": "small",
    "width": 640,
    "height": 800
  }, {
    "name": "medium",
    "width": 1300,
    "height": 1200
  }, {
    "name": "large",
    "width": 1900,
    "height": 2000
  }
]

...

"scenarios": [
{
  "label": "Icons",
  "url": "http://localhost:5001/docs/backstopjs/icons",
  "selectors": [
    ".icon-example"
  ],
  "readyEvent": "backstop_ready",
  "misMatchThreshold" : 0.1,
  „limitViewports": ["small“]
}

This would allow for a more fine-grained control of which backstop reference images are created per scenario. What do you think?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
garriscommented, Nov 29, 2018

@DaPo BackstopJS allows you to specify viewports at the scenario level. See the docs… https://github.com/garris/BackstopJS#working-with-your-config-file

0reactions
CyrilKrylatovcommented, Nov 30, 2018

@garris wow, thank you for your answer. Sorry, I didn’t catch this. That’s perfect for me. Thank you again.

And thank you for this awesome testing tool. You made it very easy to use. ✌️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration | Playwright - CukeTest
Playwright Test provides options to configure the default browser, context and page fixtures. For example there are options for headless, viewport and ...
Read more >
Viewport meta tag - HTML: HyperText Markup Language | MDN
This article describes how to use the "viewport" tag to control the viewport's size and shape.
Read more >
Playwright config | Katarzyna Kmiotek
projects. General config. Test Config properties in this section: timeout - max time limit for each test (for me it serves the purpose ......
Read more >
Preferences - MODO 801 Inline Help System - Foundry
Users may modify these settings independently for each scene in the Scene item ... Rotation order can also be adjusted on a per...
Read more >
limits.conf - Splunk Documentation
Each .conf file should have at most one default stanza. ... You can override this setting on a per-search basis by appending '|noop ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found