Skip to main content
Blog General

Magento 2 Extensions – Functional Automation Testing

Bhavani
April 13, 2017 |

All you need is extensions built exclusively for your Magento store. Get them from our Magento 2 extensions store here.

Retailers need customized features specific to their website which is not readily available in Magento. In this scenario, extensions come in handy to make the site unique and optimized. Extensions can improve the conversion funnel by improving search, checking out quickly etc. Extensions can make or break conversions. So, it is critical to give quality delivery of the extensions to the marketplace.

Automation Testing By Implementing Modules

It is critical to ensure extension functionality is working. To begin with, we need to manually test the functionality of the extension in a stable build.  Once this is done, we need to enhance the quality of the testing by automation. The below diagram provides an overview of the automation set up for the extensions testing.

magento 2 QA

Most of the Magento extensions have common features for configuration and the integration of admin and front end. In the below example, we will see how we approach extensions testing.

In the module script, we have defined the global variables/constants and the functions which are frequently used in multiple scripts/test suites.

The sample module script is below:

In the main test script, we can call the functions and use the variables declared in the sample module script. For example, in our sample module script, we have created a random email id function to generate dynamic mail id test data. This is used in our main test scripts.

Similarly, by changing the base URL in a single place in the sample module script, we can execute it in multiple environments including QA, Staging and Production environments. This will help to improve the test coverage in extensions testing.

In the main test script example given above, we are checking the front end functionality of the extension like the availability of the extension feature and its form submission. Once the submission is done, we are logging in as admin to cross verify if the submission has been stored in Magento admin backend.This modular approach will save our time and avoid redundancy of work.

When we test in multiple Magento 2 and PHP versions, the testing time will be saved by executing such automation scripts.

The main test script:

Additional Read:

Please refer the blogs below for setting up the framework and execution of the scripts.

Responsive Design Automation Testing With Node.js, Webdriver.io And Mocha
E-commerce Continuous Test Management With Jenkins

Visit Klizer Store for your Magento Extension needs.

References

Bhavani

Bhavani is Certified Software Test Manager and Six Sigma Green Belt. Passionate about testing eCommerce sites. Learning and implementing the latest automation tools. Mentoring.

More posts by Bhavani