Fork me on GitHub

xface

A simple AsUnit/FlexUnit 4 style UI-Unit framework, but not for testing. It's a tool to reach and verify UI implementation fast.

Demo (source)

Alternative content

Examples:

Runner:
public class DemoRunner extends Sprite
{
    public function DemoRunner()
    {
        super();
        XFace.run(this, AllUnits);
    }
}
            
Suite:
[Suite]
// Use "label" to change the display name of the suite.
// [Suite(label="All elements")]
public class AllUnits
{
    public var _TextUnit:TextUnit;
    public var _ShapeSuite:ShapeSuite;
    public var _MinimalSuite:MinimalSuite;
}
            
Use variables will not have the same order. To have the order use suite method (use "suite" as method name and return an Array with classes):
[Suite]
public class AllUnits
{
    public static function suite():Array
    {
        return [
            TextUnit,
            ShapeSuite,
            MinimalSuite
        ];
    }
}
            
Unit:
public class PushButtonUnit
{
    private var instance:PushButton;

    [Before]
    public function setUp():void
    {
        instance = new PushButton();
        XFace.display(instance, 10, 30);
    }
    [Test]
    public function toggle_is_false():void
    {
        instance.label = "Click me";
        instance.toggle = false;
    }
    [Test]
    public function toggle_is_true():void
    {
        instance.label = "Click me";
        instance.toggle = true;
        instance.selected = true;
    }
}
            

Authors

Evan Liu (evancoding@gmail.com)

Download

You can download this project in either zip or tar formats.

You can also clone the project with Git by running:

			$ git clone git://github.com/evan-liu/xface