end-to-end (e2e) testing at chroma

8
END TO END TESTING - NIGHTWATCHJS WWW.CHROMASPORTS.COM Author: Chroma Nightwatch.js End-to-End (E2E) at CHROMA

Upload: emmanuel-ide

Post on 12-Feb-2017

88 views

Category:

Software


0 download

TRANSCRIPT

Page 1: End-to-End (E2E) Testing at Chroma

END TO END TESTING - NIGHTWATCHJS

WWW.CHROMASPORTS.COM

Author: Chroma

Nightwatch.jsEnd-to-End (E2E) at CHROMA

Page 2: End-to-End (E2E) Testing at Chroma

END TO END TESTING - WHAT DO WE MEAN BY TESTING?

WWW.CHROMASPORTS.COM

Author: Chroma

UNIT TESTING● methods/functions

INTEGRATION TESTING● components/modules

PENETRATION TESTING● Complete System

LOAD TESTING● Complete System

E2E TESTING● Web browser● As and end user● Complete System

Page 3: End-to-End (E2E) Testing at Chroma

END TO END TESTING - WHY DO WE NEED E2E TESTING?

WWW.CHROMASPORTS.COM

Author: Chroma

OBJECTIVES

1. Continuous Integration: => Push to production daily

2. No Dedicated QA resources as part of the scrum team

3. Release must not break user flows

Page 4: End-to-End (E2E) Testing at Chroma

END TO END TESTING - WORKFLOW

WWW.CHROMASPORTS.COM

Author: Chroma

INSTALL

● Add nightwatch npm package to your front-end repository

CREATE A TEST

● E2E test is part of “Done”, create a test for each user story

RUN THE TEST

● Make sure “npm test” is added to the build script

Page 5: End-to-End (E2E) Testing at Chroma

END TO END TESTING - NIGHTWATCHJS

WWW.CHROMASPORTS.COM

Author: Chroma

ABOUTNightwatch.js is an automated testing framework for web applications and websites, written in Node.js and using the W3C WebDriver API (formerly Selenium WebDriver). It is a complete browser (End-to-End) testing solution which aims to simplify the process of setting up Continuous Integration and writing automated tests.

Page 6: End-to-End (E2E) Testing at Chroma

END TO END TESTING - NIGHTWATCHJS

WWW.CHROMASPORTS.COM

Author: Chroma

WHY

Best E2E testing framework for Javascript developers

Rich community, actively supported

Easy to get started

Page 7: End-to-End (E2E) Testing at Chroma

END TO END TESTING - WORKFLOW

WWW.CHROMASPORTS.COM

Author: Chroma

KEY PRINCIPLES

● Easy to install & maintain(npm install chroma-

nightwatch)

● Don’t repeat yourself(page objects)

● Use unique html identifiers

Page 8: End-to-End (E2E) Testing at Chroma

END TO END TESTING - LET’S GET SOME CODING DONE!

WWW.CHROMASPORTS.COM

Author: Chroma

1) npm install chroma-nightwatch

2) npm test

3) The tests are failing, let’s fix them