【发布时间】:2021-10-03 12:03:50
【问题描述】:
我正在使用 e2e 测试来测试我的 python 应用程序,并将 github 操作用作我的 CI 的一部分。正常的硒测试工作得很好。我添加了单击以复制功能并希望通过单元测试对其进行测试。到目前为止,我正在使用 pyperclip 来执行此操作:
import pyperclip
link = pyperclip.paste()
assert link == "target link"
在我的机器 (OSX) 上本地一切正常。不幸的是,我无法让这个库在 github 操作上与 ubuntu 一起工作。我收到此错误:
Pyperclip could not find a copy/paste mechanism for your system. Please see https://pyperclip.readthedocs.io/en/latest/introduction.html#not-implemented-error for how to fix this.
我已经检查了该页面,但无法使其正常工作。有人知道如何在 github 操作中访问剪贴板吗?
【问题讨论】:
标签: python django selenium github-actions