Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Successfully reported this slideshow.

Like this presentation? Why not share!

- Introduction to Protractor by Florian Fesseler 17912 views
- Better End-to-End Testing with Page... by Kasun Kodagoda 2182 views
- Introduction to Protractor by Jie-Wei Wu 4692 views
- Sharing the pain using Protractor by Anand Bagmar 6522 views
- Angular UI Testing with Protractor by Andrew Eisenberg 5603 views
- Automated Web Testing using JavaScript by Simon Guest 71231 views

The tips and tricks of using protractor for writing e2e tests with AngularJS

No Downloads

Total views

18,205

On SlideShare

0

From Embeds

0

Number of Embeds

4,619

Shares

0

Downloads

256

Comments

4

Likes

21

No notes for slide

- 1. Protractor's Tips & Tricks
- 2. Sergey N. Bolshchikov Developer Advocate @ Wix Creator of js-must-watch list Co-organizer of YouGottaLoveFrontend
- 3. Protractor's Tips & Tricks Heavily Opinionated List
- 4. Protractor e2e testing framework that runs test in a browser interacting as a real user
- 5. Protractor Is not Always Fun
- 6. ● Best Practices ● Tricks ● Performance ● Run & Debug
- 7. Best Practices
- 8. Problem 1 Unknown window size when the browser is opened
- 9. Solution 1 Set the required window size before every test
- 10. Solution 1
- 11. Problem 2 Small change in html can many changes in tests
- 12. Solution 2 Page Object and Page Fragments that introduce additional level of abstraction
- 13. Problem 3 Changing html structure (tags/classes) will break tests
- 14. Solution 3
- 15. Solution 3
- 16. Solution 3
- 17. Problem 4 Complicated tests with many checks are hard to read
- 18. Solution 4
- 19. Problem 5 Many tests lead to hairy long and complicated test structure
- 20. Solution 5
- 21. Tips & Tricks
- 22. Problem 1 Sharing values between tests
- 23. Solution 1
- 24. Problem 2 Setting a new value in tag
- 25. Solution 2
- 26. Problem 3 Classical click is simple but how about right mouse button click?
- 27. Solution 3
- 28. Problem 4 Still can’t find a protractor method that fits your purposes?
- 29. Solution 4
- 30. Problem 5 Testing non-angular application with protractor?
- 31. Problem 6 Tests are good but don’t pass in IE
- 32. Performance
- 33. Problem One and Only Running e2e tests takes too much time
- 34. Solution 1 Use sharding configuration for running several browser instances
- 35. Solution 1
- 36. Solution 1 Note: sharding is per file so create several testing files
- 37. Solution 2 Disable ng-animate and css animations
- 38. Solution 3 The right balance between amount of s and s
- 39. Run & Debugging
- 40. Problem 1 Hard to debug the test
- 41. Solution 1 Integration with IDE such as Intellij/Webstorm
- 42. Problem 2 Something is wrong and you have no idea why
- 43. Solution 2 Interactive REPL Element explorer
- 44. Solution 2
- 45. Solution 2 Elementor
- 46. Problem 3 Run in CI in all major browsers
- 47. Solution 3 Use Sauce Labs with credentials specified directly in protractor config file.
- 48. Solution 3
- 49. Thanks! http://bolshchikov.net http://blog.bolshchikov.net http://il.linkedin.com/in/bolshchikov http://github.com/bolshchikov

No public clipboards found for this slide

Login to see the comments