Sencha Ext JS 7.7 is Here – Discover What’s New and Exciting – LEARN MORE

Continuous Delivery with Sencha Test

July 7, 2016 110 Views
Show

Organizations benefit greatly by having an end-to-end automation process. True DevOps is achieved when development, testing, and operations are in sync, and the whole process is fully automated.

Many development teams avoid test automation because they feel that writing and automating tests slows development velocity. The problem is usually due to siloed tools making it difficult to integrate tests into the source control repository, execute them through the build and continuous integration systems, and easily recognize and act on testing failures. Until teams can incorporate both unit and end-to-end testing into their automated processes, their applications will be prone to defects and failures in production.

In this article, we’ll discuss how you can realize the full promise of end-to-end automation by incorporating both the running of tests and reporting of testing results in a way that developers can easily understand and act on.

To learn more, join us for our upcoming webinar:

Automated Testing of Ext JS Applications Using Sencha Test
Tuesday, June 21, 2016
10:00am San Francisco PDT | 1:00pm New York EDT | 6:00pm London BST
Register Now

Development Workflow

Developing modern agile projects requires sophisticated testing and process tools that work together and can be integrated with your development process. There are numerous open source and commercial products that address integration and automation challenges, and continuous integration (CI) solutions are especially popular.

Most teams start by automating the build and deploy process, integrating the source control and build systems to ensure that problems such as build errors, conflicts and missing resources will be reported automatically for quick resolution. Continuous delivery (CD) takes this a step further, streamlining the process of delivering the product to the production environment.

Applications that perform well are not just built effectively but are tested meticulously. Manually testing a customer-facing web application across multiple web browsers and platforms has proven to be an unsustainable and unscalable approach over the long run. The overall testing cost for manual testing can exceed double the cost of automated testing, due to the need for more expensive resources during the testing phase and the higher cost of fixing defects late in the development process. With manual testing being so cumbersome and a lack of options for effective test automation, many teams avoid disciplined testing altogether and rely on an ad-hoc approach. With today’s aggressive release schedules, products can easily be built with undetected bugs and those products can make their way into production before effective testing can be completed.

To effectively incorporate testing into a CI/CD process, teams need to understand how different types of testing fit into an automated process, and they need to adopt tools that not only enable effective testing but integrate well into the CI/CD process. It’s especially important to consider how testing results can be effectively communicated to the development team, because developers often need a significant amount of information about the context within which the tests were run in order to make sense of the results.

Software Development and Testing

Organizations have turned to Agile methodologies for shorter release cycles and quicker application deployment turnaround. Developers in a team push their code to the source management system after unit testing their local working tree (by the way, this is a highly recommended practice). This code is reviewed and merged with the code written by the rest of the development team. At this stage a number of other tests can and should be performed on the integrated code base:

  • Unit tests
  • Integration Tests
  • Functional end-to-end tests

A unit test allows a developer to create tests for an isolated piece of code, such as a model, and ensures that all the validations defined in the model work as expected. Integration tests include tests of broader related components, such as testing a view by creating a fixture, testing the view, and tearing the fixture down after the test is completed. Functional end-to-end tests span even broader application contexts, such as workflows that an end user might exercise.

Testing the code in this way helps development teams maximize productivity while also improving product quality. Fast-running tests of limited scope can be run often to quickly identify certain problems, and the time-consuming, expensive broad-scope tests can be run on code that is less likely to fail because it has already passed many other tests.

Software Development and Testing

Ideally, these tests will exercise many different application contexts, such as interaction with APIs, database operations, concurrency and load scenarios, and so forth. By efficiently and automatically testing the various aspects of the code at the right time, development teams can consistently identify and fix problems quickly after they are introduced – leading to more predictable development schedules, higher quality code, and fewer costly bugs in production.

Those teams that are able to accomplish disciplined testing typically have to avoid manual testing and create a customized test automation framework based on open source frameworks and using a significant amount of custom-developed code. To remain useful across multiple browsers and platforms, these custom solutions typically work at the web client or DOM level. The resulting tests are typically hard to develop and brittle, because developers need to understand and work around browser-specific quirks and low-level DOM operations.

Integrating Sencha Test with Your Workflow

Integrating Sencha Test with Your Workflow

Sencha Test was designed to solve these testing problems by providing a comprehensive test automation solution for unit and end-to-end functional testing of JavaScript applications. Developers and test automation engineers can create tests using a behavior driven development strategy. Sencha Test leverages the proven Jasmine v2.4 testing framework as well as APIs that enable you to richly interact with Ext JS components in your application.

As you look at adding testing to your workflow, you already have your application server, a local workspace containing your project, and browsers upon which your application runs. Sencha Test includes all of the testing APIs, test execution logic, and reporting UI, which enable your team to efficiently create necessary, relevant tests.

The automation magic happens with the Sencha Test Command Line Interface (CLI) enabling CI/CD servers, including Jenkins or TeamCity, to execute relevant tests at appropriate times. Those tests are executed on your browser farm, whether an internal solution such as Selenium or a cloud-based solution such as Sauce Labs, to ensure that tests can scale according to workload and that they include the browser variants that you need to support. To learn more, read our blog post on Using Sencha Test with Jenkins and Selenium Grid.

Test results are stored in the Sencha Test Archiver, providing testers and developers with a rich interface for reviewing testing results and history. The Archiver is optimized to help users efficiently understand test failures in context, so problems can be quickly resolved.

Conclusion

Sencha Test is a powerful tool for improving your development and testing efforts and achieving the full promise of end-to-end automation. Using simple integration points and leveraging existing out-of-the-box functionality, you can easily run automatic and unattended tests on your Ext JS applications as part of your CI/CD process. You can test throughout the development process, quickly identifying and fixing problems as they arise. Your tests will also be more consistent, and you’ll reduce late-stage delays caused by unexpected test failures or long manual testing phases.

coming soon

Something Awesome Is

COMING SOON!