0

I am testing my python application with e2e tests and use github actions as part of my CI. Normal selenium tests work totally fine. I added a click to copy functionality and want to test it via a unit test. So far I am using pyperclip to do this:

import pyperclip
link = pyperclip.paste()
assert link == "target link"

Locally on my machine (OSX) everything works fine. Unfortunately, I am not able to get this library working with ubuntu on github actions. I get this error:

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.

I've checked the page but I am not able to get it working. Does someone know a way how to access the clipboard in github actions?

hendrikschneider
  • 1,696
  • 1
  • 14
  • 26

1 Answers1

0

Try adding below run command before running the tests

- name: Install xsel
  run: sudo apt-get install xsel

Please find reference link

Sam-Sundar
  • 511
  • 1
  • 4
  • 12