JDI Когда не так просто, но всё-таки возможно Dmitrii Shadrin JULY 25, 2017
JDI MAIN ADVANTAGES CONFIDENTIAL 2
JDI Main Advantages • Cascade initialization • Elements library • Assertions, Logging and reporting • Easy things are easy to do • Customizable • Hard things are possible CONFIDENTIAL 3
EASY CASES ARE RARE IN PRACTICE CONFIDENTIAL 4
Things are not always easy • Application peculiarities • Environmental limitations • Tool misuse CONFIDENTIAL 5
CERTAIN CASES • Working with multiple config files • Custom Web. Driver/Proxy/Remote. Web. Driver • Waits are not always obvious • Applications that don’t want to be automated • Angular Synchronization CONFIDENTIAL 6
MULTIPLE CONFIG FILES CASE CONFIDENTIAL 7
WHY MULTIPLE CONFIGS? • Different environments • Different types of testing/test scope • Different user roles • Whatever… CONFIDENTIAL 8
WHAT JDI OFFERS CONFIDENTIAL 9
WHAT JDI OFFERS CONFIDENTIAL 10
WHAT WE WOULD LIKE TO HAVE Dev Properties Test Properties Global Properties Prod Properties CONFIDENTIAL 11
SOLUTION CONFIDENTIAL 12
BETTER SOLUTION (PR#108) CONFIDENTIAL 13
WHAT WE WOULD LIKE TO HAVE Dev Regr. Dev Perf. Debug Config Test Smoke Test Regr. Test Perf. Prod Smoke Debug Config Dev Test Global Properties Prod CONFIDENTIAL 14
CUSTOM WEBDRIVER CONFIDENTIAL 15
WHY CUSTOM WEBDRIVER? • Proxy • Remote Web. Driver • Custom browser setup for tests CONFIDENTIAL 16
WHAT WE HAVE INITIALLY CONFIDENTIAL 17
SOLUTION CONFIDENTIAL 18
WAITS ARE NOT ALWAYS OBVIOUS CONFIDENTIAL 19
RESULT OF WAIT IS NOT ALWAYS OBVIOUS • Heavy apps – ~1 minute page load time • wait. Displayed() • wait. Vanished() CONFIDENTIAL 20
UNPREDICTABLE WAIT RESULTS CASE CONFIDENTIAL 21
CUSTOM WAITS CONFIDENTIAL 22
OR… CONFIDENTIAL 23
OR… admin. Menu. wait(el -> el. is. Displayed(), 60); CONFIDENTIAL 24
APPLICATIONS THAT DON’T WANT TO BE AUTOMATED CONFIDENTIAL 25
‘PROBLEM’ APPLICATIONS • Weird element locators • Total absence of element id’s • Multiple elements with same id • Overcomplicated page structure • Inconsistent application behavior CONFIDENTIAL 26
‘PROBLEM’ APPLICATIONS CONFIDENTIAL 27
‘PROBLEM’ APPLICATIONS CONFIDENTIAL 28
‘PROBLEM’ APPLICATIONS CONFIDENTIAL 29
SOLUTIONS? CONFIDENTIAL 30
SOLUTIONS? CONFIDENTIAL 31
ANGULAR SYNCHRONIZE IN ANY FRAMEWORK CONFIDENTIAL 32
PROTRACTOR FOR ANGULAR APP? • Implied Synchronization with Angular • NG-based locators • Creating tests in same ecosystem as app CONFIDENTIAL 33
PROTRACTOR FOR ANGULAR APP? • Implied Synchronization with Angular ✔ handled by JDI • NG-based locators ✔ present in JDI • Creating tests in same ecosystem - do testers need it? CONFIDENTIAL 34
Explicit wait. For. Angular() is not needed, but possible =) CONFIDENTIAL 35
THANK YOU! CONFIDENTIAL 36