我想从Jenkins本地运行Python测试用例。我有一个shell脚本,在我的Mac终端上可以很好地执行:
$ cat script.sh
#!/bin/bash
appium &
sleep 10s
cd /Users/<user>/eddie-qa/automation
nosetests -s --tc-file=/Users/<user>/eddie-qa/automation/mobile_automation/configs/local_config_android_galaxy_6_0.py --tc-format python mobile_automation.tests.login_logout.tests_login_logout:TestLogin.test_05_incorrect_username_login
但当我用同样的脚本从詹金斯那里运行时:
它返回错误:
ImportError: No module named mobile_automation.configs.devices
我的文件local_config_android_galaxy_6_0.py
以以下行开头:
from mobile_automation.configs.devices import desired_caps
global config
config = {}
在devices.py
中,代码以:
我不知道为什么会失败。
如果我不使用--tc-file=/Users/<user>/eddie-qa/automation/mobile_automation/configs/local_config_android_galaxy_6_0.py
执行脚本,那么它就可以工作了。在
项目结构:
如果有人有主意请告诉我。在
附加信息:
目前没有回答
相关问题 更多 >
编程相关推荐