facebookarchive/huxley

Using Huxley on Pages with dynamic content

nikglavin opened this issue · 4 comments

More of a question here, can't seem to find much info around or a forum for discussion so thought i'd ask it here.

Is there suggestions on how to setup huxley to run thorough CI on pages that are not static ? I have an issue where the test servers do not necessarily have the same database setup as the development environment, so there are regularly widgets that will not be in sync showing different data.

Would like to hear of ways people have been getting around this issue

@nikglavin Extract common UI patterns out into isolated/reproducible examples, and test those. Testing whole pages is always going to have a higher rate of false positives and it too broad of an approach IMO.

I understand the idea of testing ui components, however do you test against "live" (component) templates, or are you just testing against a static template that has been mocked specifically for the test ?

This is how I had initially began to test but found that this is not ideal as it doesn't account for changes to the templates. Rather only test against changes to the css against the idilic structure of the component. Although still helpful this doesn't take into account changes to the structure of the "live" template.

For me to test against "live" components I would have to create some rather large clunky objects to provide a static set of data for each test.

I am interested to know how yourself or others get around or approach this problem ?

My $0.02;

I understand the idea of testing ui components, however do you test against "live" (component) templates, or are you just testing against a static template that has been mocked specifically for the test ?

This is how I had initially began to test but found that this is not ideal as it doesn't account for changes to the templates. Rather only test against changes to the css against the idilic structure of the component. Although still helpful this doesn't take into account changes to the structure of the "live" template.

Yep, we use the exact same partials/presenters/templates as the ones in the app.

I work at a Ruby shop, and we’ve had a lot of success with tools like https://github.com/kneath/kss running within the app, and with rendering the component example using the exact Rails partial/presenter/whatever, exactly like we would in the app.

For me to test against "live" components I would have to create some rather large clunky objects to provide a static set of data for each test.

If you were writing unit tests you would always do this, testing the UI is no different really.

I should also add though that we are not actually using Huxley for this at the moment, we’re using a homebaked setup that uses a bunch of the tools that are already in our testing toolchain; RSpec, Capybara, Selenium and Browserstack.