【问题标题】:Is it possible to execute a piece of commands written in text file using pycharm?是否可以使用 pycharm 执行一段用文本文件编写的命令?
【发布时间】:2021-03-27 12:40:27
【问题描述】:

是否可以使用pycharm执行一段写在文本文件中的命令?

实际上,我希望在关闭浏览器或执行“yield”后执行一次命令“allure serve”(在我的 selenium pytest 框架内)一次

有什么方法可以在我的 pytest 框架中编写“allure serve”命令,或者我可以在文本文件中编写此命令,并且可以在执行 yield 后读取该文件?

【问题讨论】:

    标签: shell selenium-webdriver pycharm pytest allure


    【解决方案1】:

    是的,您可以使用 Python 执行系统命令。请看问题How to execute a program or call a system command from Python

    您可以考虑使用外部包将 pytest 与 allure 集成。请检查问题Generating allure report using pytest

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-24
      • 2014-09-16
      • 2018-11-04
      相关资源
      最近更新 更多