Skip to content

Features

Diego Torres Milano edited this page Feb 16, 2017 · 41 revisions

UI Features

Controls

Shortcuts Menu

The most common commands are available through the Shortcuts Menu

The options included are

  • Start recording
  • Stop recording
  • Pause recording
  • Save recording
  • Quit

Indicators

Recording Indicator

While recording the RECORDING indicator blinks on the top left corner.

Device representation

Text input

Text can be entered in a dialog box using the local keyboard and then sent to a UiObject.

Touch

Touching on the device representation sends the touch event to the device connected and if RECORDING is active it will generate the line to reproduce such event when the test is run.

Feedback about the touched View or Point is showed on the device representation screen.

Also, feedback about the screen being updated after the event was sent is indicated by the blue mask that covers the screen while finishing the operation.

Long touch

A long touch can be produced by long clicking with the mouse on the device representation or use the context menu.

Touch and long touch a point

Sometimes, there are applications that create their own custom Views and handle the touch events inside.

Then, if we touch using the normal Features#Touch, the touch event will be generated in the center of the View and the custom View may understand it differently.

For such cases, touch point and long touch point allow more precise control of the event.

In this case, SIGN UP is not an extra button so we can use touch point to touch it.

Swipe

Scrollables

Set orientation

Set the scrollable orientation so next action (i.e. fling) will use that orientation to know which direction to scroll.

Fling

Flings the scrollable using the previously selected orientation (or default if not set)

Enumerate Children

While recording, and the context menu is displayed over a scrollable, the option Enumerate Children exists.

This option generates code similar to this one.

List<UiObject2> children = mDevice.findObjects(By.res("android:id/text1").pkg("com.dtmilano.android.demoapplication"));

Pinch Open/Close

Generates a pinch open or pinch close gesture.

Before

After

Take Screenshot

Takes the screenshot and saves it to a file.

Test Conditions

While RECORDING several test conditions can be generated and the best alternative depending on the context is selected by CulebraTester. The test menu contains

  • Assert View Exists
  • Assert Equals
  • Assert Same Value

Right-clicking on the Back-up my data Switch in Settings as shown in by previous screenshots, the following lines are generated (assuming code generation is set to Java UiAutomator)

    final UiObject2 uio23 = mDevice.findObject(By.res("android:id/switchWidget")
        .clazz("android.widget.Switch").text("ON")
        .pkg("com.android.settings"));
    assertThat(uio23.isChecked(), is(true));

Update

Sometimes it's needed to force an update of the screen because for example there has been interaction on the device itself and the changes need to be reflected in the UI or because the screen took longer than expected to change and when the UI took the screenshot and hierarchy dump it wasn't ready yet.

Orientation

Different orientations are supported (provided as an In-App Purchase). The left menu has been collapsed to give the device representation more room.

Hierarchy

Hover hierarchy

Hovering items on the hierarchy tree highlight the corresponding View on the device image.

If the highlight color is magenta the View is clickable otherwise it will be cyan.

This way you can even interact with web content which is also displayed in the hierarchy.

Source Code Generation

The buttons to

  • Start recording
  • Stop recording
  • Pause recording
  • Save recording are at the top.

The generated code, if any, is presented bellow the buttons.

Virtual Keyboard

Open Notifications

Opens the Notifications bar.

Open Quick Settings

Opens Quick Settings screen.

Support for different form-factors

Wear