Sneak a Peek, Our Way of Testing

Sead Alispahic
The Apps Team
Published in
2 min readSep 13, 2018

We are working on Admin website for our mobile application My Health Prompt. This is a sort of quick view of how we test our web applications.

Our testing stack is PyCharm, selenium, python and behave.

PyCharm is a python IDE available from JetBrains https://www.jetbrains.com/pycharm/

Selenium is a tool for web browser automation available from Selenium HQ https://www.seleniumhq.org/

Python is just another programming language. We use it because it is easy. One can became an Python expert in two weeks. It is available from Python.org https://www.python.org/downloads/

Behave is a python BDD tool. We do not use it strictly as BDD, but we use it to create tests that are in natural language format. It is available via pip

Setting up behave is a bit involved process. JetBrains have a lot of information how to set behave in PyCharm. Once you finished setting it up, you can start writing tests.

A lot of people will criticise Selenium tests as slow and brittle. They are very slow, since they are testing the full slice, including your network. Brittle they might be, if you write them to be brittle. Selenium offers tools to record tests. That will make your tests brittle and hard to update.

What we do most often is make a cut down version of Page Object pattern. https://martinfowler.com/bliki/PageObject.html We do not need all the complexities of full PageObject pattern, because we make simple apps not used by heaps of people and Python offers ways to mimic things needed in PageObject without building them. For example, we do not use IOC pattern as such, even though good PageObject will use IOC. We attach objects to context, and then use that as IOC. Sometimes Python being weird works for you, right.

--

--