Qafoo GmbH - passion for software quality

Help you and your team benefit from new perspectives on cutting-edge quality engineering techniques and tools through the Qafoo team weblog.

By Kore Nordmann, first published at Mon, 18 Nov 2013 10:04:28 +0100

Download our free e-book "Crafting Quality Software" with a selection of the finest blog posts as PDF or EPub.

Crafting Quality Software

You can also buy a printed version of the book on Amazon or on epubli.

Shopware Academy: Functional Testing

Shopware is based on a custom framework that utilizes some Zend Framework 1 and Symfony 2 components. Writing automatic tests within this pre-existing infrastructure makes it neccessary to obtain a dedicated skillset within this system. This applies to any othe rend-user software like Wordpress, TYPO3, ezPublish or phpBB.

Learn how to automate testing for Shopware plugins and applications by attending the Shopware Academy workshop by our trainer Manuel.

To test the full stack, the software has to be installed on the development- and the testsystem. The full stack includes all the required configuration and database content. In the case of Shopware significant parts of the configuration are saved in the database. Before writing the first tests you have to automate the setup of your application including the configuration for the database. This setup has to mirror your production system as close as possible and you need to make sure that changes to the production setup are also ported to your testing setup.

As a next step, you will need to find out how to write your first functional test. There are two recommendable approaches:

  1. Using a frontend testing tool such as Mink. This is basically a programmatic API to control a browser, which supports both headless or real browser testing. Mink can be used through the popular testing tools Behat or PHPUnit.

    This has the benefit that you don't need to understand most of the internals of Shopware and can just click through your shop application and test features. One drawback however is, that Shopwares ExtJS backend is so dynamic that it is not testable with this approach.

  1. Replicating the functional testing strategy of Shopware by using the test infrastructure that already exists. To test the REST API and the internal APIs Shopware contains several PHPUnit testcases that help you setting up tests and isolating them from each other.

    The benefit here is that Shopware already includes this functionality and you can learn how it works and reuse it. The drawback is that not everything can be easily tested through these APIs. Sometimes it is tricky to set these tests up.

In any case, writing the first test often requires a bit of setup and knowledge, but quickly pays back when you can build on this knowledge to automate many tests for your application.

If you are interested in strategies for testing Shopware plugins or applications you should take a look at this one-day workshop at the Shopware Academy presented by our trainer Manuel. The workshop will include many theoretical and practical sessions, where you can learn to write functional tests for Shopware.

Download our free e-book "Crafting Quality Software" with a selection of the finest blog posts as PDF or EPub.

Crafting Quality Software

You can also buy a printed version of the book on Amazon or on epubli.

Get Technical Insights With Our Newsletter

Stay up to date with regular new technological insights by subscribing to our newsletter. We will send you articles to improve your developments skills.

Comments