SlideShare a Scribd company logo
The customer asked him: 

Would you like to join our scrum team where you will be responsible for
setting up an !-framework. You will be "-ing our new React Native
app for all default scenarios. Sounds cool, doesn’t it?
…there was a blue guy who ended up in a #tale
Once upon a time
$
He said:



%, that sounds awesome and looks like a &. I’ve never worked with
React Native but I do have JS and 'knowledge and I’m a quick (.
Made each other 

))
How ,
and
The app
The framework
Cross platform selectors
Mocking
animations
Magic
Next steps
Time
Pro’s and cons
Menu
Conversational
* +
User interface
The app
* +
User interface
After install
, -
onBoarding
The app
Movie
The app
The app
The framework
Cross platform selectors
Mocking
animations
Magic
Next steps
Time
Pro’s and cons
Menu
Appium + Appium Desktop
webdriver.io
CucumberJS
multiple-cucumber-html-report
Amsterdam 2017
The framework
Detox versus Appium
London 2018
The app
The framework
Cross platform selectors
Mocking
animations
Magic
Next steps
Time
Pro’s and cons
Menu
CP selectors
AccessibilityLabels (98%)
XPath (2%)
HyBrid solution
Testproperties
Implementation
Platform specific
Code
Testproperties
/**
* If we have a test build, add a unique test id for iOS and Android
*
* @param {string} id
*
* @return {object|*}
*/
function testProperties(id) {
if (IS_AUTOMATION_BUILD) {
return {
accessibilityLabel: `test-${id}`,
};
}
return null;
}
Implementation
import React, { Component } from 'react';
import { View } from ‘react-native';
import { testProperties } from './config/automation/TestProperties';
class MultipleChoice extends Component {
// Some code
render() {
const { options } = this.props;
return (
<View
style={styles.container}
{…testProperties('Select menu')}
>
// The select implementation
</View>
);
}
}
AccessiBility laBel(s)
Platform specific
function testProperties(id) {
if (IS_AUTOMATION_BUILD) {
if (IS_IOS) {
return {
testID: `test-${id}`,
};
}
return {
accessibilityLabel: `test-${id}`,
};
}
return null;
}
AccessiBility laBel
CP selectors
AccessibilityLabels (98%)
XPath (2%)
HyBrid solution
Testproperties
Implementation
Platform specific
Code
The app
The framework
Cross platform selectors
Mocking
animations
Magic
Next steps
Time
Pro’s and cons
Menu
Mocking
Why?
Remove flakiness
Fix inconsistent testdata problem
Test errors / delays / edge cases
Speed up manual and automated tests
With ng-apimock
How
Ng-apimock
Mocking
Why?
Remove flakiness
Fix inconsistent testdata problem
Test errors / delays / edge cases
Speed up manual and automated tests
With ng-apimock
How
The app
The framework
Cross platform selectors
Mocking
animations
Magic
Next steps
Time
Pro’s and cons
Menu
Animations
onBoarding
Each bubble takes 500 ms to show
Min 15 bubbles => 7,5 sec
Max 25 bubbles => 12,5 sec
Bubble delay is 800 ms
Between 19 (15*800+7,5) and 32 sec (25*800+12,5) animations
What?!
Remove animations
import { AppRegistry } from 'react-native';
import App from './app/App';
import { setupAutomation } from './app/config/automation/TestProperties';
// Run the automation setup
setupAutomation();
AppRegistry.registerComponent('Tele2CustomerApp', () => App);
Remove animations
const stubs = require('stubs');
/**
* Setup the app for a specific automation build
*/
function setupAutomation() {
if (!IS_AUTOMATION_BUILD) {
return;
}
// Disable the yellow box
console.disableYellowBox = true;
disableAnimations();
}
/**
* Disable all animations
*/
function disableAnimations() {
const AnimatedTiming = Animated.timing;
stubs(Animated, 'timing', (...props) => {
props[1].duration = 0;
props[1].delay = 0;
return AnimatedTiming(...props);
});
}
Result
Animations + real services No animation + mocking
15 sec!40 sec!
Animations
onBoarding
Each bubble takes 500 ms to show
Min 15 bubbles => 7,5 sec
Max 25 bubbles => 12,5 sec
Bubble delay is 800 ms
Between 19 (15*800+7,5) and 32 sec (25*800+12,5) animations
What?!
The app
The framework
Cross platform selectors
Mocking
animations
Magic
Next steps
Time
Pro’s and cons
Menu
95%Behind onBoarding
So….
Magic
Behind onBoarding
So….
Or
, -
Best test feature
Or Do some
Magic
, -
Best test feature
Or Do some
.
magic?
Magic with
Magic
.
magic?
Magic with
/
For 5 features
Magic
Implementation
• Deeplinking with mocking to mock a user.
• Deeplinking only on specific build types
• Go to the feature directly
• Saved another 20-30 seconds per scenario
• First technical steps for deeplinking in production
How React Native Appium and me made each other shine
95%Behind onBoarding
So….
Magic
The app
The framework
Cross platform selectors
Mocking
animations
Magic
Next steps
Time
Pro’s and cons
Menu
Test strategy
Reconsider deeplinking
Reconsider mocking
Phase 3
Next steps
Test strategy
Real devices
Platforms: iOS && Android
Devices: High- && Mid- && Budget-range
Platform tests: High && mid risk, proof only once
All device tests: Hi risk, test on all
With CucumberJS Tags
How?
CucumBerJS tags
Feature: View invoices
Background: Open account settings
Given I launch the new awesome Tele2 app
@os-specific
Scenario: As an user I want to see my not paid and paid bills
Given I'm logged in to open my invoices
Then I would like to see my unpaid bills
| text |
| Januari 2018 € 359,02 Deze factuur wordt op 01 februari afgeschreven. |
And I would like to see my paid bills
| text |
| December 2017 € 66,12 |
| November 2017 € 112,12 |
Scenario: As an user I want to be able to download or share my invoice
Given I'm logged in to open my invoices
When I select the first invoice
Then I would see the PDF of the invoice
When I press the download button
Then the download and share options are shown
CucumBerJS tags
Feature: Onboarding
Background: Open the app
Given I launch the new awesome Tele2 app
And I want to start with the onboarding
@all-devices
Scenario: As a customer I want to onboard with an existing MijnTele2 account
When I select Jazeker!
And I submit my credentials in the login form
Then the pincode bubble would be visible
When I submit valid pincodes
And I agree with the terms and conditions
Then I am redirected the home screen
Test strategy
Real devices
Platforms: iOS && Android
Devices: High- && Mid- && Budget-range
Extensive tests: High && mid risk, proof only once
Default tests: Hi risk, test on all
With CucumberJS Tags
How?
Test strategy
Reconsider deeplinking
Reconsider mocking
Phase 3
Next steps
Reconsider deeplinking
/ + ' = 0 = 1
Testlink screen
Testlink screen
import { StackNavigator } from 'react-navigation';
import TestLinkScreen from './TestLinkScreen';
/**
* Create the test link stack if it's a mocked build
*
* @return {*}
*/
function testLinkStack() {
if (MOCKED_ENVIRONMENTS.includes(ENVIRONMENT)) {
return {
TestLink: {
screen: StackNavigator({
TestLink: TestLinkScreen,
}),
},
};
}
return {};
}
Reconsider deeplinking
/ + ' = 0 = 1
Test strategy
Reconsider deeplinking
Reconsider mocking
Phase 3
Next steps
Reconsider mocking
Not
… each scenario on each '
… all '' have the same ⚡
… all '' start with same scenario at same ⏱
… same API response on all ''
Prevent
Ng-apimock
Mockserver
Ng-apimock
Mockserver
Post: api/version/login
"Content-Type": "application/json",
"Accept": “application/json"
response:
{
"status": 200,
"firstName": "Wim",
"lastName": “Selles"
}
Ng-apimock
Mockserver
weBdriver.io
PUT:
headers: {
'Content-Type': ‘application/json'
},
method: 'PUT',
body: {
identifier: 'token',
scenario: 'unauthorised'
}
Ng-apimock
Mockserver
weBdriver.io
The idea
Mockserver
weBdriver.io
IDFV: 51A82F08-CCAC-410F
The idea
Mockserver
weBdriver.io
IDFV: 51A82F08-CCAC-410F
The idea
Mockserver
weBdriver.io
PUT:
headers: {
'Content-Type': ‘application/json’,
ngapimockid: '51A82F08-CCAC-410F'
},
method: 'PUT',
body: {
identifier: 'token',
scenario: 'unauthorised'
}
IDFV: 51A82F08-CCAC-410F
response:
{
"status": 401,
“message": “unauthorised"
}
The idea
Mockserver
weBdriver.io
PUT:
headers: {
'Content-Type': ‘application/json’,
ngapimockid: '51A82F08-CCAC-410F'
},
method: 'PUT',
body: {
identifier: 'token',
scenario: 'unauthorised'
}
IDFV: 51A82F08-CCAC-410F
Post: api/version/login
"Content-Type": "application/json",
"Accept": “application/json”,
ngapimockid: '51A82F08-CCAC-410F'
response:
{
"status": 401,
“message": “unauthorised"
}
The idea
Mockserver
weBdriver.io
PUT:
headers: {
'Content-Type': ‘application/json’,
ngapimockid: '51A82F08-CCAC-410F'
},
method: 'PUT',
body: {
identifier: 'token',
scenario: 'unauthorised'
}
IDFV: 51A82F08-CCAC-410F
Post: api/version/login
"Content-Type": "application/json",
"Accept": “application/json”,
ngapimockid: '51A82F08-CCAC-410F'
/**
* This is a part from our `TestProperties`-file.
*/
import { getUniqueID } from 'react-native-device-info';
/**
* If it is an automation build, then add a new header for the API calls
*
* @return {Object}
*
* For iOS it will return something like: FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9
* For Android it will return something like: dd96dec43fb81c97
*/
function uniqueAutomationApiHeaderId() {
if (IS_AUTOMATION_BUILD) {
return {
ngapimockid: getUniqueID(),
};
}
return {};
}
app method
/**
* This is the config-file we use for calling all the API’s.
* Below you will see a part of the config to attach the headers
* to all API calls
*/
import { uniqueAutomationApiHeaderId } from './automation/TestProperties';
const apiConfig = create({
baseURL: BASE_URL,
headers: {
...API_HEADERS,
...uniqueAutomationApiHeaderId(),
},
});
Header
Testlink screen
Testlink screen
Testlink screen
/**
* Executes the api call with the provided information.
*
* @param {string} httpMethod PUT|DELETE|POST|GET
* @param {string} urlSuffix Which path to httpMethod the data to
* @param {Object} options The data that needs to be httpMethod
* @param {string} errorMessage The error that needs to be shown
*
* @return {Promise} The promise.
*
* @private
*/
function execute(httpMethod, urlSuffix, options, errorMessage) {
const data = {
headers: {
'Content-Type': 'application/json',
ngapimockid: device.uniqueID,
},
method: httpMethod,
};
if (options !== undefined) {
data.body = JSON.stringify(options);
}
return handleRequest(urlSuffix, data, errorMessage);
}
Set state
headers: {
'Content-Type': ‘application/json’,
ngapimockid: '51A82F08-CCAC-410F'
},
method: 'PUT',
body: {
identifier: 'token',
scenario: 'unauthorised'
}
response:
{
"status": 401,
“message": “unauthorised"
}
Implementation
Mockserver
weBdriver.io
PUT:
headers: {
'Content-Type': ‘application/json’,
ngapimockid: '51A82F08-CCAC-410F'
},
method: 'PUT',
body: {
identifier: 'token',
scenario: 'unauthorised'
}
IDFV: 51A82F08-CCAC-410F
Post: api/version/login
"Content-Type": "application/json",
"Accept": “application/json”,
ngapimockid: '51A82F08-CCAC-410F'
Reconsider mocking
Not
… each scenario on each '
… all '' have the same ⚡
… all '' start with same scenario at same ⏱
… same API response on all ''
Prevent
Test strategy
Reconsider deeplinking
Reconsider mocking
Phase 3
Next steps
Reconsider steps to
⚡4
execution / tests
Phase 3
⚡4
execution / tests
Focus on user experience
5 6
With Image compare
Phase 3
Test strategy
Reconsider deeplinking
Reconsider mocking
Phase 3
Next steps
The app
The framework
Cross platform selectors
Mocking
animations
Magic
Next steps
Time
Pro’s and cons
Menu
time
per scenario
Mocking: ~4 API calls (4 x 2 sec.) ~ 8 sec.
Animations: ~ 9 sec.
Deeplinking/Testlinkscreen: ~15 sec.
Currently 65 scenario’s
Average savings
time
per scenario
Mocking: ~4 API calls (4 x 2 sec.) ~ 8 sec.
Animations: ~ 9 sec.
Deeplinking/Testlinkscreen: ~15 sec.
Currently 65 scenario’s
Average savings
Ooooops!
Something went wrong!
You just saved more than
30 min
on total execution time!
Please revert! Proceed!
time
per scenario
Mocking: ~4 API calls (4 x 2 sec.) ~ 8 sec.
Animations: ~ 9 sec.
Deeplinking/Testlinkscreen: ~15 sec.
Currently 65 scenario’s
Average savings
))
Ooooops!
Something went wrong again!
Execution time on 4 parallel devices
in the cloud is only
15% higher
in comparison to local execution time
on 1 device. We expected more!
Please revert! Proceed!
time
per scenario
Mocking: ~4 API calls (4 x 2 sec.) ~ 8 sec.
Animations: ~ 9 sec.
Deeplinking/Testlinkscreen: ~15 sec.
Currently 65 scenario’s
Average savings
The app
The framework
Cross platform selectors
Mocking
animations
Magic
Next steps
Time
Pro’s and cons
Menu
Pro’s and cons
Pro’s
Increase quality
Speed up development
Test what really needs to be tested
Speed up execution time
Cons
No real services tested (automated)
App is not a production app
Developers often debug app for seeing
no animations.
(use the wrong build 7)
The app
The framework
Cross platform selectors
Mocking
animations
Magic
Next steps
Time
Pro’s and cons
Menu
I hope we have some time left, so are there any
questions?
Can you show everybody my contact details?
I hope we have some time left, so are there any
questions?
Thank you very much!
Sure!
Can you show everybody my contact details?
I hope we have some time left, so are there any
questions?
Thank you very much!
Sure!
Contact
8: Wim Selles - deTesters - Tele2
9: @wswebcreation
:: wswebcreation.nl
:: gitHub.com/wswebcreation
; Goodbye! ;

More Related Content

PDF
How to build an AngularJS backend-ready app WITHOUT BACKEND
PDF
Mp24: The Bachelor, a facebook game
ODP
OpenWebBeans/Web Beans
ODP
Non Conventional Android Programming En
PDF
Enabling agile devliery through enabling BDD in PHP projects
PDF
Stanfy MadCode Meetup #11: Why do you need to switch from Obj-C to Swift, or ...
PDF
java and javascript api dev guide
PDF
TDC 2015 - Metaprogramação na prática
How to build an AngularJS backend-ready app WITHOUT BACKEND
Mp24: The Bachelor, a facebook game
OpenWebBeans/Web Beans
Non Conventional Android Programming En
Enabling agile devliery through enabling BDD in PHP projects
Stanfy MadCode Meetup #11: Why do you need to switch from Obj-C to Swift, or ...
java and javascript api dev guide
TDC 2015 - Metaprogramação na prática

What's hot (20)

PPTX
Testing ASP.net Web Applications using Ruby
PDF
Desenvolva um game para android ou iPhone
PPT
JSF Custom Components
PDF
MAF push notifications
PPT
Developing in android
PDF
Flutter State Management Using GetX.pdf
PDF
Intro to computer vision in .net
PDF
Web driver selenium simplified
PPT
21 android2 updated
PDF
Build your first rpa bot using IBM RPA automation
PPT
Creating the interfaces of the future with the APIs of today
PPTX
Introduction to angular js for .net developers
PPTX
XCUITest for iOS App Testing and how to test with Xcode
PDF
Cutting the Fat
PDF
AngularJS 101
PPTX
Angularjs Live Project
PDF
Oracle MAF real life OOW.pptx
PPTX
Monetizing with PayPal on Mobile
PDF
Using API Platform to build ticketing system #symfonycon
PPT
OpenSocial Intro
Testing ASP.net Web Applications using Ruby
Desenvolva um game para android ou iPhone
JSF Custom Components
MAF push notifications
Developing in android
Flutter State Management Using GetX.pdf
Intro to computer vision in .net
Web driver selenium simplified
21 android2 updated
Build your first rpa bot using IBM RPA automation
Creating the interfaces of the future with the APIs of today
Introduction to angular js for .net developers
XCUITest for iOS App Testing and how to test with Xcode
Cutting the Fat
AngularJS 101
Angularjs Live Project
Oracle MAF real life OOW.pptx
Monetizing with PayPal on Mobile
Using API Platform to build ticketing system #symfonycon
OpenSocial Intro
Ad

Similar to How React Native Appium and me made each other shine (20)

PDF
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
PPTX
Telerik AppBuilder Presentation for TelerikNEXT Conference
PDF
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PDF
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
PDF
A gently introduction to AngularJS
PPTX
Code instrumentation
PDF
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
PDF
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
PPT
How to implement camera recording for USB webcam or IP camera in C#.NET
PPTX
Jenkins CI/CD setup for iOS in Mac OSX
KEY
Dancing with websocket
PDF
AI: Mobile Apps That Understands Your Intention When You Typed
PDF
Micro services from scratch - Part 1
PDF
Web versus Native: round 1!
PDF
Appium understanding document
PPTX
Social Gold in-Flash Webinar Jan 2010
PPTX
Social Gold In-Flash Payments Webinar
PPT
Week 8
PDF
Building Isomorphic Apps (JSConf.Asia 2014)
PPT
Introduction to java script Lecture 4.ppt
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
Telerik AppBuilder Presentation for TelerikNEXT Conference
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
A gently introduction to AngularJS
Code instrumentation
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless W...
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
How to implement camera recording for USB webcam or IP camera in C#.NET
Jenkins CI/CD setup for iOS in Mac OSX
Dancing with websocket
AI: Mobile Apps That Understands Your Intention When You Typed
Micro services from scratch - Part 1
Web versus Native: round 1!
Appium understanding document
Social Gold in-Flash Webinar Jan 2010
Social Gold In-Flash Payments Webinar
Week 8
Building Isomorphic Apps (JSConf.Asia 2014)
Introduction to java script Lecture 4.ppt
Ad

More from Wim Selles (6)

PDF
Builda responsivetypescriptwebdriverio framework
PDF
Node.JS: Do you know the dependency of your dependencies dependency
PDF
Building Your Own Native App Visual Testing Module with Appium
PDF
Building Your Own Native App Visual Testing Module with Appium
PDF
Testing beyond the default click-paths
PDF
Why the h# should I use Appium with React Native
Builda responsivetypescriptwebdriverio framework
Node.JS: Do you know the dependency of your dependencies dependency
Building Your Own Native App Visual Testing Module with Appium
Building Your Own Native App Visual Testing Module with Appium
Testing beyond the default click-paths
Why the h# should I use Appium with React Native

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPT
Teaching material agriculture food technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Cloud computing and distributed systems.
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
sap open course for s4hana steps from ECC to s4
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
MYSQL Presentation for SQL database connectivity
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Approach and Philosophy of On baking technology
20250228 LYD VKU AI Blended-Learning.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Empathic Computing: Creating Shared Understanding
Teaching material agriculture food technology
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Cloud computing and distributed systems.
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...
sap open course for s4hana steps from ECC to s4

How React Native Appium and me made each other shine

  • 1. The customer asked him: 
 Would you like to join our scrum team where you will be responsible for setting up an !-framework. You will be "-ing our new React Native app for all default scenarios. Sounds cool, doesn’t it? …there was a blue guy who ended up in a #tale Once upon a time $ He said:
 
 %, that sounds awesome and looks like a &. I’ve never worked with React Native but I do have JS and 'knowledge and I’m a quick (.
  • 2. Made each other 
 )) How , and
  • 3. The app The framework Cross platform selectors Mocking animations Magic Next steps Time Pro’s and cons Menu
  • 5. * + User interface After install , - onBoarding The app
  • 7. The app The framework Cross platform selectors Mocking animations Magic Next steps Time Pro’s and cons Menu
  • 8. Appium + Appium Desktop webdriver.io CucumberJS multiple-cucumber-html-report Amsterdam 2017 The framework Detox versus Appium London 2018
  • 9. The app The framework Cross platform selectors Mocking animations Magic Next steps Time Pro’s and cons Menu
  • 10. CP selectors AccessibilityLabels (98%) XPath (2%) HyBrid solution Testproperties Implementation Platform specific Code
  • 11. Testproperties /** * If we have a test build, add a unique test id for iOS and Android * * @param {string} id * * @return {object|*} */ function testProperties(id) { if (IS_AUTOMATION_BUILD) { return { accessibilityLabel: `test-${id}`, }; } return null; }
  • 12. Implementation import React, { Component } from 'react'; import { View } from ‘react-native'; import { testProperties } from './config/automation/TestProperties'; class MultipleChoice extends Component { // Some code render() { const { options } = this.props; return ( <View style={styles.container} {…testProperties('Select menu')} > // The select implementation </View> ); } }
  • 14. Platform specific function testProperties(id) { if (IS_AUTOMATION_BUILD) { if (IS_IOS) { return { testID: `test-${id}`, }; } return { accessibilityLabel: `test-${id}`, }; } return null; }
  • 16. CP selectors AccessibilityLabels (98%) XPath (2%) HyBrid solution Testproperties Implementation Platform specific Code
  • 17. The app The framework Cross platform selectors Mocking animations Magic Next steps Time Pro’s and cons Menu
  • 18. Mocking Why? Remove flakiness Fix inconsistent testdata problem Test errors / delays / edge cases Speed up manual and automated tests With ng-apimock How
  • 20. Mocking Why? Remove flakiness Fix inconsistent testdata problem Test errors / delays / edge cases Speed up manual and automated tests With ng-apimock How
  • 21. The app The framework Cross platform selectors Mocking animations Magic Next steps Time Pro’s and cons Menu
  • 22. Animations onBoarding Each bubble takes 500 ms to show Min 15 bubbles => 7,5 sec Max 25 bubbles => 12,5 sec Bubble delay is 800 ms Between 19 (15*800+7,5) and 32 sec (25*800+12,5) animations What?!
  • 23. Remove animations import { AppRegistry } from 'react-native'; import App from './app/App'; import { setupAutomation } from './app/config/automation/TestProperties'; // Run the automation setup setupAutomation(); AppRegistry.registerComponent('Tele2CustomerApp', () => App);
  • 24. Remove animations const stubs = require('stubs'); /** * Setup the app for a specific automation build */ function setupAutomation() { if (!IS_AUTOMATION_BUILD) { return; } // Disable the yellow box console.disableYellowBox = true; disableAnimations(); } /** * Disable all animations */ function disableAnimations() { const AnimatedTiming = Animated.timing; stubs(Animated, 'timing', (...props) => { props[1].duration = 0; props[1].delay = 0; return AnimatedTiming(...props); }); }
  • 25. Result Animations + real services No animation + mocking 15 sec!40 sec!
  • 26. Animations onBoarding Each bubble takes 500 ms to show Min 15 bubbles => 7,5 sec Max 25 bubbles => 12,5 sec Bubble delay is 800 ms Between 19 (15*800+7,5) and 32 sec (25*800+12,5) animations What?!
  • 27. The app The framework Cross platform selectors Mocking animations Magic Next steps Time Pro’s and cons Menu
  • 29. Behind onBoarding So…. Or , - Best test feature Or Do some Magic
  • 30. , - Best test feature Or Do some . magic? Magic with Magic
  • 31. . magic? Magic with / For 5 features Magic
  • 32. Implementation • Deeplinking with mocking to mock a user. • Deeplinking only on specific build types • Go to the feature directly • Saved another 20-30 seconds per scenario • First technical steps for deeplinking in production
  • 35. The app The framework Cross platform selectors Mocking animations Magic Next steps Time Pro’s and cons Menu
  • 37. Test strategy Real devices Platforms: iOS && Android Devices: High- && Mid- && Budget-range Platform tests: High && mid risk, proof only once All device tests: Hi risk, test on all With CucumberJS Tags How?
  • 38. CucumBerJS tags Feature: View invoices Background: Open account settings Given I launch the new awesome Tele2 app @os-specific Scenario: As an user I want to see my not paid and paid bills Given I'm logged in to open my invoices Then I would like to see my unpaid bills | text | | Januari 2018 € 359,02 Deze factuur wordt op 01 februari afgeschreven. | And I would like to see my paid bills | text | | December 2017 € 66,12 | | November 2017 € 112,12 | Scenario: As an user I want to be able to download or share my invoice Given I'm logged in to open my invoices When I select the first invoice Then I would see the PDF of the invoice When I press the download button Then the download and share options are shown
  • 39. CucumBerJS tags Feature: Onboarding Background: Open the app Given I launch the new awesome Tele2 app And I want to start with the onboarding @all-devices Scenario: As a customer I want to onboard with an existing MijnTele2 account When I select Jazeker! And I submit my credentials in the login form Then the pincode bubble would be visible When I submit valid pincodes And I agree with the terms and conditions Then I am redirected the home screen
  • 40. Test strategy Real devices Platforms: iOS && Android Devices: High- && Mid- && Budget-range Extensive tests: High && mid risk, proof only once Default tests: Hi risk, test on all With CucumberJS Tags How?
  • 44. Testlink screen import { StackNavigator } from 'react-navigation'; import TestLinkScreen from './TestLinkScreen'; /** * Create the test link stack if it's a mocked build * * @return {*} */ function testLinkStack() { if (MOCKED_ENVIRONMENTS.includes(ENVIRONMENT)) { return { TestLink: { screen: StackNavigator({ TestLink: TestLinkScreen, }), }, }; } return {}; }
  • 47. Reconsider mocking Not … each scenario on each ' … all '' have the same ⚡ … all '' start with same scenario at same ⏱ … same API response on all '' Prevent
  • 49. Ng-apimock Mockserver Post: api/version/login "Content-Type": "application/json", "Accept": “application/json" response: { "status": 200, "firstName": "Wim", "lastName": “Selles" }
  • 50. Ng-apimock Mockserver weBdriver.io PUT: headers: { 'Content-Type': ‘application/json' }, method: 'PUT', body: { identifier: 'token', scenario: 'unauthorised' }
  • 54. The idea Mockserver weBdriver.io PUT: headers: { 'Content-Type': ‘application/json’, ngapimockid: '51A82F08-CCAC-410F' }, method: 'PUT', body: { identifier: 'token', scenario: 'unauthorised' } IDFV: 51A82F08-CCAC-410F
  • 55. response: { "status": 401, “message": “unauthorised" } The idea Mockserver weBdriver.io PUT: headers: { 'Content-Type': ‘application/json’, ngapimockid: '51A82F08-CCAC-410F' }, method: 'PUT', body: { identifier: 'token', scenario: 'unauthorised' } IDFV: 51A82F08-CCAC-410F Post: api/version/login "Content-Type": "application/json", "Accept": “application/json”, ngapimockid: '51A82F08-CCAC-410F'
  • 56. response: { "status": 401, “message": “unauthorised" } The idea Mockserver weBdriver.io PUT: headers: { 'Content-Type': ‘application/json’, ngapimockid: '51A82F08-CCAC-410F' }, method: 'PUT', body: { identifier: 'token', scenario: 'unauthorised' } IDFV: 51A82F08-CCAC-410F Post: api/version/login "Content-Type": "application/json", "Accept": “application/json”, ngapimockid: '51A82F08-CCAC-410F'
  • 57. /** * This is a part from our `TestProperties`-file. */ import { getUniqueID } from 'react-native-device-info'; /** * If it is an automation build, then add a new header for the API calls * * @return {Object} * * For iOS it will return something like: FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9 * For Android it will return something like: dd96dec43fb81c97 */ function uniqueAutomationApiHeaderId() { if (IS_AUTOMATION_BUILD) { return { ngapimockid: getUniqueID(), }; } return {}; } app method
  • 58. /** * This is the config-file we use for calling all the API’s. * Below you will see a part of the config to attach the headers * to all API calls */ import { uniqueAutomationApiHeaderId } from './automation/TestProperties'; const apiConfig = create({ baseURL: BASE_URL, headers: { ...API_HEADERS, ...uniqueAutomationApiHeaderId(), }, }); Header
  • 62. /** * Executes the api call with the provided information. * * @param {string} httpMethod PUT|DELETE|POST|GET * @param {string} urlSuffix Which path to httpMethod the data to * @param {Object} options The data that needs to be httpMethod * @param {string} errorMessage The error that needs to be shown * * @return {Promise} The promise. * * @private */ function execute(httpMethod, urlSuffix, options, errorMessage) { const data = { headers: { 'Content-Type': 'application/json', ngapimockid: device.uniqueID, }, method: httpMethod, }; if (options !== undefined) { data.body = JSON.stringify(options); } return handleRequest(urlSuffix, data, errorMessage); } Set state headers: { 'Content-Type': ‘application/json’, ngapimockid: '51A82F08-CCAC-410F' }, method: 'PUT', body: { identifier: 'token', scenario: 'unauthorised' }
  • 63. response: { "status": 401, “message": “unauthorised" } Implementation Mockserver weBdriver.io PUT: headers: { 'Content-Type': ‘application/json’, ngapimockid: '51A82F08-CCAC-410F' }, method: 'PUT', body: { identifier: 'token', scenario: 'unauthorised' } IDFV: 51A82F08-CCAC-410F Post: api/version/login "Content-Type": "application/json", "Accept": “application/json”, ngapimockid: '51A82F08-CCAC-410F'
  • 64. Reconsider mocking Not … each scenario on each ' … all '' have the same ⚡ … all '' start with same scenario at same ⏱ … same API response on all '' Prevent
  • 67. ⚡4 execution / tests Focus on user experience 5 6 With Image compare Phase 3
  • 69. The app The framework Cross platform selectors Mocking animations Magic Next steps Time Pro’s and cons Menu
  • 70. time per scenario Mocking: ~4 API calls (4 x 2 sec.) ~ 8 sec. Animations: ~ 9 sec. Deeplinking/Testlinkscreen: ~15 sec. Currently 65 scenario’s Average savings
  • 71. time per scenario Mocking: ~4 API calls (4 x 2 sec.) ~ 8 sec. Animations: ~ 9 sec. Deeplinking/Testlinkscreen: ~15 sec. Currently 65 scenario’s Average savings Ooooops! Something went wrong! You just saved more than 30 min on total execution time! Please revert! Proceed!
  • 72. time per scenario Mocking: ~4 API calls (4 x 2 sec.) ~ 8 sec. Animations: ~ 9 sec. Deeplinking/Testlinkscreen: ~15 sec. Currently 65 scenario’s Average savings )) Ooooops! Something went wrong again! Execution time on 4 parallel devices in the cloud is only 15% higher in comparison to local execution time on 1 device. We expected more! Please revert! Proceed!
  • 73. time per scenario Mocking: ~4 API calls (4 x 2 sec.) ~ 8 sec. Animations: ~ 9 sec. Deeplinking/Testlinkscreen: ~15 sec. Currently 65 scenario’s Average savings
  • 74. The app The framework Cross platform selectors Mocking animations Magic Next steps Time Pro’s and cons Menu
  • 75. Pro’s and cons Pro’s Increase quality Speed up development Test what really needs to be tested Speed up execution time Cons No real services tested (automated) App is not a production app Developers often debug app for seeing no animations. (use the wrong build 7)
  • 76. The app The framework Cross platform selectors Mocking animations Magic Next steps Time Pro’s and cons Menu
  • 77. I hope we have some time left, so are there any questions?
  • 78. Can you show everybody my contact details? I hope we have some time left, so are there any questions? Thank you very much! Sure!
  • 79. Can you show everybody my contact details? I hope we have some time left, so are there any questions? Thank you very much! Sure! Contact 8: Wim Selles - deTesters - Tele2 9: @wswebcreation :: wswebcreation.nl :: gitHub.com/wswebcreation ; Goodbye! ;