26
loading...
This website collects cookies to deliver better user experience
js
, java
or python
to be able to write tests for complex parts of your web app.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
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
.ZWL
test verifies the basic functionality of google calculator.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))
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.