Salesforce Lightning Testing
Automation’s test cases are designed to run equally well in Classic and the Lightning Experience.
Using Automation’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 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.
Look at our Lightning Testing module for a full introduction to testing in Lightning. This downloadable PDF guide is intended to teach you some techniques for testing in Lightning and introduce some of the differences you should be aware of.
Setup
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 usual using the Test Builder, automatically identifying 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 on 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 testing Visualforce pages, Custom Lightning Components, or any other Salesforce page that uses 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 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 apply to Visualforce or any other Salesforce page in Classic and Lightning Experience.
The ‘By Label’ in Provar has been enhanced to support this design system. When testing a Salesforce page 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;
- Provar Automation
- Installing Provar Automation
- Updating Provar Automation
- Using Provar Automation
- API testing
- Behavior-driven development
- Creating and importing projects
- Creating test cases
- Custom table mapping
- Functions
- Debugging tests
- Defining a namespace prefix on a connection
- Defining proxy settings
- Environment management
- Exporting test cases into a PDF
- Exporting test projects
- Override auto-retry for Test Step
- Managing test steps
- Namespace org testing
- NitroX
- Provar desktop
- Provar Test Builder
- Refresh and Recompile
- Reintroduction of CLI license Check
- Reload Org Cache
- Reporting
- 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
- Using custom APIs
- Callable tests
- Data-driven testing
- Page objects
- Block locator strategies
- Introduction to XPaths
- Creating an XPath
- JavaScript locator support
- Label locator strategies
- Maintaining page objects
- Mapping non-Salesforce fields
- Page object operations
- ProvarX™
- Refresh and reselect field locators in Test Builder
- Using Java method annotations for custom objects
- Applications testing
- DevOps
- Introduction to test scheduling
- Apache Ant
- Configuration for Sending Emails via the Automation Command Line Interface
- Continuous integration
- AutoRABIT Salesforce DevOps in Provar Test
- Azure DevOps
- Running a Provar CI Task in Azure DevOps Pipelines
- Configuring the Automation 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
- CircleCI
- Copado
- Docker
- Flosum
- Gearset DevOps CI/CD
- GitHub Actions
- Integrating GitHub Actions CI to Run Automation CI Task
- Remote Trigger in GitHub Actions
- Parameterization using Environment Variables in GitHub Actions
- Parallel Execution in GitHub Actions using Multiple build.xml Files
- Parallel Execution in GitHub Actions using Targets
- Parallel Execution in GitHub Actions using Test Plan
- Parallel Execution in GitHub Actions using Job Matrix
- GitLab Continuous Integration
- Travis CI
- Jenkins
- Execution Environment Security Configuration
- Provar Jenkins Plugin
- Parallel Execution
- Running Provar on Linux
- Reporting
- Salesforce DX
- Git
- Team Foundation Server
- Version control
- Provar Automation trial guide and extensions
- Salesforce Testing
- Provar Manager
- Best Practices
- Troubleshooting
- Release Notes