12
Automated Headless End2End AngularJS Testing by Benjamin Neu – 28.01.2015

20150128 angular js_headless_testing

Embed Size (px)

Citation preview

Page 1: 20150128 angular js_headless_testing

Automated Headless End2End AngularJS Testing by Benjamin Neu – 28.01.2015

Page 2: 20150128 angular js_headless_testing

• Ensures Quality • Helps with refactoring • Tests instead of specification / documentation • Integration of new developers easier

Why Testing ?

Plan 30% Dev Time for writing tests

28.01.2015 2

Page 3: 20150128 angular js_headless_testing

Unit Tests

End2End Tests vs

28.01.2015 3

Page 4: 20150128 angular js_headless_testing

Toolchain for Testing

Angular Test Stack

Protractor

test runner /

test framework

Selenium

web browser

automation

Browsers

28.01.2015 4

Jasmine

test description

Page 5: 20150128 angular js_headless_testing

Protractor Example

28.01.2015 5

Page 6: 20150128 angular js_headless_testing

Protractor Example (1)

28.01.2015 6

Page 7: 20150128 angular js_headless_testing

Protractor Example (2)

28.01.2015 7

Page 8: 20150128 angular js_headless_testing

Demo with UI

28.01.2015 8

Page 9: 20150128 angular js_headless_testing

Testing Automated

• Headless Setup, to save resources (no X-Server needed)

• Virtual framebuffer xvfb

28.01.2015 9

New Code

Event

Selenium

Standalone on

Ubuntu

Browsers Bamboo Build Server

Run and parse Protractor Test

Page 10: 20150128 angular js_headless_testing

Demo Headless

28.01.2015 10

Page 11: 20150128 angular js_headless_testing

• You can only control the webbrowser and not the OS windows and events

• It is very hard to test if elements are visible at the right position

• Toolchain sometimes does not keep up with browser updates

Testing Limits

28.01.2015 11

Page 12: 20150128 angular js_headless_testing

POINT-OF-MEDIA.COM [email protected]

STEFAN-GEORGE-RING 2 • 81929 MUNICH • GERMANY PHONE + 49 89 – 21 54 74 61 - 0

LET‘S TEST IT Looking for a job ? - WE ARE HIRING

28.01.2015 12