Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lightning Component Testing with Jasmine Jasmine is a behaviour-driven development framework - that is used for the purpose of testing Javascript code.

Similar presentations


Presentation on theme: "Lightning Component Testing with Jasmine Jasmine is a behaviour-driven development framework - that is used for the purpose of testing Javascript code."— Presentation transcript:

1 Lightning Component Testing with Jasmine Jasmine is a behaviour-driven development framework - that is used for the purpose of testing Javascript code. cloud.analogy info@cloudanalogy.com +1(415)830-3899

2 What are the Advantages ? Some advantages that Jasmine offers are: ● It is built easy to set up and it is possible to set up in any scenario ● It has no requirement for DOM ● It has no dependency on any other Javascript framework ● It helps to write tests in easy steps because it comes with clean syntax cloud.analogy info@cloudanalogy.com +1(415)830-3899

3 cloud.analogy info@cloudanalogy.com +1(415)830-3899 What is lightning Test Services? Salesforce has come with a new concept Lightning Test Services(LTS). LTS is a set of tools and services - that create test suites for these Lightning components. It helps in the validation of the client-side behaviour of these components.

4 cloud.analogy info@cloudanalogy.com +1(415)830-3899 You can install LTS in your Salesforce org in the following two ways: ● As an unmanaged package ● Install LTS by using a command in Salesforce Developer Experience(SFDX)

5 cloud.analogy info@cloudanalogy.com +1(415)830-3899 Steps to follow for installing Jasmine We need to follow the following steps for installing Jasmine and use it for further testing the Lightning components 1. Installation of Jasmine with the above SFDX command: sfdx force:lightning:test:install

6 cloud.analogy info@cloudanalogy.com +1(415)830-3899 2. Once the installation is completed, you can start to navigate in your browser - so as to open the Jasmine test runner page. sfdx force:org:open -p /c/jasmineTests.app 3. Next, Lightning component is to be used by Lightning Test Service (LTS).

7 cloud.analogy info@cloudanalogy.com +1(415)830-3899 4. Now we need to create a Javascript file containing Jasmine test method and upload it as a static resource. 5. This static resource then gets uploaded in Salesforce named as JasmineTestDatatable. The reference to this app has to be added to the static resource in JasmineTests.app.

8 cloud.analogy info@cloudanalogy.com +1(415)830-3899 6. Finally, the Jasmine Test Runner is opened with the following URL. https://.lightning.force.com/c/jasm ineTests.app. This will show the output of the testing in the form of which test passed and which of the tests failed. It also displays the pass and fail percentages.

9 cloud.analogy info@cloudanalogy.com +1(415)830-3899 7. Also the SFDX commands can be used to create a Lightning test with a basic template, by using the following commands: Sfdx:force:lightning:test:create

10 Thank You cloud.analogy info@cloudanalogy.com +1(415)830-3899


Download ppt "Lightning Component Testing with Jasmine Jasmine is a behaviour-driven development framework - that is used for the purpose of testing Javascript code."

Similar presentations


Ads by Google