Is there anyone who have already implemented the famous "Page Object Pattern" with casperjs, it's very useful for test maintenability in the long term ?
It's very very cool to use that when you have to separe the mechanics and the purpose of your tests. it become more pleasurable to write your tests this way.
There are some examples with ruby and selenium:
http://blog.josephwilk.net/cucumber/page-object-pattern.html
https://code.google.com/p/selenium/wiki/PageObjects
Using the example in your second link, you can convert this to a Javascript class-like object and encapsulate in its own module:
and then use it in your test:
Here is an exemple of Page object pattern with CasperJS to test a login feature. The page object is in a file called LoginPage.js :
Then you can use this Page Object on several tests. For example :
For more details and a complete example : http://jsebfranck.blogspot.fr/2014/03/page-object-pattern-with-casperjs.html