Why Nightwatch.js?

937 views
Skip to first unread message

Leena Sharma

unread,
Nov 16, 2016, 6:07:34 AM11/16/16
to NightwatchJs
Hi All, 

Do we get additional benefit of using Nightwatch for E2E testing of Reactjs apps. I have seen NighwatchJs to be considered as an option when the application uses ReactJs. 

Thanks, 
Leena 

Eric Mumford

unread,
Feb 7, 2017, 11:40:07 PM2/7/17
to NightwatchJs
Write a NodeJS test with Selenium webdriver. Then write the same test in Nightwatch. It's amazingly simpler.

Your front end technology (React) doesn't much matter. I have React, Angular, and custom front end rendering all being tested with Nightwatch.

Leena Sharma

unread,
Feb 8, 2017, 2:04:18 AM2/8/17
to NightwatchJs
Thanks Eric. How writing a test for NodeJS application will be different when we use Selenium Webdriver? 

I am new to NodeJS and trying to learn that how it impacts E2E testing. I have worked on protractor but the differences I could understand were more related to Angular rather than NodeJs itself. 
Could you please share references. 

Regards, 
Leena 

Eric Mumford

unread,
Feb 14, 2017, 1:37:28 PM2/14/17
to NightwatchJs
About a year ago, protractor was all the rage because Google used it to test Angular, and Angular was exciting.

Now that ReactJS has largely overtaken Angular as the go-to front end framework, two things have happened:

1. The need to use protractor has decreased since ReactJS is so much more elegant than AngularJS.
2. Further developments in Selenium webdriver, Selenium server, and developments in the Nightwatch stack make programming Nightwatch to interface with both Angular and React sites very easy.

It doesn't matter if your web application is a NodeJS web server or not. You can use any language to write Selenium tests in. I choose Javascript (Node) because it's the most common language used in the modern web world, NodeJS is fast and awesome, and front end developers can help write tests. It's a win-win for any enterprise class test implementation. Large companies are beginning to catch on, and ditch their HP QTP / ALM legacy solutions and hire Node SDETs.

My references, unfortunately, are... just my experience.


Good luck,
Eric

Nabil BOURENANE

unread,
Feb 15, 2017, 4:57:57 AM2/15/17
to NightwatchJs
I can confirm this : 
front end developers can help write tests.

I work on a web application developed with PHP which command system services.

For me, using NightwatchJS permits to take advantage of NodeJS ecosystem (NPM), making it easy and fast to add different kind of assertions (SSH, DNS, DHCP, SQL, SNMP, and many more...).

Good luck.

Leena Sharma

unread,
Feb 16, 2017, 2:58:35 AM2/16/17
to NightwatchJs
Thanks Eric. This is really helpfully. 

I have couple of questions in my mind, would you please help -

- apart from being most common language, does JS brings more advantages to E2E testing? 
- are there other JS E2E testing frameworks available in market, which are not part of Node?
- also, I was going through the concept of Async programming in Node. So do I always need to write my E2E tests as async only when I use nodeJS?

Thanks, 
Leena 

Eric Mumford

unread,
Feb 16, 2017, 6:43:44 AM2/16/17
to nightw...@googlegroups.com
Leena,

Javascript is the language of the web and a reasonably friendly language to learn. It does have some quirks that take some getting used to (it is functional programming and asynchronous). But this is a matter of training and there are plenty of free youtubes that can get a person up to speed.

The problem with frameworks is that there are hundreds of them, but only a few good ones. Nightwatch is the best framework I have seen and used. Other people have other opinions. What is most important is that you have a person on your team who has mastered any framework and can implement it and teach it to the team.

Async programming can be tricky, but you do  not need to know async programming to use Nightwatch. It helps to invest 5-10 hours of learning so you can write and understand custom commands, though.

Good luck,
Eric

--
You received this message because you are subscribed to a topic in the Google Groups "NightwatchJs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nightwatchjs/e6fHpQq1up8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nightwatchjs+unsubscribe@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/1f46a89c-76d0-48f5-ab59-3d056e0a643f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mm

unread,
Nov 4, 2019, 7:33:55 PM11/4/19
to NightwatchJs
Hi Eric,

Have you tried using nightwatch for Angular application.Did you face any issues?

Dustin Ogan

unread,
Nov 5, 2019, 8:36:23 AM11/5/19
to nightw...@googlegroups.com
Sorry that this isn't overly helpful.  I just remember that I had the idea in my head that protractor would have an advantage over other testing frameworks for having unique access to angular elements.  When i looked into it a little further there were things like that in the language. But most of them ended up being deprecated.  We are working in 8 however. So you may end up having an earlier version where they were still available. 

One thing that nightwatch has been problematic for me on, is the ".waitForElementVisible()" function.   Visible to me means interact able,  waitForElementPresent means its there but whether its intractable or not is unknown.   Their definition is wildly different.. And you'll see this a lot with element is not interactable errors or click was intercepted warnings when a loading overlay has not fully cleared. 

There are some good custom command shares out there where people have written their own implementation of isInteractable to combat this. 

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/826b5388-e8aa-458e-9db0-b582ff683de9%40googlegroups.com.

Mm

unread,
Nov 5, 2019, 3:15:34 PM11/5/19
to NightwatchJs
Thanks Dustin.
To unsubscribe from this group and stop receiving emails from it, send an email to nightw...@googlegroups.com.

Dustin Ogan

unread,
Nov 6, 2019, 8:16:54 AM11/6/19
to nightw...@googlegroups.com
Sure. One other thing I'd consider is going to their github .  I'm using nightwatch, so obviously there's enough there that i like to keep doing so.  However they've trended toward just closing out support issues lately to things being a selenium issue and not their fault. Yet other frameworks like Webdriver that sit on top of the same selenium builds aren't struggling with them.  It may just be that they're short staffed for an open source project.  But I've seen a lot of library contributors and content creators shifting to WebdriverIO lately after having some pain points getting cooperation from the nightwatch team.   Something to consider if you're still in the picking phase.  WebdriverIO is no where near perfect,  They have a lot of documentation with HUGE gaps and missing information, like the Page Object model setup and parts of the babel configuration including files that don't exist etc. But they have a lot more integration points in the last year if your idea is for this to move out to corp or department wide adoption.

To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/001f0e20-c834-480c-aad0-b7d7647e23eb%40googlegroups.com.

E M

unread,
Nov 6, 2019, 11:41:18 AM11/6/19
to nightw...@googlegroups.com
Nightwatch worked great for me for testing Angular and React.

--
You received this message because you are subscribed to a topic in the Google Groups "NightwatchJs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nightwatchjs/e6fHpQq1up8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nightwatchjs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/826b5388-e8aa-458e-9db0-b582ff683de9%40googlegroups.com.

Ansari Kapur Aman

unread,
Nov 6, 2019, 12:18:09 PM11/6/19
to nightw...@googlegroups.com
Nightwatch worked great for me with React.

You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/CAPh5BNzbh%3DeQy_Yubz4M14uw_Q5p-aFqYsKymxFRCUeXuOMmGw%40mail.gmail.com.


--

Aman Kapur Ansari | Scrum Master | Agile Coach |
Project Manager |  QA Specialist | Business Advisor & Investor | DC, Maryland, Virginia
P: (202) 476-0067 


Andrei Rusu

unread,
Nov 7, 2019, 7:57:43 AM11/7/19
to nightw...@googlegroups.com
Hello,

Yes, sometimes we might not be able to address all the issues in a satisfactory manner. But I'd like to point out that in the 5+ years of existence, Nightwatch as an open source project has never benefited from any substantial financial backing, nor did it have a large team of active contributors. 

We have some plans for the future of Nightwatch and we're hoping to be able to accelerate its development while also providing more assistance to the community. 


Reply all
Reply to author
Forward
0 new messages