mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
Testing plugins: minor
This commit is contained in:
parent
0e840bc3fe
commit
1ff05cc7f8
@ -13,6 +13,8 @@ The test project files exist either in a temporary directory or in an in-memory
|
||||
>
|
||||
{type="warning"}
|
||||
|
||||
## Testdata Files
|
||||
|
||||
In your plugin, you usually store the test data for your tests (such as files on which plugin features will be executed and expected output files) in the <path>testdata</path> directory.
|
||||
This is just a directory under your plugin's content root, but not under a source root.
|
||||
Files in <path>testdata</path> usually are not valid source code and must not be compiled.
|
||||
|
@ -9,6 +9,8 @@ To test the highlighting for the file currently loaded into the in-memory editor
|
||||
The parameters to the method specify which severities should be taken into account when comparing the results with the expected results: errors are always taken into account, whereas warnings, weak warnings, and infos are optional.
|
||||
Alternatively, you can use the `testHighlighting()` method, which loads a <path>testdata</path> file into the in-memory editor and highlights it as a single operation.
|
||||
|
||||
## Inspections
|
||||
|
||||
If you need to test inspections (rather than generic highlighting provided by a highlighting lexer or annotator), you need to enable inspections that you're testing.
|
||||
This is done by calling `CodeInsightTestFixture.enableInspections()` in the setup method of your test or directly in a test method, before the call to `checkHighlighting()`.
|
||||
|
||||
|
@ -27,7 +27,7 @@ We recommend working with real components instead.
|
||||
Please see the dedicated [intellij-ui-test-robot](https://github.com/JetBrains/intellij-ui-test-robot) library.
|
||||
It is fully integrated with Gradle-based setup via `runIdeForUiTests` task.
|
||||
|
||||
Please do not use _platform/testGuiFramework_; it is reserved for internal use.
|
||||
Please do not use <path>platform/testGuiFramework</path> it is reserved for internal use.
|
||||
|
||||
## Topics
|
||||
|
||||
|
@ -15,3 +15,5 @@ However, for many common cases, the framework provides helper methods that can m
|
||||
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](test_project_and_testdata_directories.md#special-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()`.
|
||||
|
||||
See [Useful Classes](testing_faq.md#useful-classes) for other common testing functionality.
|
Loading…
x
Reference in New Issue
Block a user