• @vigossjjj, 我把 custom.js 改了一下,就是在执行 monkey.RELEASE_THE_MONKEY 前执行前置操作比如登录注册等,现在看不了截图了,这个要怎么解决啊,我的具体修改内容如下:其他人如果知道怎么解决的麻烦回复我一下,谢谢啦
    // Release the monkey
    Login = function() {
    var target = UIATarget.localTarget();
    var app = target.frontMostApp();
    var window = app.mainWindow();

    target.delay(15);
    var loginButton = window.staticTexts()["登录"]
    var registered = window.staticTexts()["注册"];
    if (loginButton.checkIsValid())
    {
    window.textFields()["用户名或手机号"].setValue("chenxs");
    window.secureTextFields()[0].setValue("123456");
    app.keyboard().buttons()["Done"].tap();
    }
    else if (registered.checkIsValid())
    {
    window.staticTexts()["返回登录"].tap();
    target.delay(2);
    window.textFields()[0].setValue("chenxs");
    window.secureTextFields()[0].setValue("123456");
    app.keyboard().buttons()["Done"].tap();
    }
    UIALogger.logDebug("login over===========================");
    };

    function test_main(){
    Login();
    monkey.RELEASE_THE_MONKEY();
    };

    test_main();

  • #222 楼 @dodo 在 custom_cfg 里面根据每个不同功能业务来添加 js 脚本,这个问题知道怎么弄了吗,我最近也在写这个想请教一下

  • 我写了个 shell 脚本把 CrashMonkey4IOS 集成到 jenkins 后为什么总是会报这样的错误:直接执行时不会报错的但是集成到 jenkins 就会这样
    /Users/usercenter/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:315:in to_specs': Could not find 'smart_monkey' (>= 0) among 11 total gem(s) (Gem::LoadError)
    Checked in 'GEM_PATH=/Users/usercenter/.gem/ruby/2.2.0:/Users/usercenter/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0', execute
    gem envfor more information
    from /Users/usercenter/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:324:in
    to_spec'
    from /Users/usercenter/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in gem'
    from /Users/usercenter/.rvm/gems/ruby-2.2.1/bin/smart_monkey:22:in

    '
    from /Users/usercenter/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in eval'
    from /Users/usercenter/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in
    '

    问题已解决,我在 jenkins 配置 GEM_PATH 后就没问题了

  • 在 lib/ui-auto-monkey 中已经有个 custom.js 了,那么 custom_cfg 文件夹下的 custom.js 又是做什么用的呢,什么时候才需要用到 custom_cfg,如果是要该配置文件我直接修改 lib/ui-auto-monkey 目录下的 custom.js 不可以吗,有谁知道的麻烦帮忙解答一下疑惑,最近真正研究 ios monkey,上网找了好多资料都无果