Hi,
I implemented a python interface for Joplins data API, since the other python API is not maintained anymore. I would like to run automated tests without any user interactions. The only way I found to start webclipper looks as follows:
Download joplin
Start joplin in virtual framebuffer
Navigate to the webclipper button via pyautogui and selenium
Click the button and copy the token
Access the API
This is cumbersome. Is there are more convenient way?
I think in theory you could write directly to Joplin's sqlite database as if webclipper has been enabled.
However this is obviously unsupported and prone to break sooner or later.
If you still would like to try, something like this may work:
Create an empty Joplin profile and dump the settings table.
Set up webclipper (can be done from the desktop app) and dump settings again.
Diff and see which settings are needed to enable webclipper.
Now in your tests you can write these settings directly to the database (when Joplin is stopped)
@rxliuli: My idea was to use as less dependencies as possible. So installing npm is not an option in this case. @roman_r_m: The database itself doesn't contain the setting. However, there is settings.json that contains a parameter clipperServer.autoStart. Setting this variable works
Thank you both for the help!
Do you know if it would be difficult to add a command line argument (something like --autostart-webclipper) for convenience?