When comparing Nightwatch.js vs Leadfoot -> Intern, the Slant community recommends Leadfoot -> Intern for most people. In the question“What are the best Node.JS Selenium WebDriver client libraries / bindings?” Leadfoot -> Intern is ranked 2nd while Nightwatch.js is ranked 5th. The most important reason people chose Leadfoot -> Intern is:
The documentation starts by describing what Intern is, what it's good for, who it's good for, its terminology, and continues with a tutorial.
Ranked in these QuestionsQuestion Ranking
Pros
Pro You don't have to choose a testing framework
Nightwatch solves the Paradox of Choice among testing frameworks such as Jasmine, Cucumber or Mocha+Chai, by including its own BDD-style assertion library, based on Chai.
Pro Includes its own testing framework / assertions library
Pro Test organization is out of the box
Supports page object model, custom commands, custom assertions, and globals.js.
Pro 3rd party integration with Cucumber
Though Cucumber is not officially supported, Nightwatch can be used with Cucumber.
Pro Extensive, clear documentation
The documentation starts by describing what Intern is, what it's good for, who it's good for, its terminology, and continues with a tutorial.
Pro Used by big players
Intern is used by big companies such as IBM, Intuit and Mozilla.
Pro JS Foundation project
Intern (and Leadfoot) is a JS Foundation project. The JS Foundation is sponsored by IBM, Samsung, and other industry leaders.
Pro Comparisons available with Jasmine, Mocha, Karma, QUnit, Nightwatch, BusterJS
A project that compares itself with prior art has done its homework.
Pro Continuous Integration support
Pro Very well documented release history
Compare the Intern releases with those from Nightwatch, let alone WD.js
Pro Built-in support for source maps
The built-in support for source maps allows you to easily track issues to the original source files.
Pro Integrates with cloud hosted cross-browser testing services
Can integrate with cloud hosting services from BrowserStack, Sauce Labs and TestingBot.
Pro Always uses Promises
Since it always uses Promise objects every time an asynchronous operation needs to occur, the test system pauses until that Promise object is resolved, or until a timeout occurs. Suite, test and reporter functions can return a Promise.
Cons
Con No official BDD-style syntax support
Con Includes its own testing framework / assertions library
Unlike WebdriverIO, which lets you use various test frameworks and assertion libraries (e.g. Jasmine, Cucumber, Mocha + Chai), Nightwatch comes with its own BDD-style interface for performing assertions, based on Chai.
Here's a simple test example:
module.exports = {
'Demo test Google' : function (browser) {
browser
.url('http://www.google.com')
.waitForElementVisible('body', 1000)
.setValue('input[type=text]', 'nightwatch')
.waitForElementVisible('button[name=btnG]', 1000)
.click('button[name=btnG]')
.pause(1000)
.assert.containsText('#main', 'Night Watch')
.end();
}
};
Con Intern has no Cucumber support yet
Leadfoot can be used standalone though.
Con May be overkill for small apps
Intern is a complete testing framework that's designed to work well for enterprise applications. For small projects, the complexity of Intern can be unnecessary.