Introducing the easiest automated testing platform for web apps
Tags: testing, webdev
Published: 2021-07-11 05:56:16

In this post, I'm introducing a new platform that can transform the way automated tests for web applications are written, run and managed.

## Context

If you're a web developer or QA engineer, there are strong chances you write automated tests for your browser based applications. Even if you don't, for any reason, this post may encourage you to begin.

Arguably the best way to test browser based applications is end to end testing (_e2e_ in short) because it encourages simulation of a real user testing your app. It also makes refactoring your application easier because these tests are not tied to the implementation path. You can write end to end tests without looking into the code making them easy to maintain than unit tests.

## E2E Testing tools

To successfully test a web app, there are a few tools you may be using currently. Some of them are:

- A testing framework (selenium, cypress or nightwatch)
- An IDE (VS code or IDEA)
- test runner (Mocha or JUnit)
- Assertion library (chaijs)
- Versioning system (git)
- Some tool for keeping track of test runs, storing test results (screenshots, videos and logs).
- Infrastructure to run tests on multiple OS and browsers (browserstack, saucelabs, or own setup)

In addition to these, you've to be good in a programming language such as `js`, `java` or `python` to be able to write tests for complex parts of your web app.

Wouldn't it be great if I tell you there is something that packs all these things in just a single platform and is accessible right from a web browser?

## Introducing Zylitics

Zylitics is a new testing platform that contains every tool required to successfully test web applications. It frees you from thinking in terms of drivers, frameworks, infrastructure or anything else that consumes time to manage and maintain.

Zylitics manages everything else so that you can just focus on writing tests. To get started with Zylitics, all you've to do is to open a browser and begin writing tests. Following are some of the most important features and tools Zylitics provide:

- __A new programming language called `ZWL`__: ZWL is created to let devs/QA write complex tests in easy declarative steps. I wanted to make it easier than ever for people with less programming experience to be able to write tests comfortably. ZWL is dead easy to learn, understand and write. There are no new syntaxes. It is declarative and contains hundreds of built-in functions to make automation easiest. It abstracts away complexities, waits automatically and handles edge cases. Here is an [overview of ZWL](https://docs.zylitics.io/zwl/overview)
- __A desktop like IDE__: Zylitics IDE allows you to write, run and debug tests. Tests can be run on multiple OS and browser combination. Test results are immediately accessible. Live preview and real time output are automatically relayed while tests are running. Here is how it looks:
![Zylitics IDE](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wpcyrho7x7uem7hpsxcs.png)
![Zylitics IDE Live Preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8a4y6kj8eqcflju66q1l.png)
Read more about [Zylitics IDE](https://docs.zylitics.io/ide/introduction)
- __A managed infrastructure__: Zylitics allows tests to run on various OS and browser combinations. Several old browser versions are always maintained. All tests run on remote VMs that are quickly provisioned. When developing on IDE, remote VMs are provisioned under 10 seconds.
- __A built-in test runner__: Zylitics test runner is capable of executing hundreds of tests together and provides real time progress. Various configuration options are available to customise the handling of tests. Multiple test suites can be run in parallel.
![Zylitics test runner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zeiqda293da4anje8dtd.png)
- __Test assets management__: Tests generate a lot of interesting information that are important for debugging and analysis. Zylitics provide detailed test results as soon as runs are completed. Screenshots, videos, logs, output and everything else is kept forever. You will never loose valuable details.
![IDE Completed Builds](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s8mnhb6qmspphfc7ib2x.png)
![Console Completed Builds](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hpvq0onwodp6y6nmc1lh.png)
- __Code management__: Create unlimited files, tests and their versions. Code is auto saved and parsed. Every test run captures the state of code at the time of running. You can always see what code was used to run a test even if it ran a year ago.
- __Excellent documentation__: Zylitics documentation is one of the best knowledge source for testing you'd find on internet. There are tons of guides and examples that help you handle tricky use cases very easily. Have a look at [Zylitics docs](https://docs.zylitics.io/).
- __Forum and discord server__: Both of these are very actively monitored. If you've a question, it will be answered in no time.

## Writing tests in Zylitics

`ZWL` is used at Zylitics for automating tests. It encourages simplicity while providing powerful language features such as various string, list and map manipulation methods to help with complex use cases. Let me show you an example test written in `ZWL`.

Following `ZWL` test verifies the basic functionality of _google calculator_.

```sh
openUrl('https://google.com')
# Find search box and type query
type(findElement('Search', by.ariaLabel), 'calculator', keys.enter)
# Find the calculator so that we can limit our further searches only within calculator panel.
calculator = findElement('div[role="main"] div[data-async-context="query:calculator"] > :first-child', by.cssSelector)
# Keep the calculator buttons we require to press.
btn9 = findElementFromElement(calculator, '9', by.text)
btnMul = findElementFromElement(calculator, '×', by.text)
btnDiv = findElementFromElement(calculator, '÷', by.text)
btnEq = findElementFromElement(calculator, '=', by.text)
# Keep the result element that shows calculation result.
resultEl = findElementFromElement(calculator, 'presentation', by.role)

# Our first calculation is 9*9
clickAll(btn9, btnMul, btn9, btnEq)
# Assert the result is 81
assertTrue(81 == getElementText(resultEl))

# Our final calculation is to divide the result by 9 twice
clickAll(btnDiv, btn9, btnDiv, btn9, btnEq)
# Assert the result is 1
assertTrue(1 == getElementText(resultEl))
```

The code is self explanatory. It's clean, easy to read and validates some functionality of google's in-search calculator.

This is a very basic test. `ZWL` supports hundreds of built-ins to support almost all use cases. To run this test, you don't need do anything special. With a few keystroke, your tests can be run on choice of OS and browser combination and you can live preview it as well.

## Get started with Zylitics video

{% youtube ZOkpb-iYuGA %}

## Conclusion

I hope you liked the idea of Zylitics and the way it simplifies testing. It is currently in private beta and access is free for everyone. Please request an invitation from [zylitics.io](https://zylitics.io/) and give it a try.

I will write a series of blog posts to further discuss how to write tests for various use cases in ZWL. Please follow to get further updates.