CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • testing frameworks: CasperJS vs behat vs Selenium
Pages: [1]

Author Topic: testing frameworks: CasperJS vs behat vs Selenium  (Read 3106 times)

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
testing frameworks: CasperJS vs behat vs Selenium
March 17, 2014, 06:02:43 am
We've been writing functional tests for core and some of our custom work and extensions in Selenium. It's a fairly tedious coding approach, and prone to needing rewrites for small changes in UI. I understand there are also issue with phantom fails of the tests and a need to insert lots of pauses to allow page elements to load, which leads to the test suites taking a very long time to run.

I have had discussions with a few people about using behat as a more user friendly way of writing acceptance tests and functional tests.

The following post from Lullabot has some interesting points about the successful use of CasperJS in this area: https://www.lullabot.com/blog/article/testing-front-end-casperjs?utm_source=Lullabot+Announcements&utm_medium=email&utm_campaign=e82b2ddac2-Lullabot+Weekly+RSS&mc_eid=3a5ec93314&utm_term=0_7a64ff23fe-e82b2ddac2-52099882&mc_cid=e82b2ddac2
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: testing frameworks: CasperJS vs behat vs Selenium
March 17, 2014, 07:13:02 am
It's been years since our webtest suite completed at 100%. I'm not sure if selenium is completely to blame, but I would welcome any change that got our tests all working again.
Of course, ditching selenium means rewriting all the tests, so it wouldn't really be an apples-to-apples comparison. Probably keeping selenium and rewriting all the tests would fix it too ;)
Try asking your question on the new CiviCRM help site.

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: testing frameworks: CasperJS vs behat vs Selenium
March 17, 2014, 08:03:25 am
The post suggests that in addition to faster completion that writing new tests would be faster. And that CasperJS works well with AngularJS. I'm not sure where we are with possibly moving towards an MVC framework in the browser (I think it is coming along), but we're definitely doing lots of JQuery stuff. Not sure if there would be benefits of CasperJS over Selenium in terms of DX (developer experience) but it sounds like there would be.

Like any sort of change in infrastructure, I think we should dip our toes in, learn about it, then make plans to migrate, perhaps over a version or two. For example, if we decided on a new test infrastructure then we could say that it was required for all new tests, and perhaps as old tests needed to be refactored we would rewrite into new technology.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • testing frameworks: CasperJS vs behat vs Selenium

This forum was archived on 2017-11-26.