Automated regression testing

While Apex and Lightning Web Components tests are very much key tools for monitoring regressions in your application, the limitations and scope of the functionality such tests can cover is small by design, since they are unit tests, not integration tests. Thus, they are not particularly suited to performing large data volume or full end-to-end user interface testing.

The preceding pipeline configuration creates only one scratch org with a given configuration. You can, of course, create scratch orgs of different types to perform different kinds of testing. At the time of writing, the Scratch Org Template feature is in Pilot. This allows you to customize your scratch orgs to pre-install other packages, test configurations, and data. This is ideal for creating a suite of test org templates, for example.

Here are some considerations for implementing further testing approaches:

  • It is possible to execute the Apex code from shell scripts using the approach described earlier in this chapter, when we populated the developer org with sample data by calling the SeasonService.createTestSeason method. You can extend this approach by using loop constructs within shell scripts to create volume data or start more Batch Apex jobs (Apex tests only permit a single chunk of 200 records to be processed), pause for completion, and assert the results.
  • The Salesforce Data Loader tool is actually a Java program with a command line interface. Thus, you could consider using it to load data into a build org to test against different datasets, used in combination with the preceding Apex code, executed to clean records between tests.
  • Once you have the data loaded into the build org, you can execute tests using a number of Salesforce testing tools. For example, the Selenium WebDriver tool is an excellent choice, as it provides a headless mode (no need for a physical screen) and can be run on multiple operating systems. This tool allows you to test Visualforce pages with large amounts of JavaScript (http://docs.seleniumhq.org/projects/webdriver/).

Having considered the regression testing approaches that you can explore, let's summarize what has been covered in this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.113.197