* [webhelp] Fixes for TXP00152, TXP00002, test build 27 Jul 22:26 * [webhelp] Fixes for Part #4 TXP00010, EXCEPT decimal numbers in section titles * [webhelp] Fixes for Part #5 TXP00017 * [webhelp] Fixes for Part #4 TXP00010 - removed numbers from page section titles in "Custom Language Support Tutorial" and "Testing a Custom Language Plugin". * [webhelp] Removed numbers from page section titles in rest of project *.md files. * [new webhelp] Build #44 changes * [new webhelp] Maintenance merge from master * [new webhelp] Add placeholder file for webhelp import. * [webhelp] Correct redirects for file name changes * [webhelp] TOC not needed in webhelp * [format] {:toc} not needed for webhelp * add {:disable-links} to ensure demo links are not interpreted as real links. * Put all badges on the same line to simplify composition. * formatter.md: fix upsource link * fix some links * api_changes_list.md: remove note * migrate to webhelp - initial * fix GH edit URL * remove sdkdocs-template setup in VCS config * remove recently_updated.md * restore COC/CONTRIBUTING.md * api_changes_list.md: remove note * useful_links.md: IPE Co-authored-by: JohnHake <john.hake@jetbrains.com> Co-authored-by: Yann Cébron <yann.cebron@jetbrains.com>
1.8 KiB
In most cases, once you have the necessary files copied to the test project and loaded into the in-memory editor, writing the test itself involves invoking your plugin code and has few dependencies on the test framework.
However, for many common cases, the framework provides helper methods that can make testing easier:
type()
simulates the typing of a character or string into the in-memory editor.performEditorAction()
simulates the execution of an action in the in-memory editor context.complete()
simulates code completion invocation and returns the list of lookup elements displayed in the completion list (ornull
if the completion had no suggestions or one suggestion which was auto-inserted).findUsages()
simulates the invocation of 'Find Usages' and returns the found usages.findSingleIntention()
in combination withlaunchAction()
simulate the invocation of an intention action or inspection quick fix with the specified name.renameElementAtCaret()
orrename()
simulate the execution of a rename refactoring.
To compare the results of executing the action with the expected results, you can use the checkResultByFile()
method.
The file with the expected results can also contain markup to specify the expected caret position or selected text range.
Suppose you're testing an action that modifies multiple files (a project-wide refactoring, for example). In that case, you can compare an entire directory under the test project with the expected output using PlatformTestUtil.assertDirectoriesEqual()
.