Automated regression testing

While Apex tests are very much a key tool in monitoring regressions in your application, the limitations and scope of functionality they can test is small, particularly to perform volume or user interface testing (clients using JavaScript for example).

Note

You might wonder why the Ant script used by Jenkins deploys twice, as the check deploy to the packaging org will confirm whether the Apex code compiles and that all Apex tests complete successfully. The reason is that having the build org deployed with the latest build allows for it to go on to be used for other purposes, such as executing further regression testing steps.

Here are some considerations to implement further testing approaches:

  • It is possible to execute the Apex code from the Ant 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 Ant 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/).
..................Content has been hidden....................

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