Top Banner
Slide 1 Testing AngularJS Applications February 2015 - Pedro Catré Technical University of Munich
28
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Testing AngularJS Applications at payworks

Slide 1

Testing AngularJS Applications February 2015 - Pedro Catré Technical University of Munich

Page 2: Testing AngularJS Applications at payworks

Slide 2

Use HTML as your template language, extend HTML syntax to express your application’s components clearly

AngularJS

Data binding Dependency injection

Page 3: Testing AngularJS Applications at payworks

Slide 3

Two points you should take away with you at the end of this presentation

Main Points

Tests will save you You have great testing tools

Adapted from http://xkcd.com/285/.

Page 4: Testing AngularJS Applications at payworks

Slide 4

payworks powers integrated Point of Sale solutions

Page 5: Testing AngularJS Applications at payworks

Slide 5

The Gateway Manager is the central place for clients to configure our platform

payworks Platform

payworks SDK

Quick integration of payment functionality

Gateway Manager

Intuitive merchant & terminal management

management

Global Connectivity

Processing with preferred Acquirer

management

Page 6: Testing AngularJS Applications at payworks

Slide 6

Within the Gateway Manager you can manage merchants, card readers, transactions, webhooks and API credentials

The Gateway Manager

Page 7: Testing AngularJS Applications at payworks

Slide 7

Testing requires different components to work together

Task automation tool Unit testing E2E testing Continuous integration server

Agenda

Page 8: Testing AngularJS Applications at payworks

Slide 8

Testing requires different components to work together

Task automation tool Unit testing E2E testing Continuous integration server

Agenda

Page 9: Testing AngularJS Applications at payworks

Slide 9

Automate everything! You will have to do it again

> grunt serve > grunt build > grunt test

Testing Tools

Page 10: Testing AngularJS Applications at payworks

Slide 10

Testing requires different components to work together

Task automation tool Unit testing E2E testing Continuous integration server

Agenda

Page 11: Testing AngularJS Applications at payworks

Slide 11

Karma loads your source code, executes your tests and much more

Karma

Page 12: Testing AngularJS Applications at payworks

Slide 12

Jasmine provides an elegant way of writing tests

Suites

Specs

Expectations

Matchers

Setup and Teardown

Mocks

Spies

Jasmine

Page 13: Testing AngularJS Applications at payworks

Slide 13

ngMock gives you mocking for your AngularJS tests

Support to inject and mock services

angular.mock.module() angular.mock.inject()

Extends core services $httpBackend $timeout

ngMock

Page 14: Testing AngularJS Applications at payworks

Slide 14

Let’s unit-test a component of the Gateway Manager

Unit Test Examples

Page 15: Testing AngularJS Applications at payworks

Slide 15

Let’s unit-test a component of the Gateway Manager

Unit-Test Examples

Page 16: Testing AngularJS Applications at payworks

Slide 16

How code coverage looks

Unit-Test Code Coverage

Page 17: Testing AngularJS Applications at payworks

Slide 17

How code coverage looks

Unit-Test Code Coverage

Page 18: Testing AngularJS Applications at payworks

Slide 18

How code coverage looks

Unit-Test Code Coverage

Page 19: Testing AngularJS Applications at payworks

Slide 19

How code coverage looks

Unit-Test Code Coverage

Page 20: Testing AngularJS Applications at payworks

Slide 20

How code coverage looks

Unit-Test Code Coverage

Page 21: Testing AngularJS Applications at payworks

Slide 21

Testing requires different components to work together

Task automation tool Unit testing E2E testing Continuous integration server

Agenda

Page 22: Testing AngularJS Applications at payworks

Slide 22

Protractor runs tests against your application in a real browser, interacting with it as a user would

Test like a user

For AngularJS Apps

Automatic waiting

Protractor

Page 23: Testing AngularJS Applications at payworks

Slide 23

Protractor runs your tests in different browsers, it supports test sharding and can take screenshots after each executed test

Protractor Configuration File

Page 24: Testing AngularJS Applications at payworks

Slide 24

Let’s e2e-test a component of the Gateway Manager

E2E-Test Examples

Page 25: Testing AngularJS Applications at payworks

Slide 25

Testing requires different components to work together

Task automation tool Unit testing E2E testing Continuous integration server

Agenda

Page 26: Testing AngularJS Applications at payworks

Slide 26

Bamboo connects issues, commits, test results and deploys so the whole picture is available to your entire product team

Bamboo

https://www.atlassian.com/software/bamboo

Page 27: Testing AngularJS Applications at payworks

Slide 27

Demo

Page 28: Testing AngularJS Applications at payworks

Slide 28

www.payworksmobile.com/career

We are hiring