Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Nightwatch Js an end to end testing tool for automating web
Rating: 4.1 out of 5(69 ratings)
267 students

Nightwatch Js an end to end testing tool for automating web

Nightwatch Js for beginners and Intermediate .
Created byQA Academy
Last updated 1/2024
English

What you'll learn

  • Students can gain nice automation knowledge on nightwatch js , after completing this course they will be in a position to automate any website .
  • Students can design framework from scratch with page objects , reporting and many other things both in JS and TS after completing this course.
  • After completing this course students will be in a position to write visual testing automation test cases as well.
  • Students can bag nice job in the market because nightwatch has some good demand in IT , very few people knew it .

Course content

20 sections68 lectures8h 32m total length
  • Installation Old Way5:35

    in this lecture we are going to learn Nightwatch Js setUp , initially we will be starting things with Javascript then we will deep dive into typescript .

  • Installation and writing out first test case using exports15:43
  • writing out our first test case using mocha test runner7:54
  • Adding screenshot to report on test case failure4:04
  • Nightwatch environments-16:57
  • nightwatch environments-29:51
  • Auto Take Screenshots on Failure , Skip Test Cases on Failure ,rimraf usage4:01
  • Running multiple testfiles ,single test file ,single testcase inside test file6:30

    This lecture updated on Nov23 2022

  • findElements5:33
  • findElements in Nightwatch3:07
  • Select In Nightwatch2:56
  • Upload File2:45
  • Getting count of some tag or locator and performing operation using count7:33
  • moveToElement and asserting number of elements in Nightwatch7:14
  • takeElementScreenshot2:19
  • Alerts and Pop Ups7:46
  • multiple windows handling in Nightwatch14:14
  • Frames Javascript15:30
  • Frames6:57

    Here I see I have covered frames topic in typescript , so please check Nightwatch with typescript section and do watch this video to avoid confusion till I add another video tutorial on this in Javascript.


    Here main intent is how we can switch to frames in webPage , you can identify frames in webpage by searching //iframe tag in the console. for finding indexes you just need to write (//iframe)[here goes the index] and search in console [don't forget if you find some frame at index two like (//iframe)[2] then in your code write browser.frame(1) because indexing starts from zero.


    browser.frame(index|id|some web element that you can construct out of frame tag) is all you need to know for switching to frames .

    for getting back to parent frame or out of frame just use browser.frameParent() or browser.frame(null)

  • Keyboard Actions6:37
  • Adding custom logs to Mochawesome reporting3:23

    In this video I will cover nightwatch reporting with mocha awesome & how to add logs to mocha reporting

  • Adding screenshot after each step to Mochawesome report3:35
  • Mochawesome reporter Options4:19

    const addcontext = require("mochawesome/addContext");




    describe('Facebook test', function () {


      // test() and specify() is also available



      it('amazon title test', function (browser) {

        addcontext(this, "verifying the title ")

        browser.assert.titleContains("Online Shopping site in India: Shop Online for Mobiles, Books, Watches, Shoes and More - Amazon.in")

      });


      it('amazon cart button test when no products', function (browser) {

        addcontext(this, "verifying the cart button ")

        browser.click('#nav-cart-text-container')

          .assert.elementPresent("#nav-cart-text-container")

      });


       this.afterEach(function (browser, done) {

        let path = process.cwd() + '/screenshots/' + Math.random().toString().substring(2, 5) + '.png'

        browser.saveScreenshot(path)

        addcontext(this, path)

        done();

      })


      this.beforeEach(function (browser, done) {

        addcontext(this, "navigating to amazon ")

        browser.url(browser.launchUrl)

        done();

      })



    });



    reporterOptions:{

                 'code':false,

                 'charts':true,

                 'timestamp':true,

                 'reportPageTitle':'Automation Report',

                 'reportTitle':'Automation Sample Report'

              }

  • Mochawesome In Detail5:05

    pass "this" context from your tests to pages so that you can write logs for the code that u write in your pages as well. In page methods receive "this" context as (testCtx:Mocha.Context)  . In order to use multiple it blocks use nightwatch 2.0 plus version

  • Datadriven testing8:55
  • element method Nightwatch version 2 and handlebars reporting with screenshots8:07
  • Run Tests in Headless mode using --headless command line argument0:56

    In this video we will talk about how to run tests in headless mode , do use resizeWindow(1600,900) method instead maximizeWindow() in headless mode. you can also use below desired capabilities in your config file in default env or which ever environment it might be rather specifying in command line so that it will run in headless mode.

    desiredCapabilities: {

            browserName: 'chrome',

            javascriptEnabled: true,

            acceptSslCerts: true,

            chromeOptions: {

              args: ['headless','disable-gpu']

            }

          }

  • Pass headless argument in config file1:53
  • Grouping Tests3:23

    Hi Guys , in this video , we will group our tests and run them

  • globals9:38
  • Globals In Detail10:27
  • moveTo element in nightwatch [updated on jan 1st 2024]7:51

Requirements

  • Basic Javascript knowledge is required
  • If you have any other programming language knowledge that would also work.

Description

Learn more in less time .This course is best suited for Beginners and Intermediate level guys who wanna learn web automation with ease .

In this course you will learn end to end about using Nightwatch js tool with both Javascript and Typescript . Main goal of this course is to achieve /learn more about automation testing in short time .After completing this course you will be able to design a framework from scratch with page Objects and beautiful test case reporting with logs and screenshots attached and many other things.I request everyone to please plug In your ear phones when watching this course so it will be much clear . Initially we will be learning Nightwatch Js configuration which is root for starting automation .you need to have a little javascript programming knowledge .In case if you're already working on test automation tools like selenium java => after taking up this course you will feel too easier as we write very less code and achieve more.



->Nightwatch Basics

Setting up environment

WebDriver manager (manage server and drivers automatically)

How to auto take screenshot on failure

How to use environments

How to use launch Url flag

How to not skip test cases on failure

Retries

Soft Assertions

Hard Assertions

using element method

running tests in headless mode

How to run single test case

How to run single test file

find Elements in Nightwatch

window handling

frames

moveToElement , scroll actions

Handling Alerts , PopUps

Debugging Nightwatch tests

cucumber

Page Object model using class style

Page Object model using functional style

And many more…


->Nightwatch reporting with mocha , Nightwatch html reporter and others


-> Page Objects


-> we will be covering Nightwatch with javascript & typescript


-> Nightwatch Cucumber


-> Nightwatch mocha and mochawesome


-> Nightwatch custom commands


-> GitHub actions



About Tool :

Nightwatch.js is one of the popular integrated framework for performing automated end-to-end testing on web applications and websites, across all major browsers. It is written in Node.js and uses the W3C WebDriver API to interact with various browsers.

It is a complete end-to-end and cross-browser testing solution and it aims to simplify the process of writing and running various types of tests.



Note: I suggest to use mocha runner so you can leverage mochawesome reporting which is very famous and neat

Who this course is for:

  • Beginner / Intermediate /experienced automation testers who worked on selenium/ Appium Java or manual testers or who ever looking to learn automation testing can take this course