-
Notifications
You must be signed in to change notification settings - Fork 44
Pecunia Plugin Tester (english)
Pecunia supports a test application that allows quick development of plugin scripts for Pecunia without running Pecunia actually. Here's a screenshot of it after running a credit card query:
It provides a testing environment that behaves very much like Pecunia itself (with some mock data that is not important for plugin development). What you usually do is to specify a plugin you work on and load it into a JS context by using the "Trigger plugin loading" button. To ease this even more, the test app listens to changes of the selected file and if you check "Auto load on change" it will auto load the script whenever you save it in your preferred editor.
Once loaded you will see the 2 mandatory values that must be returned by a plugin (name + description). Now you can enter user name, password and other details to run your query. The account field can take one or more account numbers, separated by comma. All these values are autosaved and loaded, so that you don't have to enter them again and again. If you want them removed from the app settings (e.g. the password/PIN) clear the associated field and run a query (by clicking on "Get Statements").
The log field shows output from different sources (the test app, the plugin worker and the script). With the drop down at the bottom you can filter output. Green text is from the test app. All other text comes via the log functions (remember the logger object in the JS context). The "Dump HTML" button prints the current body inner HTML in the log view.
Behind the scenes the plugin system uses an invisible WebView instance to handle all web related stuff (navigation, DOM, embedded JS etc.). For testing purposes this view can be made visible and shown in a standalone support window (by clicking the Safari icon). The debugging console is enabled for this web browser view, so you can open that via the context menu and dig even deeper into the web code.