Coder Social home page Coder Social logo

haxeium's Introduction

Haxium an automated UI testing framework

framework consists of two parts:

  1. a driver that you have to include in your application (e.g. via new HaxeUIDriver("ws://127.0.0.1:9999")).
  2. your testrunner application, where you use AppDriver to communicate with your application during testruns

it currently supports C++ and HTML5 applications based on HaxeUI (all tests were done using OpenFL flavour of HaxeUI, technically it can work with other backends, but that remains to be seen). testrunner runs as a C++ application.

installation

lix download gh:AlexHaxe/haxeium

getting started

in your application you want to add new HaxeUIDriver("ws://127.0.0.1:9999"); somewhere at the start / during initialisation. you will also need to add haxium lib as a dependency to your project. HaxeUIDriver will try to connect to your testrunner application via websocket. once connected it will receive and execute commands that simulate inputs from a user.

next step is to create a testrunner app using utest and haxeium libraries. you will initialise AppDriver and instruct it to open the very websocket port your application is trying to connect to. you will also have to configure and pass an AppRestarter instance so it can launch your application whenever necessary.

then you start writing testcases the way you would when doing regular unittesting with utest. you can use some ITest compatible base classes to e.g. make your testcases auto restart your application between each testcase. they also provide a way to automatically take screenshots in case of test failures. so that you can see what state your application was in when a failure occured.

for your testcases there are commands that will send mouse or keyboard events and you can read and write any property of a HaxeUI component. there is also ways to find and address components. a Wait helper class provides a few blocking functions to wait e.g. for an element to become available. an Actions class allows to define a sequence of input actions, that you can apply multiple times.

running samples

building C++ app

for Linux builds

cd samples/haxeui/button
lix download
lime build linux # build app to test
haxe build.hxml # build testrunner

bin/TestMain # launch testrunner - will automatically start and kill app multiple times during run

for Windows builds

cd samples/haxeui/button # or samples/haxeui/login
lix download
lime build windows # build app to test
haxe buildWindows.hxml # build testrunner

bin/TestMain.exe # launch testrunner - will automatically start and kill app multiple times during run

building Html5 app

cd samples/haxeui/button # or samples/haxeui/login
lix download
lime test html5 # build app to test and launch app in web browser

in second window run

cd samples/haxeui/button # or samples/haxeui/login
haxe buildHtml5.hxml # build testrunner

bin/TestMain # launch testrunner - will automatically reload app webpage multiple times during run

haxeium's People

Contributors

alexhaxe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.