Testing the game with Monkeyrunner

Is it possible to test the game using the Android Monkeyrunner tool. The game is developed using AndEngine or Cocos2D. If so, how can we get sprites in the test code?

Using the class, we can get the Android components (text box, button ...) on the screen, but how can we get sprites?

+3
source share
1 answer

Monkeyrunner only understands coordinates. To press the button, you pass the x, y coordinates. Unable to capture sprite on display only. It can capture the display buffer and write to the image file. Therefore, to check for a specific sprite in the entire image, you can use imagemagick compare.exe from the command line.

eg.

  • Capture the entire image from monkeyrunner.
  • For comparison, use the sprite link.
  • Run the command below from the command line

    compare.exe -metric NCC deviceRefImg WholeImage diffimage.png

The output value (NCC) applies if the sprite exists in the whole image.

Thank.

0
source

All Articles