-1

I am trying to understand the technical difference between the multiple tools available for testing JavaScript web applications.

  • You have CodeceptJS which is just a wrapper, which needs a framework like NightmareJS/Selenium.
  • Now is nightmare a framework? If yes, what is ElectronJS? And how does it differ from PhantomJS?
  • Which one is just a headless browser? Both Electron and PhantomJS?
  • And where do Jasmine/Mocha fit in? Are Jasmine/Mocha comparable to CodeceptJS?

I am lost about exact technical terminology to use for each of these and what exactly is each one of them and where do they fit in?

StaceyGirl
  • 6,826
  • 12
  • 33
  • 59
Kumar Manish
  • 985
  • 1
  • 9
  • 25

1 Answers1

0

It's a big chump of non constructive question which is normal. I've edited it and separated the questions to have a better understanding.

1. You have codeceptjs which is just a wrapper, which needs a framework like nightmarejs/selenium.

This is not a question but a statement which says he studied about it. Nothing much on it.

2. Now is nightmare a framework?

Nightmare is not a framework. The sub-title on the repo says it's a high-level browser automation library. The goal is to expose a few simple methods that mimic user actions (like goto, type and click), with an API. It was originally designed for automating tasks across sites that don't have APIs, but is most often used for UI testing and crawling.

Really short version of the differences between Library and Framework would be that, a library is where you are in control, you pick and use what you want, and a framework is where the framework is in control, everything is already picked by them and you will just add some data on top of them. More on the differences on this answer.

3. What is electronjs?

Electron is a framework that uses node and chromium under it's hood. It lets you write cross-platform desktop applications using JavaScript, HTML and CSS. It is based on Node.js and Chromium and is used by the Atom editor and many other apps.

4. How does electronjs differ from phantomjs? Which one is a headless browser?

PhantomJS is a headless browser scriptable with a JavaScript API. It's more comparable to chromium than electron. Electron is a framework that uses another headless browser called chromium while phantomjs itself is a headless browser.

5. Where do jasmine/mocha fit in? Are jasmine/mocha comparable to codeceptjs?

Jasemin/Mocha/Ava/Jest etc. are unit testing frameworks. Together with Nightmare/PhantomJS, you can create scripts which would test various ui/ux interactions for you.

Codeceptjs is a testing framework for end-to-end testing with webdriver (or others).

To understand the differences between unit and integration/end-to-end testing, check this answer.

I hope that clears up many doubts.

Md. Abu Taher
  • 13,012
  • 3
  • 35
  • 59