25
Full Stack Testing of Node.js Applications Presented by Stacy Kirk, QualityWorks Consulting Group and nodeqa.io

Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Full Stack Testing of Node.js Applications Presented by Stacy Kirk, QualityWorks Consulting Group and nodeqa.io

Page 2: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Dynamic, single, independent tests of methods, functions, and stand alone components

Unit Testing

Web services, database, contract, and APIAPI/Integration Testing

End-to-End Tests, Acceptance Tests, Performance, Functional, System, Regression, and Compatibility

Automated UI/Functional Tests

Usability, Look-and-Feel, Exploratory, UAT, and BetaManual User Acceptance Testing

The Full Stack of Testing

Ideal Testing Pyramid

Page 3: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Challenges of Test AutomationWe Need a Hero

TEST AUTOMATION

Tests are time-consuming

Hard to maintain/fragile

Unit tests are enough, right?

Not Reliable: Too many failures

Different tools, languages, process,& teams

Page 4: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Build

Integrate

Deploy

Dependency on Automated, Reliable, Maintainable Tests

Building for Continuous Delivery

TEST

Page 5: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Integrated Test Structure

Page 6: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Shared Test Data

Page 7: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Simplicity of Execution

git clone https://github.com/QualityWorksCG/qualityworks-full-stack-testing.git

Clone

npm install

npm test

01

02

03Runs full stack of tests, sending results to reporting dashboards, triggered through CI

Page 8: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Makes front end testing simple to start with clear test results and ease of Continuous Integration.

Nightwatch

Utilizing Selenium Driver’s API, it is a top contender especially when coupled with Appium for mobile front end testing in JavaScript

Webdriver.io

Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks.

Jasmine

Headless webkit for scripting web browser testing. Leveraged with Casper for browser navigation.

PhantomJS

One of the newest and most promising test frameworks. Feature rich functionality including unit testing, code coverage, and mobile/browser testing.

Intern.io

Karma is a test runner for JavaScript that runs on Node.js. It is very well suited to testing AngularJS.

Karma

REST API testing framework offering a BDD testing style and fully exploiting promises.

Chakram

Mocha is a feature-rich JavaScript test framework running on Node.js making synchronous and asynchronous testing simple and fun.

Mocha

Node.js CI/CD test reporting dashboard that provides executive and detailed test results in one clean view.

QualityWatcher.io

FE FE FE

FE TF TF

TF TF==

R

Identify Your Tools

TF- Test Framework FE- Front End Test Tool R- Reporter

Page 9: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Simple API Test

Mocha

Chakram

Page 10: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

JSON Schema and Value Assertion

Custom Methods with Chakram

form-data

Page 11: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

vMocha Chakram

Data Driven API Tests

data-driven

Chakram

Page 12: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Page Object Design Pattern

Separation of test code from page specific code

Low maintenance

Increase reusability

Better test readability

Page 13: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Design UI for Automation

#welcome-toolbar a.new-offer

table tbody tr:nth-child(1) td:nth-child(1) table tbody tr:nth-child(1) td:nth-child(4) div span

#dashboard-table div.offer-data span

//div[contains(@id,’editcampaign')]/div[starts-with(@id,'toolbar')]/div[starts-with(@id,'toolbar')]/div[starts-with(@id,'toolbar')]/a[starts-with(@id,'button')][1]

FirePath

Firebug

Page 14: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Technologies

Front End Web Testing CheatSheet

Nightwatch.js

Page 15: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Simple Front End Web Test

Nightwatch.js

Page 16: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Data Driven Front End Test

Nightwatch.js

Page 17: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Automated Front End Mobile Testing

WebdriverIO

Appium

Cheatsheet

Page 18: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Simple Front End Mobile Test

WebdriverIO

Appium

Page 19: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Mobile & Web Cloud Testing

Saucelabs

Page 20: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Value of Reporting

QualityWatcher

Page 21: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Detailed Reporting

QualityWatcher

Page 22: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Integrate Continuous Performance Testing

npm run performance

QualityMeter

Phantomas

Page 23: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

QualityMeter

Track performance over time

Page 24: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

Continous Test

Execution

ID, Class Names, Labels

Embrace Failures

Leverage Page Objects

Historical Dashboard

Recommendations

Integrate App Code and

Tests

Page 25: Full Stack Testing ToShare - QualityWorks Consulting Group€¦ · Webdriver.io Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend

@queenofagileqa

Github: QualityWorksCG/qualityworks-full-stack-testing

[email protected]

www.qualityworkscg.com