Image assertion (imageIs)

in Japanese(日本語)

Classifies the image of the last grabbed element with a classifier trained from sample images (DefaultClassifier) and asserts its label.

Functions

function description
select(selector).imageIs(label, waitSeconds:) Asserts that the label the element's image is classified as contains label. Retakes and waits up to waitSeconds.
imageIs(label, waitSeconds:) The implicit form acting on the last grabbed element.

Where the sample images go

<project>/vision/classifiers/DefaultClassifier/
  @i/Settings/[Camera Icon]/   sample images (png / jpg)
  @i/Settings/[General Icon]/
  ...

Capturing and checking samples (CLI)

Instead of cropping samples by hand, capture them from the live device. The element's frame is cropped with the same function the judgement uses, so the crops always match.

fleetest vision capture --project <project> --classifier DefaultClassifier \
  --label "@i/Settings/[Camera Icon]" --selector "#element-id" --port <bridge port>
fleetest vision check --project <project>

On Android, pass --platform android --serial <serial> instead of --port.

Example

select("#settings_camera").imageIs("[Camera Icon]")

Notes