Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
aurore::test::Harness Class Reference

#include <aurore/test/harness.hpp>

Public Member Functions

 Harness (Options options=Options())
 
 ~Harness ()
 
 Harness (const Harness &)=delete
 
Harness & operator= (const Harness &)=delete
 
const Options & options () const
 
HeadlessPlatform * platform ()
 
void push (Activity *activity, TransitionAnimation animation=TransitionAnimation::NONE)
 
Activity * top ()
 
View * find (const std::string &id)
 
void step (int count=1)
 
void advance (double ms)
 
bool settle (double maxMs=5000)
 
Time now () const
 
uint64_t frameCount () const
 
void press (ControllerButton button)
 
void release (ControllerButton button)
 
void tap (ControllerButton button, int times=1)
 
void hold (ControllerButton button, double ms)
 
void setAxis (ControllerAxis axis, float value)
 
void pressKey (AuroreKeyboardScancode key)
 
void releaseKey (AuroreKeyboardScancode key)
 
void tapKey (AuroreKeyboardScancode key, int times=1)
 
void touchDown (float x, float y, int finger=0)
 
void touchMove (float x, float y, int finger=0)
 
void touchUp (int finger=0)
 
void tapAt (float x, float y)
 
bool tapView (View *view)
 
void swipe (float fromX, float fromY, float toX, float toY, double ms=200)
 
void mouseMove (float x, float y)
 
void mouseClick (float x, float y)
 
void mouseQuickClick (float x, float y)
 
void mouseScroll (float dx, float dy)
 
void setKeyboardAnswer (const std::string &text)
 
View * focus ()
 
std::string focusText ()
 
const std::vector< std::string > & focusLog () const
 
void clearFocusLog ()
 
bool focusByText (const std::string &text, ControllerButton button=BUTTON_DOWN, int maxSteps=30)
 
std::vector< std::string > cutTexts ()
 
std::vector< std::string > texts ()
 
bool hasText (const std::string &text)
 
View * findText (const std::string &text)
 
std::vector< std::string > silentFocusables ()
 
Image screenshot ()
 
bool matchesReference (const std::string &name, int tolerance=8, double maxRatio=0.001)
 
bool matchesReference (const std::string &name, const Rect &area, int tolerance=8, double maxRatio=0.001)
 
const ImageDiff & lastDiff () const
 
void resize (int width, int height)
 

Constructor & Destructor Documentation

◆ Harness() [1/2]

aurore::test::Harness::Harness ( Options  options = Options())
explicit

◆ ~Harness()

aurore::test::Harness::~Harness ( )

◆ Harness() [2/2]

aurore::test::Harness::Harness ( const Harness &  )
delete

Member Function Documentation

◆ advance()

void aurore::test::Harness::advance ( double  ms)

◆ clearFocusLog()

void aurore::test::Harness::clearFocusLog ( )
inline

◆ cutTexts()

std::vector< std::string > aurore::test::Harness::cutTexts ( )

◆ find()

View * aurore::test::Harness::find ( const std::string &  id)

◆ findText()

View * aurore::test::Harness::findText ( const std::string &  text)

◆ focus()

View * aurore::test::Harness::focus ( )

◆ focusByText()

bool aurore::test::Harness::focusByText ( const std::string &  text,
ControllerButton  button = BUTTON_DOWN,
int  maxSteps = 30 
)

◆ focusLog()

const std::vector< std::string > & aurore::test::Harness::focusLog ( ) const
inline

◆ focusText()

std::string aurore::test::Harness::focusText ( )

◆ frameCount()

uint64_t aurore::test::Harness::frameCount ( ) const
inline

◆ hasText()

bool aurore::test::Harness::hasText ( const std::string &  text)

◆ hold()

void aurore::test::Harness::hold ( ControllerButton  button,
double  ms 
)

◆ lastDiff()

const ImageDiff & aurore::test::Harness::lastDiff ( ) const
inline

◆ matchesReference() [1/2]

bool aurore::test::Harness::matchesReference ( const std::string &  name,
const Rect &  area,
int  tolerance = 8,
double  maxRatio = 0.001 
)

◆ matchesReference() [2/2]

bool aurore::test::Harness::matchesReference ( const std::string &  name,
int  tolerance = 8,
double  maxRatio = 0.001 
)

◆ mouseClick()

void aurore::test::Harness::mouseClick ( float  x,
float  y 
)

◆ mouseMove()

void aurore::test::Harness::mouseMove ( float  x,
float  y 
)

◆ mouseQuickClick()

void aurore::test::Harness::mouseQuickClick ( float  x,
float  y 
)

◆ mouseScroll()

void aurore::test::Harness::mouseScroll ( float  dx,
float  dy 
)

◆ now()

Time aurore::test::Harness::now ( ) const

◆ operator=()

Harness & aurore::test::Harness::operator= ( const Harness &  )
delete

◆ options()

const Options & aurore::test::Harness::options ( ) const
inline

◆ platform()

HeadlessPlatform * aurore::test::Harness::platform ( )
inline

◆ press()

void aurore::test::Harness::press ( ControllerButton  button)

◆ pressKey()

void aurore::test::Harness::pressKey ( AuroreKeyboardScancode  key)

◆ push()

void aurore::test::Harness::push ( Activity *  activity,
TransitionAnimation  animation = TransitionAnimation::NONE 
)

◆ release()

void aurore::test::Harness::release ( ControllerButton  button)

◆ releaseKey()

void aurore::test::Harness::releaseKey ( AuroreKeyboardScancode  key)

◆ resize()

void aurore::test::Harness::resize ( int  width,
int  height 
)

◆ screenshot()

Image aurore::test::Harness::screenshot ( )

◆ setAxis()

void aurore::test::Harness::setAxis ( ControllerAxis  axis,
float  value 
)

◆ setKeyboardAnswer()

void aurore::test::Harness::setKeyboardAnswer ( const std::string &  text)

◆ settle()

bool aurore::test::Harness::settle ( double  maxMs = 5000)

◆ silentFocusables()

std::vector< std::string > aurore::test::Harness::silentFocusables ( )

◆ step()

void aurore::test::Harness::step ( int  count = 1)

◆ swipe()

void aurore::test::Harness::swipe ( float  fromX,
float  fromY,
float  toX,
float  toY,
double  ms = 200 
)

◆ tap()

void aurore::test::Harness::tap ( ControllerButton  button,
int  times = 1 
)

◆ tapAt()

void aurore::test::Harness::tapAt ( float  x,
float  y 
)

◆ tapKey()

void aurore::test::Harness::tapKey ( AuroreKeyboardScancode  key,
int  times = 1 
)

◆ tapView()

bool aurore::test::Harness::tapView ( View *  view)

◆ texts()

std::vector< std::string > aurore::test::Harness::texts ( )

◆ top()

Activity * aurore::test::Harness::top ( )

◆ touchDown()

void aurore::test::Harness::touchDown ( float  x,
float  y,
int  finger = 0 
)

◆ touchMove()

void aurore::test::Harness::touchMove ( float  x,
float  y,
int  finger = 0 
)

◆ touchUp()

void aurore::test::Harness::touchUp ( int  finger = 0)

The documentation for this class was generated from the following file: