Skip to content

Latest commit

 

History

History
127 lines (104 loc) · 8.27 KB

README.md

File metadata and controls

127 lines (104 loc) · 8.27 KB

joplin-ui-tests

ui-tests

System tests for the joplin 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:

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:

Usage

Don't run with your normal joplin profile, since the tests are modifying and deleting the content!

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.