API Testing with JavaScript Notes

API = application programming interface

REST = representational state transfer

GET = retrieve/download data

POST = create data

PUT = update data

DELETE = deletes/removes data

Test Automation University

Test automation helps to:

  1. Release features faster

  2. Enable continuous testing

  3. Reduce regression testing time

Who’s going to participate?

Options: Testers, Developers, Test Automation Engineers

They’re going to need to be able to:

  1. Write automation scripts

  2. Monitor results

  3. Update tests

“Test automation is a software development process in and of itself.”

How to decide what to automate?

Run tests locally and report to team?

Run tests multiple times a day in a CI job separate from development?

Run as part of development’s CI process?

(Can’t find where video explains what “CI” means)

“Test automation is most successful when there is collaboration amongst different team members: the product owners, business analysts, developers, testers, and of course automation engineers.”

Product owner / business analyst - help to decide which tests need to be automated

Developers - contribute unit tests, help update tests

Testers - manual testers are still needed! Not everything can or should be automated. They can also help with knowing which tests to automate

Test Automation Pyramid

UI - at the top of the pyramid. Should have the least automated tests

Services - middle of pyramid. More automated tests than UI but less than Unit

Unit - bottom of the pyramid. Should have the most automated tests

Seams = shortcuts in application example: unique URLs

UI Locators - UI level tests need to access html elements

Interaction & Validation

Unit & Services tests (functions) - write in the same language

Interaction = call functions

Services tests (APIs) - need to do HTML requests & responses

UI - need navigation library

Validation libraries - turn code into tests

Run tests in parallel to reduce time to complete

Clean coding - code reusability and maintainability.

Avoid:

  • excessive code duplication

  • long classes and methods,

  • inefficient waiting within tests

  • code smells

Design Patterns

  • Page Object Model

  • Screenplay

  • Fluent

  • Builder

  • Singleton

  • Factory

  • Facade

(These aren’t defined in the video)

Scaling Tests consider multiple:

  • environments

  • browsers

  • devices

Measuring return on investment. Benefits:

  • Shortened regress testing time

  • Fast and frequent feedback

  • Faster development time

  • Scalability

The Whole Team Approach to Continuous Testing

Continuous testing - test throughout the entire development cycle

Benefits:

  • Fast feedback at any stage

  • Continuously learn about product

  • Speed up development

  • Increases confidence going in the right direction

  • Reduce waste by learning early

  • Increase team morale

Working Solo - working asynchronously

  • Don’t block your full time

Paring Up - Strong Style

  • One person navigates, the other person types

  • “for an idea to go from your hand into the computer it must go through someone else's hands"

  • Rotate frequently

The Mob Approach

  • One person types, other people provide input one at a time

  • Less intense than pairing, easier to take breaks without slowing down work

-- KellieHeistand - 23 Jun 2020
Topic revision: r2 - 05 Oct 2020, KellieHeistand
© 2020 Ultranauts - 75 Broad Street, 2nd Floor, Suite 206, New York, NY 10004 - info@ultranauts.co