Your SlideShare is downloading. ×
0
Angular testing
Angular testing
Angular testing
Angular testing
Angular testing
Angular testing
Angular testing
Angular testing
Angular testing
Angular testing
Angular testing
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Angular testing

638

Published on

Angular Unit Testing, Mid Way Testing and E2E Testing workshop by Mathieu Chauvinc, CTO of Red Ape Solutions Malaysia

Angular Unit Testing, Mid Way Testing and E2E Testing workshop by Mathieu Chauvinc, CTO of Red Ape Solutions Malaysia

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
638
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Angular Testing with Mathieu Chauvinc, Managing Director, Red Ape Solutions
  • 2. Angular.js Testing - Overview ● Unit tests – ● Midway tests – ● Karma + ngMidwayTester End to end testing – ● Karma Protractor Git repo: https://github.com/matiboy/AngularTesting.git
  • 3. Unit testing ● Code level ● Smallest unit possible ● Using Karma – Configuration ● Auto refresh ● Include modules – Jasmine – Karma start – Describe/it – xdescribe/xit – iit Check out Unit
  • 4. Unit testing ● module( === angular.mock.module( ● $injector and _thingToInject_ ● beforeEach ● afterEach ● Assertion tools toBe, toBeDefined, toBeNull, toBeLesserThan, etc.... ● Create your own assertions (will do for E2E)
  • 5. Unit testing ● Spies – Create spy – Call through – Access information about calls ● Spy object ● Dependency injection: override functionalities ● Working with promises: resolving (scope.$apply) ● $httpBackend (Watch out for angular mocks version) Check out Unit2
  • 6. Unit testing – More functionalities ● Karma coverage – Install karma-coverage (reporter) – Configuration ● PhantomJS ● Reporters
  • 7. Midway testing ● Allowed to cross boundaries ● Check – existence of modules – Existence of routes – Slightly higher level code ● Create new config file ● Install ngMidwayTester – npm – Add to config files Check out Midway
  • 8. E2E testing ● Application level ● Access to HTML ● No access to internals ● Protractor – Selenium – Chrome Web driver – Configuration – Params Check out E2E
  • 9. E2E testing ● Selectors – – By input – By css – By xpath – ● By binding Row / column Element queries – are promises (async and have .then) – Can be chained with actions – Expect can be wrapped around them
  • 10. E2E testing ● Information about element – – GetLocation, getSize – GetCssValue, GetAttribute – ● GetText, getInnerHtml IsEnable, isSelected, isDisplayed, isElementPresent Actions – sendKeys – Click – Clear – submit
  • 11. Thank you!

×