SlideShare una empresa de Scribd logo
1 de 11
Test your lightning
components using
Lightning Testing Service
- Rahul Malhotra
About Me
 Software Engineer Trainee & a part of Center of
Excellence Team at SaaSfocus
 Independent Salesforce Consultant
 Blogger and YouTuber at SFDC Stop
Today’s Agenda
 Need of testing our Lightning Component
 Introduction to Lightning Testing Service
 Jasmine & Mocha – Understanding syntax
 Live Demo - Lightning Testing Service
 Considerations for Lightning Testing Service
 Available resources to learn LTS
 Q & A
Need for Testing Lightning Components
 With the introduction of Salesforce Lightning, we started to keep data at the
client side
 This approach is necessary to reduce the number of server calls and provide a
rich User Experience to customer
 Salesforce introduced methods and actions to promote storing data at client
side cache to reduce server calls. For Ex:- Storable Actions
 This made our lightning components more responsible for handling data
 To make sure our application or component work properly with different
variety of input data, testing is important
Lightning Testing Service – An
Introduction
 Lightning Testing Service (LTS) is a set of tools and services that let you create
test suites for your lightning components using standard JavaScript
frameworks, such as Jasmine and Mocha
 At present, Salesforce provides wrappers for Jasmine and Mocha testing
framework however if you like any other framework, you can write a wrapper
for it too by yourself
 LTS provides utilities specific to lightning component framework to test
behavior specific to lightning components
 You can install LTS using Salesforce DX commands or it is also available as an
unmanaged package. You can find the latest releases of LTS on the releases
page on GitHub and install directly from there
Jasmine & Mocha – Understanding Syntax
/**
* This is a 'hello world' Jasmine test spec
*/
describe("A simple passing test",
function() {
it("checks that true is always true",
function() {
expect(true).toBe(true);
});
});
/**
* This is a 'hello world' Mocha test
*/
var assert = require('assert');
describe('Test the nature of truth',
function() {
describe('A simple passing test', function() {
it('checks that true is always true',
function() {
assert.equal(true, true);
});
});
});
Jasmine Mocha
It’s Time to Code
Considerations for Lightning Testing
Service
 Data inserted in the org while testing is not rolled back or deleted
automatically
 In some scenarios, you have to make changes in your existing lightning
component to make it ready to be used for testing
 Presently, Salesforce has provided wrappers for Jasmine and Mocha
Framework however, if you want to use any other testing framework, you are
free to use it but you have to write your own wrapper for that.
Resources
 Documentation:- https://forcedotcom.github.io/LightningTestingService/
 GitHub Repository:- https://github.com/forcedotcom/LightningTestingService
 Salesfoce Blog:- https://developer.salesforce.com/blogs/2018/04/getting-
started-with-the-lightning-testing-service.html
 SFDC Stop:- https://sfdcstop.blogspot.com/2018/05/lightningtestingservice.html
Q & A
Thank You
 GitHub Repository Link:-
https://github.com/rahulmalhotra/LightningTestingService
 My Twitter Handle:- @rahulcoder
 Blog:- https://sfdcstop.blogspot.com
 YouTube Channel:- https://www.youtube.com/c/SFDCStop
 Salesforce Chatter:- http://bit.ly/rahulforce

Más contenido relacionado

La actualidad más candente

Modular application development using unlocked packages
Modular application development using unlocked packagesModular application development using unlocked packages
Modular application development using unlocked packagesAmit Chaudhary
 
Salesforce Apex Hours: What means Winter 18 for Developers
Salesforce Apex Hours: What means Winter 18 for Developers Salesforce Apex Hours: What means Winter 18 for Developers
Salesforce Apex Hours: What means Winter 18 for Developers Amit Chaudhary
 
Everybody loves Swagger
Everybody loves SwaggerEverybody loves Swagger
Everybody loves SwaggerBizTalk360
 
MuleSoft certified platform architect-level 1 Real Exam Questions
MuleSoft certified platform architect-level 1 Real Exam QuestionsMuleSoft certified platform architect-level 1 Real Exam Questions
MuleSoft certified platform architect-level 1 Real Exam Questionsdouglascarnicelli
 
Mule Salesforce Connector
Mule Salesforce ConnectorMule Salesforce Connector
Mule Salesforce ConnectorAnkush Sharma
 
Owin and-katana-overview
Owin and-katana-overviewOwin and-katana-overview
Owin and-katana-overviewsonia merchant
 
The Most Common Errors That Aren’t Caught
The Most Common Errors That Aren’t CaughtThe Most Common Errors That Aren’t Caught
The Most Common Errors That Aren’t CaughtNordic APIs
 
How Secure is Your API?
How Secure is Your API?How Secure is Your API?
How Secure is Your API?Mary Joy Sabal
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing MicroservicesAnil Allewar
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople
 
From AUI to Atlaskit - Streamlining Development for Server & Cloud Apps
From AUI to Atlaskit - Streamlining Development for Server & Cloud AppsFrom AUI to Atlaskit - Streamlining Development for Server & Cloud Apps
From AUI to Atlaskit - Streamlining Development for Server & Cloud AppsAtlassian
 
Develop a Basic REST API from Scratch Using TDD with Val Karpov
Develop a Basic REST API from Scratch Using TDD with Val KarpovDevelop a Basic REST API from Scratch Using TDD with Val Karpov
Develop a Basic REST API from Scratch Using TDD with Val KarpovMongoDB
 
Lightning component testing with jasmine
Lightning component testing with jasmineLightning component testing with jasmine
Lightning component testing with jasmineNitesh Singh
 
Fed London - January 2015
Fed London - January 2015Fed London - January 2015
Fed London - January 2015Phil Leggetter
 
Emulators as an Emerging Best Practice for API providers
Emulators as an Emerging Best Practice for API providersEmulators as an Emerging Best Practice for API providers
Emulators as an Emerging Best Practice for API providersPostman
 
Provar webinar 15-03-2018
Provar webinar 15-03-2018Provar webinar 15-03-2018
Provar webinar 15-03-2018Geraint Waters
 
Creating a custom connector in mule
Creating a custom connector in muleCreating a custom connector in mule
Creating a custom connector in muleAchyuta Lakshmi
 
Mockingbird – mock api
Mockingbird – mock apiMockingbird – mock api
Mockingbird – mock apiSagar Rao
 
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...Postman
 

La actualidad más candente (19)

Modular application development using unlocked packages
Modular application development using unlocked packagesModular application development using unlocked packages
Modular application development using unlocked packages
 
Salesforce Apex Hours: What means Winter 18 for Developers
Salesforce Apex Hours: What means Winter 18 for Developers Salesforce Apex Hours: What means Winter 18 for Developers
Salesforce Apex Hours: What means Winter 18 for Developers
 
Everybody loves Swagger
Everybody loves SwaggerEverybody loves Swagger
Everybody loves Swagger
 
MuleSoft certified platform architect-level 1 Real Exam Questions
MuleSoft certified platform architect-level 1 Real Exam QuestionsMuleSoft certified platform architect-level 1 Real Exam Questions
MuleSoft certified platform architect-level 1 Real Exam Questions
 
Mule Salesforce Connector
Mule Salesforce ConnectorMule Salesforce Connector
Mule Salesforce Connector
 
Owin and-katana-overview
Owin and-katana-overviewOwin and-katana-overview
Owin and-katana-overview
 
The Most Common Errors That Aren’t Caught
The Most Common Errors That Aren’t CaughtThe Most Common Errors That Aren’t Caught
The Most Common Errors That Aren’t Caught
 
How Secure is Your API?
How Secure is Your API?How Secure is Your API?
How Secure is Your API?
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
 
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORKSpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
SpringPeople Building Web Sites with ASP.NET MVC FRAMEWORK
 
From AUI to Atlaskit - Streamlining Development for Server & Cloud Apps
From AUI to Atlaskit - Streamlining Development for Server & Cloud AppsFrom AUI to Atlaskit - Streamlining Development for Server & Cloud Apps
From AUI to Atlaskit - Streamlining Development for Server & Cloud Apps
 
Develop a Basic REST API from Scratch Using TDD with Val Karpov
Develop a Basic REST API from Scratch Using TDD with Val KarpovDevelop a Basic REST API from Scratch Using TDD with Val Karpov
Develop a Basic REST API from Scratch Using TDD with Val Karpov
 
Lightning component testing with jasmine
Lightning component testing with jasmineLightning component testing with jasmine
Lightning component testing with jasmine
 
Fed London - January 2015
Fed London - January 2015Fed London - January 2015
Fed London - January 2015
 
Emulators as an Emerging Best Practice for API providers
Emulators as an Emerging Best Practice for API providersEmulators as an Emerging Best Practice for API providers
Emulators as an Emerging Best Practice for API providers
 
Provar webinar 15-03-2018
Provar webinar 15-03-2018Provar webinar 15-03-2018
Provar webinar 15-03-2018
 
Creating a custom connector in mule
Creating a custom connector in muleCreating a custom connector in mule
Creating a custom connector in mule
 
Mockingbird – mock api
Mockingbird – mock apiMockingbird – mock api
Mockingbird – mock api
 
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...
Postman for Efficient Professional Services: Collaboration, Mocking Dependenc...
 

Similar a Lightning Testing Service

Introduction to Lightning Testing Service
Introduction to Lightning Testing ServiceIntroduction to Lightning Testing Service
Introduction to Lightning Testing ServiceCloud Analogy
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patternsukdpe
 
Using state-engine-as-sca-component-final
Using state-engine-as-sca-component-finalUsing state-engine-as-sca-component-final
Using state-engine-as-sca-component-finalGuido Schmutz
 
Javascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsJavascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsSalesforce Developers
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Codemotion
 
Unit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJSUnit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJSKnoldus Inc.
 
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonSoft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonDavid O'Dowd
 
Mule ESB - Mock Salesforce Interface
Mule ESB - Mock Salesforce InterfaceMule ESB - Mock Salesforce Interface
Mule ESB - Mock Salesforce Interfacekrishananth
 
How to RightScale-Enable Your Images
How to RightScale-Enable Your ImagesHow to RightScale-Enable Your Images
How to RightScale-Enable Your ImagesRightScale
 
Munit junit test case
Munit junit test caseMunit junit test case
Munit junit test caseprudhvivreddy
 
Coldbox developer training – session 4
Coldbox developer training – session 4Coldbox developer training – session 4
Coldbox developer training – session 4Billie Berzinskas
 
Declarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi styleDeclarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi styleFelix Meschberger
 
Real-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsReal-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsDevin Bost
 
## Introducing a reactive Scala-Akka based system in a Java centric company
## Introducing a reactive Scala-Akka based system in a Java centric company## Introducing a reactive Scala-Akka based system in a Java centric company
## Introducing a reactive Scala-Akka based system in a Java centric companyMilan Aleksić
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Servicesmattjive
 

Similar a Lightning Testing Service (20)

Introduction to Lightning Testing Service
Introduction to Lightning Testing ServiceIntroduction to Lightning Testing Service
Introduction to Lightning Testing Service
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patterns
 
Using state-engine-as-sca-component-final
Using state-engine-as-sca-component-finalUsing state-engine-as-sca-component-final
Using state-engine-as-sca-component-final
 
Javascript-heavy Salesforce Applications
Javascript-heavy Salesforce ApplicationsJavascript-heavy Salesforce Applications
Javascript-heavy Salesforce Applications
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
 
Unit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJSUnit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJS
 
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonSoft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
 
Mule ESB - Mock Salesforce Interface
Mule ESB - Mock Salesforce InterfaceMule ESB - Mock Salesforce Interface
Mule ESB - Mock Salesforce Interface
 
How to RightScale-Enable Your Images
How to RightScale-Enable Your ImagesHow to RightScale-Enable Your Images
How to RightScale-Enable Your Images
 
Terracotta DSO
Terracotta DSOTerracotta DSO
Terracotta DSO
 
Munit junit test case
Munit junit test caseMunit junit test case
Munit junit test case
 
Jmeter From Scratch
Jmeter From ScratchJmeter From Scratch
Jmeter From Scratch
 
Coldbox developer training – session 4
Coldbox developer training – session 4Coldbox developer training – session 4
Coldbox developer training – session 4
 
Declarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi styleDeclarative Services Dependency Injection OSGi style
Declarative Services Dependency Injection OSGi style
 
Angular Unit Testing
Angular Unit TestingAngular Unit Testing
Angular Unit Testing
 
Real-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsReal-World Pulsar Architectural Patterns
Real-World Pulsar Architectural Patterns
 
J Meter Intro
J Meter IntroJ Meter Intro
J Meter Intro
 
JMeter Intro
JMeter IntroJMeter Intro
JMeter Intro
 
## Introducing a reactive Scala-Akka based system in a Java centric company
## Introducing a reactive Scala-Akka based system in a Java centric company## Introducing a reactive Scala-Akka based system in a Java centric company
## Introducing a reactive Scala-Akka based system in a Java centric company
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
 

Último

Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 

Último (20)

Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 

Lightning Testing Service

  • 1. Test your lightning components using Lightning Testing Service - Rahul Malhotra
  • 2. About Me  Software Engineer Trainee & a part of Center of Excellence Team at SaaSfocus  Independent Salesforce Consultant  Blogger and YouTuber at SFDC Stop
  • 3. Today’s Agenda  Need of testing our Lightning Component  Introduction to Lightning Testing Service  Jasmine & Mocha – Understanding syntax  Live Demo - Lightning Testing Service  Considerations for Lightning Testing Service  Available resources to learn LTS  Q & A
  • 4. Need for Testing Lightning Components  With the introduction of Salesforce Lightning, we started to keep data at the client side  This approach is necessary to reduce the number of server calls and provide a rich User Experience to customer  Salesforce introduced methods and actions to promote storing data at client side cache to reduce server calls. For Ex:- Storable Actions  This made our lightning components more responsible for handling data  To make sure our application or component work properly with different variety of input data, testing is important
  • 5. Lightning Testing Service – An Introduction  Lightning Testing Service (LTS) is a set of tools and services that let you create test suites for your lightning components using standard JavaScript frameworks, such as Jasmine and Mocha  At present, Salesforce provides wrappers for Jasmine and Mocha testing framework however if you like any other framework, you can write a wrapper for it too by yourself  LTS provides utilities specific to lightning component framework to test behavior specific to lightning components  You can install LTS using Salesforce DX commands or it is also available as an unmanaged package. You can find the latest releases of LTS on the releases page on GitHub and install directly from there
  • 6. Jasmine & Mocha – Understanding Syntax /** * This is a 'hello world' Jasmine test spec */ describe("A simple passing test", function() { it("checks that true is always true", function() { expect(true).toBe(true); }); }); /** * This is a 'hello world' Mocha test */ var assert = require('assert'); describe('Test the nature of truth', function() { describe('A simple passing test', function() { it('checks that true is always true', function() { assert.equal(true, true); }); }); }); Jasmine Mocha
  • 8. Considerations for Lightning Testing Service  Data inserted in the org while testing is not rolled back or deleted automatically  In some scenarios, you have to make changes in your existing lightning component to make it ready to be used for testing  Presently, Salesforce has provided wrappers for Jasmine and Mocha Framework however, if you want to use any other testing framework, you are free to use it but you have to write your own wrapper for that.
  • 9. Resources  Documentation:- https://forcedotcom.github.io/LightningTestingService/  GitHub Repository:- https://github.com/forcedotcom/LightningTestingService  Salesfoce Blog:- https://developer.salesforce.com/blogs/2018/04/getting- started-with-the-lightning-testing-service.html  SFDC Stop:- https://sfdcstop.blogspot.com/2018/05/lightningtestingservice.html
  • 10. Q & A
  • 11. Thank You  GitHub Repository Link:- https://github.com/rahulmalhotra/LightningTestingService  My Twitter Handle:- @rahulcoder  Blog:- https://sfdcstop.blogspot.com  YouTube Channel:- https://www.youtube.com/c/SFDCStop  Salesforce Chatter:- http://bit.ly/rahulforce