https://github.com/marph91/joplin-ui-tests
UI tests for joplin with selenium
https://github.com/marph91/joplin-ui-tests
electron joplin joplin-api python selenium
Last synced: 11 months ago
JSON representation
UI tests for joplin with selenium
- Host: GitHub
- URL: https://github.com/marph91/joplin-ui-tests
- Owner: marph91
- Created: 2021-09-25T12:28:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-09T14:27:47.000Z (about 3 years ago)
- Last Synced: 2025-04-09T09:51:50.172Z (about 1 year ago)
- Topics: electron, joplin, joplin-api, python, selenium
- Language: Python
- Homepage:
- Size: 128 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# joplin-ui-tests
[](https://github.com/marph91/joplin-ui-tests/actions/workflows/ui-tests.yml)
System tests for the [joplin](https://joplinapp.org/) desktop application in python.
## Motivation
Main motivation is to learn how an electron app can be tested with selenium.
## Requirements
Example for ubuntu 20.04:
```bash
sudo apt install ffmpeg xvfb
pip install -r requirements.txt
```
## Test Overview
### What is tested?
All tests of the following table are successfully executed, except of the tests marked with ☒.
| Section | Function / Feature | By | Comment |
|----------|---------------------------|-------------|-----------------------------------------------|
| General | Focus note list | Hotkey | |
| | | Top menu | |
| | Focus note title | Hotkey | |
| | | Top menu | |
| | Focus note body | Hotkey | |
| | | Top menu | |
| | Focus sidebar | Hotkey | |
| | | Top menu | |
| | Go back | Top menu | |
| | Go forward | Top menu | |
| | Goto anything | Hotkey | ☑ Notebooks ☒ Tags and notes |
| | | Top menu | |
| | Show app title | - | |
| | Change app layout | Top menu | Smoke test |
| | Toggle sidebar | Hotkey | |
| | | Top menu | |
| | Toggle note list | Hotkey | |
| | | Top menu | |
| | Zoom (in, out, reset) | Hotkey | |
| | | Top menu | ☒ Slow |
| Editor | Show note properties | Button | |
| | Toggle layout | Button | |
| | | Hotkey | |
| | | Top menu | |
| Notelist | Add note | Button | |
| | | Hotkey | |
| | | Top menu | |
| | Add todo | Button | |
| | | Hotkey | |
| | | Top menu | |
| | Delete note | Hotkey | ☒ Cause not clear |
| | | Right click | ☒ Cause not clear |
| | Duplicate note | Right click | |
| | Switch type (note - todo) | Right click | |
| | Complete todo | Click | |
| | Get link | Right click | |
| Sidebar | Synchronise button | Click | Smoke test |
| | Add notebook | Button | |
| | | Right click | |
| | | Top menu | |
| | Add sub notebook | Right click | |
| | | Top menu | |
| | Delete notebook | Hotkey | ☒ Cause not clear |
| | | Right click | ☒ Cause not clear |
| | Rename notebook | Right click | |
| | Note count label | - | ☒ Not displayed for long notebook names |
| | Notebook collapsing | Click | |
| | Show all notes button | Click | |
| | Drag notebook | Click | ☒ Webdriver bug |
| | Export notebook | Click | ☒ Download dialog doesn't work |
| | Add tag | Bottom bar | |
| | | Hotkey | |
| | | Right click | |
| | | Top menu | |
| | Delete tag | Right click | ☒ Cause not clear |
| | Rename tag | Right click | |
| | Tag collapsing | Click | |
### What is not tested?
Except of the marked tests in the table above, there are some other untested features:
- Searching:
- Attachments:
- External editor:
- Note history:
- Encryption:
- Synchronisation:
- Importing:
- :
- Sorting notes
- Alarms
- Inline display of PDF, video and audio files
- Geo-location
- Multiple languages
- Custom keyboard shortcuts
## Usage
Don't run with your normal joplin profile, since the tests are modifying and deleting the content!
```bash
python run_tests.py
```
## Test structure
The tests are usually structured in the following way:
1. set the preconditions via API
2. do the UI action
3. check the results via API
Single tests are not independent. Only test classes are mostly independent, since that saves much time. The webdriver and xvfb session are shared through all tests.
## Lessons learned
- Don't use language dependent locators. There were several problems, because my system language is german, but at the reference, I used english.
- Recording the full testsuite can be very valuable. For example at the frame by frame playback, it was visible that the top menu did lose focus, because the label count was updated one frame after focussing.
- `find_elements*` is time consuming, since it has to search the full tree. In contrast `find_element*` returns the first found item.