Package: chancery
Chanceryis a very simple text editor foropenQA, i.e. allows to type text, save and open files. However, its main purpose is to speed up the development of openQA test scripts so it does not specialize in text typing in the first place. Its main strength is that it comes with a library of openQA command snippets that you can quickly insert using themenu itemsorkeyboard shortcuts.The current version (0.9) offers almost all snippets that are most frequently used in Fedora openQA scripts. The future versions will provide more and more snippets until the whole openQATestApiis covered. If you are new to openQA scripting, you might want to read theopenQA TestApito understand, how specific methods (snippets) work and what you can expect from them.How to use the applicationType in the text area.Insert snippets at a cursor position usingQuick actions,Menu, orKeyboard shortcuts.How to start with openQA scriptingEach script needs to be enclosed in thesub {}structure, or it will not work in the openQA engine. TheCreate file layoutbutton in theQuick actionswill insert the snippet for you.Each script needs to have a subroutine calledtest_flagsto set test flags for the script. TheSet test flagsbutton in theQuick actionswill insert the snippet for you with all the test flags switched off. To switch on the flag, change its value to1. Note, that some of the test flags contradict each other, such asno_rollbackoralways_rollbackso pay attention to the settings. You can also delete the unused flags for better readability.How to work with snippetsObligatory argumentsUsually, the methods useobligatory arguments, further calledarguments. These are presented asperl variables, such as$needlematchor$text.
You can either define these variables previously, or replace the references with expected values.Non-obligatory argumentsThe testAPI methods use various configuration options. When these are left out, the method then works with the default settings, which is mostly fine.
The snippets, however, provide all such configuration variables using the default values so they can be modified to suit the users’ needs without having to consult the documentation all the time. If youdo not need to alter an optionyou can leave it as is, or delete it from the snippet for better readability.ExamplesCreate a skeleton fileClickCreate file layouton theQuick actionsmenu.Navigate to the end of the file.ClickSet test flagson theQuick actionsmenu.Change the values to1for flags you want to set.Using the skeleton file to create a perl moduleCreate a skeleton file (see above).Add an event or command using the prebuilt snippets.Edit command snippet to suit your needs.Repeat for other commands.Save as.pmfile (Chancery sets the correct suffix for you.)Adding a command with a needleIf Libvirt is running on your system and it is running in the user space,
Chancery has the ability to connect to the virtual machine and take
a screenshot of the current screen and make it into an openQA needle.PressAlt-X-Vor selectVirtMachine > Connect to a VM.Choose one of the running VMs from the drop down menu.Click theConnectbutton.Select a snippet and add it to the file.Delete the$needlematchplace holder and leave a cursor in its place.PressAlt-X-Tor selectVirtMachine > Create needleto get the screenshot dialog.Set the primary tag. Note, that the needle file will be named with the tag’s name.ClickCreate needleto take a screenshot of the current status quo of the virtual machine and save it as a _png_ file.PressAlt-X-Eor selectVirtMachine > Edit needleto open the needle in an external needle editor called Needly. If you installed Chancery withpip, Needly should come with it. Otherwise, install Needly withpip install needly.Edit the needle and save it. Read the Needly documentation for more info on how to use Needly.How to report bugsIf you think you have found a bug, report it in the project’s issues.