3/23/2019 1 Crossing The Streams Multi – Platform Framework Design Jason Edstrom 03.21.18 2 About This Guy • Magenic Technologies • 4 years • Automation Lead • Mobile Enthusiast • Mobile Hardware Repair • Mobile Developer • Mobile Automation • Chronic Early Adopter • Notorious Edge Case 1 2
23
Embed
03.21.18 Crossing The Streams - STPCon...3/23/2019 1 Crossing The Streams Multi –Platform Framework Design Jason Edstrom 03.21.18 2 About This Guy •Magenic Technologies •4 years
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
3/23/2019
1
Crossing The Streams
Multi – Platform Framework Design
Jason Edstrom
03.21.18
2
About This Guy
• Magenic Technologies
• 4 years
• Automation Lead
• Mobile Enthusiast
• Mobile Hardware Repair
• Mobile Developer
• Mobile Automation
• Chronic Early Adopter
• Notorious Edge Case
1
2
3/23/2019
2
3
Mobile Application Types» Native
› iOS− Objective C− Swift
› Android− Kotlin− Java
» Translated› React Native, Xamarin, Flutter
» Hybrid› Some or All HTML in an app package› PhoneGap, Cordova, Ionic
» Web
4
Criteria» Shared/Single Test Class
» Cross Platform
» Application Divergence
» Performance
» Shared Code
3
4
3/23/2019
3
5
Stretch Goals» Readability
› Diagramming
› Test
› Page Object
» Design Consistency Enforcement
» Use Object Oriented Principles
» Traceability
› All errors are happening in the class context that is relevant
» Not just Application divergence, but device type divergence
6
Design Scenarios» Split Framework
» Conditional Page Models
» Page Factory
» Abstract Parent
5
6
3/23/2019
4
Split Framework“You stay on your side of the room and I’ll stay on my side”
8
Split Framework - Single Test Case
Android Test Class iOS Test Class
7
8
3/23/2019
5
9
Split Framework – Cross Platform
Test Runner Test Class
10
Split Framework – Application Divergence
9
10
3/23/2019
6
11
Split Framework - Performance
ClickElement()FindElement() elementClick()
12
Split Framework – Shared Code
11
12
3/23/2019
7
13
» Out of the Box Platform Specific Tests
» Abstraction is not required for UX divergence
» Enforced Single Responsibility on Test and Page Object level
Split Framework - Benefits
14
» Test Coverage Desync
» Reporting the test results becomes a separate test point
› Test Point – attributes of test
− Platform
− Version
− App Version
» Code Sharing is painful
› High Number of static methods
› Duplicated code everywhere
Split Framework - Consequences
13
14
3/23/2019
8
15
Split Framework ChecklistSingle Test Class - No
Cross Platform - Meh
App Divergence - Yes
Performance - Yes
Shared Code - No
Conditional Page Model“10 gallons of stuff in a 5 gallon bucket”
15
16
3/23/2019
9
17
Conditional Page Model - Single Test Case
Android Test Class
iOS Test Class
18
Conditional Page Model - Cross Platform
17
18
3/23/2019
10
19
Conditional Page Model - Application Divergence
20
Conditional Page Model - Performance
ClickElement()FindElement()
element
Click()
19
20
3/23/2019
11
21
Conditional Page Model - Shared Code
22
» Test reporting becomes a run configuration detail
» Page Object Models have more shared code
» Page Object Models can primarily use the parent driver
» Test Coverage stays consistent across platforms
Conditional Page Model - Benefits
21
22
3/23/2019
12
23
Conditional Page Model - Consequences
» Extra work needed for Platform Specific tests
» Page Object Models stop respecting Single Responsibility
› Platform Specific drivers
› Platform Specific methods
› Platform Specific selectors
» Conditional statement at every instance of UX Divergence
› Which has the high probability of being every selector
24
Conditional Page Model» Single Test Class - Yes
» Cross Platform - Yes
» App Divergence - Meh
» Performance - Yes
» Shared Code - Meh
23
24
3/23/2019
13
Page Factory“Buying a Papa Johns store when all you want is a slice of pizza”
26
Page Factory - Single Test Case
Android Test Class
iOS Test Class
25
26
3/23/2019
14
27
Page Factory - Cross Platform
28
Page Factory – Application Divergence
27
28
3/23/2019
15
29
Element 4Element 3Element 2Element 1Click()FindElement()