Macaca 两个一样的 testcase.js 文件,为什么运行时,只有第一个 js 可以正常运行?

JackLai · 2017年06月02日 · 633 次阅读

macaca run -d testcase/ -r mochawesome-uirecorder --verbose

testcase 目录下面有 2 个 js 文件,内容除改了 caseName,其他完全一样。

两个一样的 testcase.js 文件,为什么运行时,只有第一个 js 可以正常运行?

if(module.parent && /mocha\.js/.test(module.parent.id)){
    commons.runThisSpec(appPath, runTestcase,specName);//用例执行入口 commons/commons.js#runThisSpec
}

第一个 js 运行正常,成功结束。
第二个 js 运行时报错,提示这 2 个 text 找不到。可是界面是有这 2 个 text 的。

日志:


1) 测试手机192.168.56.102:5555 JYM_UIAutoTest-1 : 192.168.56.102:5555 点击: 我的:
     Error: the string "Wait element displayed timeout: //*[@text=\"我的\"] ,5000ms" was thrown, throw an Error :)
      at Runner.fail (node_modules/_mocha@3.1.2@mocha/lib/runner.js:233:11)
      at node_modules/_mocha@3.1.2@mocha/lib/runner.js:566:18
      at done (node_modules/_mocha@3.1.2@mocha/lib/runnable.js:293:5)
      at ChainPromise.<anonymous> (node_modules/_mocha@3.1.2@mocha/lib/runnable.js:354:11)
      at process._tickCallback (internal/process/next_tick.js:109:7)


2) 测试手机192.168.56.102:5555 JYM_UIAutoTest-1 : 192.168.56.102:5555 点击: 个人中心:
     Error: the string "Wait element displayed timeout: //*[@text=\"个人中心\"] ,5000ms" was thrown, throw an Error :)
      at Runner.fail (node_modules/_mocha@3.1.2@mocha/lib/runner.js:233:11)
      at node_modules/_mocha@3.1.2@mocha/lib/runner.js:566:18
      at done (node_modules/_mocha@3.1.2@mocha/lib/runnable.js:293:5)
      at ChainPromise.<anonymous> (node_modules/_mocha@3.1.2@mocha/lib/runnable.js:354:11)
      at process._tickCallback (internal/process/next_tick.js:109:7)

有知道的吗?

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册