Functional testing using 🍅

Ali Reza Yahya
3 min readOct 2, 2018

--

Background: everything was started to minimize resources on manual testing. The problem that squad that I’m working with is lacking of QA engineer. Which causing development process getting much slower. Since all changes has to go through Code Review, then pass the pull-request to QA to do manual testing on shared testing environment (which never reliable 😢). That process is really frustrating, especially when it includes things that we can’t control.

So, we decided to start building an automated acceptance test using godog (well there is no 🍅 up until this point). After a month, we are able to cover most of our http api, message queue consumers with an automated testing. Which allows us to break things, refactor, do whatever we want with the code, and move forward without manual testing (with automated test as an excuse). I would say that helps speed up development process, developer happiness, and confidence to release the application.

When it started: things started when another squad tries to learn and build functional testing framework for their application. Then I realized that, there would be a lot of copy and paste of code, and set-up. When actually most of the functionality and the needs are the same. Beside if we are able to share testing code, that way we can have more solid testable code.

There when I thought of extracting all automated testing code into a separate repository that are able to be shared across application easily. That way, anyone will be able to write an automated test right away, without the hassle of building a framework and a bunch of set-up, and the repository called……. 🍅

What is 🍅?

So tomato is a set of pre-written function, that ready to use to test your system. Since it’s built on top of godog, the test is written in Gherkin. Which have very humanize syntax, that allows non-tech people to be able understand, here some example :

That set table and check table functionality is written in tomato, so if you want to test how your communication behave towards database, you’ll be able to immediately write the test cases without any needs of writing any code, and tomato will read your gherkin files, and execute all the steps, and give tells your the feedback.

How 🍅 works?

Tomato is a binary that will automate your test cases with given resources configuration and features.

testing before and after tomato

Tomato will access to your database, message queue, and even act as an external http api (in case you have external service as dependency). For alternative, wiremock also would be a good solution.

To get to know better, getting started.

--

--