Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Using Huxley on Pages with dynamic content #55

Open
nikglavin opened this issue Mar 25, 2014 · 4 comments
Open

Using Huxley on Pages with dynamic content #55

nikglavin opened this issue Mar 25, 2014 · 4 comments

Comments

@nikglavin
Copy link

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

@plasticine
Copy link

@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.

@nikglavin
Copy link
Author

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 ?

@plasticine
Copy link

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.

@plasticine
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants