commercetest / commercetest/android-monkey-test-with-login

Reproducible testing using Android Monkey

Open
#3 1 comment 0 reactions 1 assignee Claimed by @julianharty View on GitHub
enhancement
Dominant language
Java
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

One of our experiments is to use Monkey to compare the crashes it generates with those reported elsewhere (including Android Vitals). To do so we would like to discover whether Android Monkey will obey a script reliably and repeatably.

Here is an extract from Monkey's source code regarding the format of a script's contents:
```
/**
* monkey event queue. It takes a script to produce events sample script format:
*
*

 * type= raw events

* count= 10
* speed= 1.0
* start data >>
* captureDispatchPointer(5109520,5109520,0,230.75429,458.1814,0.20784314,0.06666667,0,0.0,0.0,65539,0)
* captureDispatchKey(5113146,5113146,0,20,0,0,0,0)
* captureDispatchFlip(true)
* ...
*

*/
```
https://android.googlesource.com/platform/development/+/master/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java

To ask Monkey to generate a script try using the `--script-log` command-line option:
```
if (opt.equals("--script-log")) {
mScriptLog = true;
```

And to use a script file:
```
/** filenames of the script (if any) */
private ArrayList mScriptFileNames = new ArrayList();
...
if (opt.equals("-f")) {
mScriptFileNames.add(nextOptionData());

... And the seed may need to be consistent too:
if (opt.equals("-s")) {
mSeed = nextOptionLong("Seed");
...
if (mScriptFileNames != null && mScriptFileNames.size() == 1) {
// script mode, ignore other options
mEventSource = new MonkeySourceScript(mRandom, mScriptFileNames.get(0), mThrottle,
mRandomizeThrottle, mProfileWaitTime, mDeviceSleepTime);
mEventSource.setVerbose(mVerbose);

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.