4

I have a rather extensive CasperJS acceptance test suite.

Up until now, we didn't care for cross browser/OS/mobile support, so CasperJS/PhantomJS made perfect sense, and it has worked beautifully.

But now, we do care, to the point I will need to cover 5 most popular browsers and their respective OS and even mobile devices (browserstack is my saviour).

So I'm considering 2 options:

a) Find a way to somehow modify/run existing CasperJS test suite to run on different browsers instead of just Phantomjs (have googled for hours, doesn't seem to be a viable option).

b) Rewrite the test suite (write new one) in Selenium Webdriver and junk CasperJS test suite if so desired (since Webdriver can now drive PhantomJS I could smoketest there without using the CasperJS test suite).

Question is: is option "b)" the correct option? I believe it is, but want to be sure before finding out I "reinvented the wheel" for free.

silvakle
  • 115
  • 10
  • you might be able to use slimerjs to test cross-browser. I've never tried it, but I've heard it works. http://stackoverflow.com/questions/22646458/running-casperjs-tests-with-slimerjs – aholt Jun 11 '15 at 20:36
  • Thanks aholt! worth looking into (Can't signal your reply as the correct one just yet, need to check it out first). That is the kinda help I need precisely (don't know a whole lot about either casperjs or webdriver) – silvakle Jun 11 '15 at 20:39
  • No. You won't be able to do all of that with CasperJS. You will need to go with option b – Artjom B. Jun 11 '15 at 21:12
  • Artjom: after reading up on slimjs, I'm afraid you're right. Now I'll post (elsewhere) about "instability" I've noticed in browserstack (my first selenium specific test, which passes on phantomjs, sometimes it passes on browserstack and sometimes it doesn't due to stale element, cannot find object, etc). – silvakle Jun 11 '15 at 22:18
  • That's too bad. It's always a problem to decide to use one technology only to find that the scope has shifted and the decided upon technology doesn't do what you wanted it to do. That's why you always need to know the limits of a technology before you pump a large amount of your time into it. Your question has led me to think about whether it is possible to write a piece of code that implements the PhantomJS API, but actually is a selenium webdriver proxy so that any available webdrive could be used. I think such a thing would take years to code and would probably not even feature complete. – Artjom B. Jun 11 '15 at 23:31

0 Answers0