Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automated Testing & CSS

Automated Testing & CSS

Test-Driven Development has grown in popularity among the community in the past few years, but we're still lacking the proper tools to provide automation behind our CSS. How do you know a change you made to one small section on a page doesn't break a large section on another page of your site, especially when you support hundreds of devices? These slides look at three options available and show where they succeed and fail.

Kevin Lamping

October 21, 2013
Tweet

More Decks by Kevin Lamping

Other Decks in Technology

Transcript

  1. “Despite CSS being so hard to maintain, it's often the

    part of the FE stack people are least interested in protecting from tech debt.” @necolas
  2. +

  3. Wraith - Recap •Easy, simple set up •Nice site to

    view diffs •Entire screen comparison is bad for dynamic sites •No IE Testing •Need two sites with same content
  4. Selector Maps selectors.js module.exports = { "standard paragraph": "section >

    p" }; test.feature Then "standard paragraph" should have "color" of "rgb(68, 68, 68)"
  5. selectors.js module.exports = { "standard paragraph": "section > p" };

    test.feature Then "standard paragraph" should have "color" of "rgb(68, 68, 68)" Selector Maps
  6. Hardy - Recap •Cross-browser coverage •Computed styles & specific shots

    •Site scripting built-in •No nice diff page •More work to set up •Have to repeat CSS •Pay attention to ' and "
  7. /* # Buttons Provides extra visual weight and identifies the

    primary action in a set of buttons. ``` <button class="btn primary">Primary</ button> <button class="btn primary :hover">Primary</button> ``` */
  8. StyleDocco - Recap •No login/scripting needed •Allows for pseudo-class testing

    •Content is (mostly) static •Not the actual site