Salesforce Lightning Testing
Provar’s test cases are designed to run equally well in Classic and the new Lightning Experience.
Using Provar’s integration to Salesforce metadata, it is possible to build a test case in Classic and run it in Lightning, or build a test case in Lightning and run it in Classic. This is useful for organizations who are planning an upgrade path to Lightning, as running your Classic test cases in Lightning Mode and reviewing their execution can help assess your organization’s readiness for Lightning.
For a full introduction to testing in Lightning, take a look at our Lightning Testing module. This is a downloadable PDF guide intended to teach you some techniques for testing in Lightning and introduce some of the differences you should be aware of.
To execute test cases in Lightning, specify this against the test connection or an individual test case. After this, UI fields can be mapped as normal using the Test Builder, which will automatically identify fields the same way in Lightning UI as in the Classic UI. Page Objects are not required.
If functional behavior differs between Lightning and Classic, you can use logical conditions such as an If step to accommodate them within the same test case.
Running an individual test case in Lightning
You can set an individual test case to run in Lighting even if Lightning is not enabled for a Connection.
To do this, open your test case and click into the Salesforce Connect test step. Locate the ‘Lightning Mode Override’ dropdown within Advanced Settings, and set this to ‘Enable’:
Using ‘Enable’ will launch this test case in Lightning mode regardless of the mode specified on the connection.
Conversely, if a connection is enabled for Lightning, but you want to run a test case in Classic mode, set the ‘Lightning Mode Override’ option to ‘Disable’:
Then save the test case.
Salesforce Lightning Design System (SLDS) Support
As of Version 1.9, Provar has enhanced support for the testing of Visualforce pages, Custom Lightning Components or any other Salesforce page that use the Salesforce Lightning Design System (SLDS). This is done by providing a new By SLDS Label locator for the page fields.
The Salesforce Lightning Design System enables you to build rich enterprise experiences and custom applications with the patterns and established best practices that are native to Salesforce.
Salesforce provides a standard mechanism for how the elements need to be added in a form for the Lightning Design System. These are applicable for Visualforce or any other Salesforce page in both Classic and Lightning Experience.
The ‘By Label’ in Provar has been enhanced to support this design system. When testing a Salesforce page that has been developed within SLDS guidelines, the Test Builder will suggest the new By SLDS Label when mapping the page’s fields. These will work in both Read and Edit modes.
When added in a Page Object, it will appear as follows:
@FindByLabel(label="Input Label", labelType=LabelType.SalesforceLightningDesignSystem) public WebElement inputElement;
In Lightning Experience
In Provar Desktop Page Object Editor
In Java Source
Custom Lighting Components with Embedded Tables
As of ver. 1.9, Provar supports the testing of Custom Lightning Components with embedded tables where each row is a Lightning Component nested within an <aura:iteration> base component.
An example is the Edit Products component below which has a custom table showing opportunity product rows.
This appears as follows in the Test Builder.
In this example we are mapping the first Product in the table, ‘PV-Fixed-12-Provar Fixed License (12 months)’, and are updating the Product name value:
Note that Provar has recognized the embedded table automatically in the Page Structure.
We can update other values on the same row, such as Quantity, by adding additional steps:
Note that this additional step is using the same On Screen and With Row test steps as the first step.
These steps appear in Provar Desktop as follows.
On Screen test step:
Test step updating the Product name value:
Provar will automatically generate two Page Objects for this scenario, one with the table information and the other with column information.
Page Object with table information.
Page Object with row information.
Quick Actions in Header Components
Provar now supports the mapping of Quick Actions in the header component of app page FlexiPages in Lightning. This includes both layout-specific Quick Actions and Global Quick Actions.
What are Quick Actions?
Quick Actions enable users to do more in Salesforce and in the Salesforce mobile app. With custom quick actions, you can make your users’ navigation and workflow as smooth as possible by giving them convenient access to information that’s most important. Salesforce provides both object-specific Quick Actions and global Quick Actions. Refer to Quick Actions in Salesforce help for more information.
Quick Actions in Provar
In Provar, header buttons are mapped as standard Quick Action Flexi Components. The same is true for Quick Actions in a dropdown list; they will also be mapped as Quick Action Flexi Components.
Until now, Provar has treated Quick Actions as Object-Specific, but now in Lightning it is possible to have a Quick Action independently, either through an App Page header or in Global Actions with and in the page header.
Example 1: Mapping Quick Task on a Header Component
Below is an example of Provar mapping the Quick Task button, which is a Global Quick Action on a header component.
Note that there are two buttons, Quick Task and Quick Lead.
When the Quick Task button is mapped, the following step appears in Test Builder:
Below are the same test steps in Provar Desktop.
This is the On Screen test step:
Note that the Quick Task button has its Flexi Component set to the Quick Action List, which is where both the Quick Task button and the Quick Lead buttons are positioned.
Both Quick Actions, Quick Task and Quick Lead, are available in the Control List for the Quick Action Menu:
Once the Quick Task dialogue box appears, elements can be mapped, such as the Subject being set to Call:
Note that the page is recognized as a Salesforce Layout. The page used will be Salesforce [ActionName] Quick Action screen, where [ActionName] is the name of the Quick Action being mapped.
Clicking the Add & Do button on this test step will display the following:
In Provar Desktop the On Screen test step will display as follows:
Note that the Screen Type has been set to Salesforce Publisher Actions, which is a new option.
Clicking on the Publisher action parameter below Screen Type will reveal a list of all Quick Actions available in the org:
If the Quick Action selected is Visualforce or a Lightning Component, the relevant Page Object will also be displayed.
The TargetUrl would be as follows:
Finally, note that the Navigate parameter is set to Don’t Navigate.
When the Quick Action is in a header component, Provar does not have enough information to support a direct navigation to the action. For this reason, you should always ensure that Don’t Navigate is chosen and that the preceding steps in the test will navigate the user to the correct point.
Below is the final test step as it appears in Provar Desktop.
And the same test step in Test Runner.
Example 2: Mapping Quick Lead on a Header Component
Follow the same approach as above to map the Quick Lead button in Test Builder.
Once the Quick Task dialogue appears, map the Salutation picklist field.
Note that the page is recognized as a Salesforce Layout and the page used is Salesforce [QuickLead] Quick Action screen, where ‘QuickLead’ is the name of the Quick Action being mapped.
Click the Add & Do button on this test step and map any additional required fields, then map the Save button.
Clicking the Add & Do button on this test step will display the following in Test Builder.
And in Provar Desktop.
And in Test Runner.
As of 1.9.4, Provar now supports the mapping of Global Actions in Lightning from the Global Actions (‘+’) button.
When Global Actions are enabled in Lightning, they appear in the application context at the top-right of the screen when the Global Actions (‘+’) button is clicked.
Once an action is selected from the list, it is rendered as a non-modal pop-up overlay from the bottom of the screen. These pop-ups remain open on the screen while navigating around Salesforce, and you can have multiple open at once.
Note that this behavior is different to how actions are normally rendered, as modal overlays in the center of the screen which need to be closed before the user can continue other activities.
In the example below, we have clicked the Log a Call Quick Action from the Global Actions list seen above. This step is mapping the Subject field in Test Builder.
Note that the screen is recognized automatically as the ‘Log a Call’ Quick Action.
The On Screen test step appears as follows in Provar Desktop.
And in Test Runner.
Other fields on the Quick Action are also recognized automatically.
Note that Provar has a known limitation that it is not possible to test multiple Global Actions for the same action simultaneously. This means that, if you have 2 ‘Log a Call’ actions open at the same time, Provar can only interact with the first one it finds.
Lightning Path Component
As of 1.9.4, Provar now supports the testing of Salesforce’s Lightning Path Component. Provar supports both standard paths and paths on custom objects.
Example 1: Standard Path (Lead)
Below is an example test step mapping a Path step on a Lead detail page.
Note that various options are provided in the dropdown.
And in Provar Desktop.
Provar can also perform actions on the Path’s key fields, such as Inline Edit.
Below is the UI On Screen test step in Provar Desktop.
And Test Runner.
Example 2: Custom Path
Provar also supports the testing of paths on custom objects.
The process for mapping custom paths is the same, but these will show a Screen Type of SF Flexipage Lightning Component. This is different from standard paths, which have a Screen Type of Salesforce Object.
Below is the UI On Screen test step in Provar Desktop:
Guided Action Lists
As of Provar 1.9.7, Provar supports testing of Salesforce’s Guided Action List Component. The Guided Action List allows user to accomplish required tasks in a guided manner using Lightning Flows. Refer to Lightning Flow for Service and the Guided Action List Component for more information.
Provar will recognize Guided Action List Components automatically and map them as a standard Flexi Component. Flows on the Actions tab can be mapped as follows using the Flow name.
Provar also supports the ‘View Action’ and ‘Remove’ buttons on a given flow.
Provar can also Read/Assert the number of flows available in the list and/or extract the list of all the available flows:
Provar can also Read/Assert information under the History tab, as below. (Note that mapping of the ‘Actions’ or ‘History’ tab is not required as Provar will manage this navigation automatically.)
Below is an example test in Test Builder.
And in Provar Desktop
As of Version 1.9.8, Provar supports intelligent testing of the Lightning Utility Bar with the ability to automatically recognise when you map an element in the Utility Bar without creating your own Page Object. This is currently supported for Recent Items, Rich Text, List View and Visualforce components. Other components in Utility Bar can be mapped as Page Objects.
Testing in the Lightning Utility Bar
To test a component in the Lightning Utility Bar, click on the component to open it and then map the target element. Provar will automatically recognize the component as a Flexi Component.
Once the test step is mapped, it will appear as follows in Test Builder:
Note that the Flexi Component has been recognized automatically as Recent Items.
Opening and Closing Components
In general it is not necessary to add a test step to open a component in the Utility bar. When you map an element inside a component, Provar will recognize the component as a Flexi Component and open it automatically before executing the next step. Check that the On Screen test step is set to ‘Always Navigate’ to make sure this happens.
To close a component in the utility bar, map the ‘_’ link at the top of the component and add this as a test step.
As of Version 1.9.8, Provar supports the Recent Item component, Rich Text, List View and Visualforce components. Other components in Utility Bar can be mapped as Page Objects.
There are some limitations to Provar’s support for these components:
- For Recent Item components, column assertions are not supported.
- For List View components, column assertions and row count assertions are not supported.
For more information or advice on these limitations please contact Provar support directly.
- General information
- Licensing Provar
- Provar trial guide and extensions
- Using Provar
- API testing
- Behavior-driven development
- Creating and importing projects
- Creating test cases
- Custom table mapping
- Debugging tests
- Defining a namespace prefix on a connection
- Defining proxy settings
- Environment management
- Exporting test cases into a PDF
- Exporting test projects
- Managing test steps
- Namespace org testing
- Provar desktop
- Provar Test Builder
- Refresh and Recompile
- Reload Org Cache
- Running tests
- Searching Provar with find usages
- Secrets management and encryption
- Setup and teardown test cases
- Tags and Service Level Agreements (SLAs)
- Test cycles
- Test plans
- Testing browser options
- Tooltip testing
- Using the Test Palette
- Test Palette introduction
- Control test steps
- List compare
- Read test step
- String test steps
- UI Test Steps
- Using custom APIs
- Callable tests
- Data-driven testing
- Page objects
- Applications testing
- Database testing
- Document testing
- Email testing
- Mobile testing
- OrchestraCMS Testing
- Salesforce CPQ testing
- ServiceMax testing
- Skuid testing
- Vlocity testing
- Webservices testing
- Introduction to test scheduling
- Apache Ant
- Configuration for sending emails via the Provar Command Line Interface (CLI)
- Continuous integration
- Azure DevOps
- Running a Provar CI task in Azure DevOps
- Configuring the Provar secrets password in Microsoft Azure Pipelines
- Parallel execution in Microsoft Azure Pipelines using multiple build.xml files
- Parallel execution in Microsoft Azure Pipelines using targets
- Parallel execution in Microsoft Azure Pipelines using Test Plans
- Bitbucket Pipelines
- Circle CI
- GitLab CI
- Travis CI
- Parallel Execution
- Running Provar on Linux
- Salesforce DX
- Team foundation server
- Version control
- Zephyr Cloud and Server (Beta)
- Salesforce testing
- Adding a Salesforce connection
- Assert Page Error Messages on Add/Edit Product
- Internationalization support
- List and table testing
- Salesforce Release Updates
- Salesforce Lightning Testing
- Salesforce Lightning Web Component (LWC) locator support
- Service Cloud console testing
- Visualforce Testing
- Testing best practices
- Configurations and permissions
- Error messages
- Licensing, installation and firewalls
- Test Builder and test cases
- Release notes